Update setup.py

This commit is contained in:
Kenneth Reitz 2017-08-28 23:01:43 -04:00 committed by GitHub
parent 4e0c5d3cb7
commit a076ebe021

View File

@ -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()