Skip to content

Commit 069435d

Browse files
committed
Update license and setup.py
1 parent d6f5833 commit 069435d

File tree

2 files changed

+57
-12
lines changed

2 files changed

+57
-12
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2016-2018, Christian Kreuzberger, Anexia Internetdienstleistungs GmbH
3+
Copyright (c) 2016-2020, Christian Kreuzberger, Anexia Internetdienstleistungs GmbH
44
All rights reserved.
55

66
Redistribution and use in source and binary forms, with or without

setup.py

Lines changed: 56 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,71 @@
1+
import io
12
import os
3+
import sys
4+
from shutil import rmtree
25

3-
from setuptools import find_packages, setup
6+
from setuptools import find_packages, setup, Command
47

5-
with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme:
6-
README = readme.read()
8+
VERSION = '1.1.0'
9+
10+
here = os.path.abspath(os.path.dirname(__file__))
11+
with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
12+
README = '\n' + f.read()
13+
14+
15+
class UploadCommand(Command):
16+
"""Support setup.py upload."""
17+
18+
description = 'Build and publish the package.'
19+
user_options = []
20+
21+
@staticmethod
22+
def status(s):
23+
"""Prints things in bold."""
24+
print('\033[1m{0}\033[0m'.format(s))
25+
26+
def initialize_options(self):
27+
pass
28+
29+
def finalize_options(self):
30+
pass
31+
32+
def run(self):
33+
try:
34+
self.status('Removing previous builds...')
35+
rmtree(os.path.join(here, 'dist'))
36+
except OSError:
37+
pass
38+
39+
self.status('Building Source and Wheel (universal) distribution...')
40+
os.system('{0} setup.py sdist bdist_wheel --universal'.format(sys.executable))
41+
42+
self.status('Uploading the package to PyPI via Twine...')
43+
os.system('twine upload dist/*')
44+
45+
self.status('Pushing git tags...')
46+
os.system('git tag {0}'.format(VERSION))
47+
os.system('git push --tags')
48+
49+
sys.exit()
750

8-
# allow setup.py to be run from any path
9-
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
1051

1152
setup(
1253
name='django-rest-passwordreset',
13-
version='1.1.0rc3',
54+
version=VERSION,
1455
packages=find_packages(),
1556
include_package_data=True,
1657
license='BSD License',
1758
description='An extension of django rest framework, providing a configurable password reset strategy',
1859
long_description=README,
1960
long_description_content_type='text/markdown', # This is important for README.md in markdown format
20-
url='https://github.com/anx-ckreuzberger/django-rest-passwordreset',
21-
author='Christian Kreuzberger',
22-
author_email='ckreuzberger@anexia-it.com',
61+
url='https://github.com/anexia-it/django-rest-passwordreset',
62+
author='Harald Nezbeda',
63+
author_email='hnezbeda@anexia-it.com',
2364
classifiers=[
2465
'Development Status :: 5 - Production/Stable',
2566
'Environment :: Web Environment',
2667
'Framework :: Django',
2768
'Framework :: Django :: 1.11',
28-
'Framework :: Django :: 2.0',
29-
'Framework :: Django :: 2.1',
3069
'Framework :: Django :: 2.2',
3170
'Intended Audience :: Developers',
3271
'License :: OSI Approved :: BSD License',
@@ -38,7 +77,13 @@
3877
'Programming Language :: Python :: 3.4',
3978
'Programming Language :: Python :: 3.5',
4079
'Programming Language :: Python :: 3.6',
80+
'Programming Language :: Python :: 3.7',
81+
'Programming Language :: Python :: 3.8',
4182
'Topic :: Internet :: WWW/HTTP',
4283
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
4384
],
85+
# $ setup.py upload support.
86+
cmdclass={
87+
'upload': UploadCommand,
88+
},
4489
)

0 commit comments

Comments
 (0)