From a076ebe0213f46168650256dd21a4ec5273af476 Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Mon, 28 Aug 2017 23:01:43 -0400 Subject: [PATCH] Update setup.py --- setup.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 9607f2c..61a740a 100644 --- a/setup.py +++ b/setup.py @@ -41,16 +41,17 @@ about = {} with open(os.path.join(here, NAME, "__version__.py")) as f: exec(f.read(), about) -def status(s): - """Prints things in bold.""" - print('\033[1m{0}\033[0m'.format(s)) - class PublishCommand(Command): """Support setup.py publish.""" description = "Build and publish the package." user_options = [] + + @staticmethod + def status(s): + """Prints things in bold.""" + print('\033[1m{0}\033[0m'.format(s)) def initialize_options(self): pass @@ -60,15 +61,15 @@ class PublishCommand(Command): def run(self): try: - status('Removing previous builds...') + self.status('Removing previous builds...') rmtree(os.sep.join(('.', 'dist'))) except FileNotFoundError: pass - status('Building Source and Wheel (universal) distribution...') + self.status('Building Source and Wheel (universal) distribution...') os.system("{0} setup.py sdist bdist_wheel --universal ".format(sys.executable)) - status('Uploading the package to PyPi via Twine...') + self.status('Uploading the package to PyPi via Twine...') os.system("twine upload dist/*") sys.exit()