Skip to content
This repository was archived by the owner on May 26, 2020. It is now read-only.

Commit c7388e7

Browse files
committed
Update setup.py
- Remove test command in favor of runtests - Use version from __init__
1 parent 3b0be8c commit c7388e7

File tree

2 files changed

+10
-29
lines changed

2 files changed

+10
-29
lines changed

rest_framework_jwt/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1+
# -*- coding: utf-8 -*-
2+
3+
__title__ = 'djangorestframework-jwt'
14
__version__ = '1.1.1'
5+
__author__ = 'José Padilla'
6+
__license__ = 'MIT'
7+
__copyright__ = 'Copyright 2014-2015 Blimp LLC'
28

39
# Version synonym
410
VERSION = __version__

setup.py

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,27 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
import re
54
import os
65
import sys
7-
from setuptools import setup
8-
from setuptools.command.test import test as TestCommand
9-
106

11-
# This command has been borrowed from
12-
# https://github.com/getsentry/sentry/blob/master/setup.py
13-
class PyTest(TestCommand):
14-
def finalize_options(self):
15-
TestCommand.finalize_options(self)
16-
self.test_args = ['tests']
17-
self.test_suite = True
7+
import rest_framework_jwt
188

19-
def run_tests(self):
20-
import pytest
21-
errno = pytest.main(self.test_args)
22-
sys.exit(errno)
9+
from setuptools import setup
2310

2411

2512
name = 'djangorestframework-jwt'
13+
version = rest_framework_jwt.__version__
2614
package = 'rest_framework_jwt'
2715
description = 'JSON Web Token based authentication for Django REST framework'
2816
url = 'https://github.com/GetBlimp/django-rest-framework-jwt'
2917
author = 'Jose Padilla'
3018
author_email = '[email protected]'
3119
license = 'MIT'
3220
install_requires = [
33-
'PyJWT>=0.3.0,<0.4',
21+
'PyJWT>=0.3.0,<0.5',
3422
]
3523

3624

37-
def get_version(package):
38-
"""
39-
Return package version as listed in `__version__` in `init.py`.
40-
"""
41-
init_py = open(os.path.join(package, '__init__.py')).read()
42-
return re.search("^__version__ = ['\"]([^'\"]+)['\"]",
43-
init_py, re.MULTILINE).group(1)
44-
45-
4625
def get_packages(package):
4726
"""
4827
Return root package and all sub-packages.
@@ -68,9 +47,6 @@ def get_package_data(package):
6847
return {package: filepaths}
6948

7049

71-
version = get_version(package)
72-
73-
7450
if sys.argv[-1] == 'publish':
7551
os.system("python setup.py sdist upload")
7652
os.system("python setup.py bdist_wheel upload")
@@ -90,7 +66,6 @@ def get_package_data(package):
9066
author_email=author_email,
9167
packages=get_packages(package),
9268
package_data=get_package_data(package),
93-
cmdclass={'test': PyTest},
9469
install_requires=install_requires,
9570
classifiers=[
9671
'Development Status :: 5 - Production/Stable',

0 commit comments

Comments
 (0)