From 495b725d1b9d8005e397f61c032a4a78f3b1c9fd Mon Sep 17 00:00:00 2001 From: Stephen Burrows Date: Mon, 1 Apr 2019 09:59:27 -0700 Subject: [PATCH 1/2] Added python setup.py upload command From setup.py for humans --- setup.py | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/setup.py b/setup.py index cfd184d..5ffb105 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,10 @@ import io import os +import sys +from shutil import rmtree +from setuptools import Command from setuptools import find_packages from setuptools import setup @@ -72,6 +75,43 @@ about['__version__'] = VERSION +class UploadCommand(Command): + """Support setup.py upload.""" + + 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 + + def finalize_options(self): + pass + + def run(self): + try: + self.status('Removing previous builds…') + rmtree(os.path.join(here, 'dist')) + except OSError: + pass + + self.status('Building Source and Wheel (universal) distribution…') + os.system('{0} setup.py sdist bdist_wheel --universal'.format(sys.executable)) + + self.status('Uploading the package to PyPI via Twine…') + os.system('twine upload dist/*') + + self.status('Pushing git tags…') + os.system('git tag v{0}'.format(about['__version__'])) + os.system('git push --tags') + + sys.exit() + + setup( name=NAME, version=about['__version__'], @@ -104,4 +144,8 @@ install_requires=REQUIRED, tests_require=TESTS, extras_require=EXTRAS, + # $ setup.py upload support. + cmdclass={ + 'upload': UploadCommand, + }, ) From 86511b12c577e06ab95c48bd8bfa772a5651afbd Mon Sep 17 00:00:00 2001 From: Stephen Burrows Date: Mon, 1 Apr 2019 10:00:10 -0700 Subject: [PATCH 2/2] Bumped version number to 0.2.0 This is a slight backwards incompatibility because this version drops official support for Django < 1.11 --- django_inlinecss/__version__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django_inlinecss/__version__.py b/django_inlinecss/__version__.py index de81264..dfd69f9 100644 --- a/django_inlinecss/__version__.py +++ b/django_inlinecss/__version__.py @@ -1,3 +1,3 @@ -VERSION = (0, 1, 2) +VERSION = (0, 2, 0) __version__ = '.'.join(map(str, VERSION))