From 069435d84485d920ff907503df0cb76e42dd51b0 Mon Sep 17 00:00:00 2001 From: Harald Nezbeda Date: Thu, 30 Jan 2020 15:10:15 +0100 Subject: [PATCH] Update license and setup.py --- LICENSE | 2 +- setup.py | 67 ++++++++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 57 insertions(+), 12 deletions(-) diff --git a/LICENSE b/LICENSE index f1a976a..d0bbe3a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2016-2018, Christian Kreuzberger, Anexia Internetdienstleistungs GmbH +Copyright (c) 2016-2020, Christian Kreuzberger, Anexia Internetdienstleistungs GmbH All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/setup.py b/setup.py index f78e9cc..f586505 100644 --- a/setup.py +++ b/setup.py @@ -1,32 +1,71 @@ +import io import os +import sys +from shutil import rmtree -from setuptools import find_packages, setup +from setuptools import find_packages, setup, Command -with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: - README = readme.read() +VERSION = '1.1.0' + +here = os.path.abspath(os.path.dirname(__file__)) +with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f: + README = '\n' + f.read() + + +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 {0}'.format(VERSION)) + os.system('git push --tags') + + sys.exit() -# allow setup.py to be run from any path -os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) setup( name='django-rest-passwordreset', - version='1.1.0rc3', + version=VERSION, packages=find_packages(), include_package_data=True, license='BSD License', description='An extension of django rest framework, providing a configurable password reset strategy', long_description=README, long_description_content_type='text/markdown', # This is important for README.md in markdown format - url='https://github.com/anx-ckreuzberger/django-rest-passwordreset', - author='Christian Kreuzberger', - author_email='ckreuzberger@anexia-it.com', + url='https://github.com/anexia-it/django-rest-passwordreset', + author='Harald Nezbeda', + author_email='hnezbeda@anexia-it.com', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Framework :: Django :: 1.11', - 'Framework :: Django :: 2.0', - 'Framework :: Django :: 2.1', 'Framework :: Django :: 2.2', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', @@ -38,7 +77,13 @@ 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], + # $ setup.py upload support. + cmdclass={ + 'upload': UploadCommand, + }, )