From 4807e00bffc0116630af42b86049f197f8d4fc99 Mon Sep 17 00:00:00 2001 From: George Hickman Date: Fri, 15 Nov 2013 15:49:53 +0000 Subject: Set up wheel distribution support --- setup.py | 1 + 1 file changed, 1 insertion(+) (limited to 'setup.py') diff --git a/setup.py b/setup.py index adf083cb..96fbc4f4 100755 --- a/setup.py +++ b/setup.py @@ -45,6 +45,7 @@ version = get_version('rest_framework') if sys.argv[-1] == 'publish': os.system("python setup.py sdist upload") + os.system("python setup.py bdist_wheel upload") print("You probably want to also tag the version now:") print(" git tag -a %s -m 'version %s'" % (version, version)) print(" git push --tags") -- cgit v1.2.3 From 79596dc613bbf24aac7b5c56179cbc5c46eacdf3 Mon Sep 17 00:00:00 2001 From: Justin Davis Date: Thu, 5 Dec 2013 13:17:23 -0800 Subject: fix setup.py with new __init__.py boilerplate --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 26d07283..1a487f17 100755 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ def get_version(package): Return package version as listed in `__version__` in `init.py`. """ init_py = open(os.path.join(package, '__init__.py')).read() - return re.match("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1) + return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1) def get_packages(package): -- cgit v1.2.3 From 05c396cfa15138b56bf8617f4667fc41e80be104 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 8 Jan 2014 15:49:19 +0000 Subject: Use www.django-rest-framework.org for docs instead of django-rest-framework.org due to issues with naked domains --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 969b3fc1..78cdb628 100755 --- a/setup.py +++ b/setup.py @@ -55,7 +55,7 @@ if sys.argv[-1] == 'publish': setup( name='djangorestframework', version=version, - url='http://django-rest-framework.org', + url='http://www.django-rest-framework.org', license='BSD', description='Web APIs for Django, made easy.', author='Tom Christie', -- cgit v1.2.3 From 971578ca345c3d3bae7fd93b87c41d43483b6f05 Mon Sep 17 00:00:00 2001 From: Andreas Pelme Date: Sun, 2 Mar 2014 12:40:30 +0100 Subject: Support for running the test suite with py.test * Get rid of runtests.py * Moved test code from rest_framework/tests and rest_framework/runtests to tests * Invoke py.test from setup.py * Invoke py.test from Travis * Invoke py.test from tox * Changed setUpClass to be just plain setUp in test_permissions.py * Updated contribution guideline to show how to invoke py.test --- setup.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 78cdb628..2c56cd75 100755 --- a/setup.py +++ b/setup.py @@ -2,11 +2,26 @@ # -*- coding: utf-8 -*- from setuptools import setup +from setuptools.command.test import test as TestCommand import re import os import sys +# This command has been borrowed from +# https://github.com/getsentry/sentry/blob/master/setup.py +class PyTest(TestCommand): + def finalize_options(self): + TestCommand.finalize_options(self) + self.test_args = ['tests'] + self.test_suite = True + + def run_tests(self): + import pytest + errno = pytest.main(self.test_args) + sys.exit(errno) + + def get_version(package): """ Return package version as listed in `__version__` in `init.py`. @@ -62,7 +77,7 @@ setup( author_email='tom@tomchristie.com', # SEE NOTE BELOW (*) packages=get_packages('rest_framework'), package_data=get_package_data('rest_framework'), - test_suite='rest_framework.runtests.runtests.main', + cmdclass={'test': PyTest}, install_requires=[], classifiers=[ 'Development Status :: 5 - Production/Stable', -- cgit v1.2.3 From 39766bcc0ee5149a98ea11a79270609a5ec99d87 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 17 Dec 2014 21:18:06 +0000 Subject: Enforce wheel check before allowing 'setup.pu publish' --- setup.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 2c56cd75..e64346d4 100755 --- a/setup.py +++ b/setup.py @@ -59,6 +59,9 @@ version = get_version('rest_framework') if sys.argv[-1] == 'publish': + if os.system("pip freeze | grep wheel"): + print "wheel not installed.\nUse `pip install wheel`.\nExiting." + sys.exit() os.system("python setup.py sdist upload") os.system("python setup.py bdist_wheel upload") print("You probably want to also tag the version now:") -- cgit v1.2.3 From b8af83493fa8d8b404174e67c3e21e7c05e9fc25 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 17 Dec 2014 21:33:27 +0000 Subject: Wheel check was breaking tests. Removed it. --- setup.py | 3 --- 1 file changed, 3 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index e64346d4..2c56cd75 100755 --- a/setup.py +++ b/setup.py @@ -59,9 +59,6 @@ version = get_version('rest_framework') if sys.argv[-1] == 'publish': - if os.system("pip freeze | grep wheel"): - print "wheel not installed.\nUse `pip install wheel`.\nExiting." - sys.exit() os.system("python setup.py sdist upload") os.system("python setup.py bdist_wheel upload") print("You probably want to also tag the version now:") -- cgit v1.2.3 From 725bde29c777038cae83a3e5de2b4b1919a35143 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Thu, 18 Dec 2014 10:40:40 +0000 Subject: Check for wheel install before allowing setup.py publish. --- setup.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 2c56cd75..50bac046 100755 --- a/setup.py +++ b/setup.py @@ -59,6 +59,9 @@ version = get_version('rest_framework') if sys.argv[-1] == 'publish': + if os.system("pip freeze | grep wheel"): + print("wheel not installed.\nUse `pip install wheel`.\nExiting.") + sys.exit() os.system("python setup.py sdist upload") os.system("python setup.py bdist_wheel upload") print("You probably want to also tag the version now:") -- cgit v1.2.3 From 6909e92d22520fa9717507e9b9bd7db8601c17cd Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Thu, 18 Dec 2014 10:58:08 +0000 Subject: Drop 'setup.py test'. Just use 'runtests.py'. --- setup.py | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 50bac046..1e54836c 100755 --- a/setup.py +++ b/setup.py @@ -8,20 +8,6 @@ import os import sys -# This command has been borrowed from -# https://github.com/getsentry/sentry/blob/master/setup.py -class PyTest(TestCommand): - def finalize_options(self): - TestCommand.finalize_options(self) - self.test_args = ['tests'] - self.test_suite = True - - def run_tests(self): - import pytest - errno = pytest.main(self.test_args) - sys.exit(errno) - - def get_version(package): """ Return package version as listed in `__version__` in `init.py`. @@ -80,7 +66,6 @@ setup( author_email='tom@tomchristie.com', # SEE NOTE BELOW (*) packages=get_packages('rest_framework'), package_data=get_package_data('rest_framework'), - cmdclass={'test': PyTest}, install_requires=[], classifiers=[ 'Development Status :: 5 - Production/Stable', -- cgit v1.2.3 From 60f5b5d9f364c383662fb6ae8d210f31e9621c09 Mon Sep 17 00:00:00 2001 From: Xavier Ordoquy Date: Wed, 7 Jan 2015 19:19:33 +0100 Subject: Make Django REST Framework as zip unsafe. --- setup.py | 1 + 1 file changed, 1 insertion(+) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 1e54836c..efe39d8d 100755 --- a/setup.py +++ b/setup.py @@ -67,6 +67,7 @@ setup( packages=get_packages('rest_framework'), package_data=get_package_data('rest_framework'), install_requires=[], + zip_safe=False, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', -- cgit v1.2.3 From 75ff754517c30df043de906b0a6fb0e1777570b7 Mon Sep 17 00:00:00 2001 From: Xavier Ordoquy Date: Fri, 6 Feb 2015 10:12:57 +0100 Subject: Use twine to upload to pypi. --- setup.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index efe39d8d..391987bc 100755 --- a/setup.py +++ b/setup.py @@ -48,8 +48,11 @@ if sys.argv[-1] == 'publish': if os.system("pip freeze | grep wheel"): print("wheel not installed.\nUse `pip install wheel`.\nExiting.") sys.exit() - os.system("python setup.py sdist upload") - os.system("python setup.py bdist_wheel upload") + if os.system("pip freeze | grep twine") + print("twine not installed.\nUse `pip install twine`.\nExiting.") + sys.exit() + os.system("python setup.py sdist bdist_wheel") + os.system("twine upload dist/*") print("You probably want to also tag the version now:") print(" git tag -a %s -m 'version %s'" % (version, version)) print(" git push --tags") -- cgit v1.2.3 From 9dd97a0ee515089a1f818007f23460cf83159e71 Mon Sep 17 00:00:00 2001 From: Xavier Ordoquy Date: Fri, 6 Feb 2015 10:23:58 +0100 Subject: Fixed a typo. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 391987bc..4cdcfa86 100755 --- a/setup.py +++ b/setup.py @@ -48,7 +48,7 @@ if sys.argv[-1] == 'publish': if os.system("pip freeze | grep wheel"): print("wheel not installed.\nUse `pip install wheel`.\nExiting.") sys.exit() - if os.system("pip freeze | grep twine") + if os.system("pip freeze | grep twine"): print("twine not installed.\nUse `pip install twine`.\nExiting.") sys.exit() os.system("python setup.py sdist bdist_wheel") -- cgit v1.2.3