1
1
#!/usr/bin/env python
2
2
# -*- coding: utf-8 -*-
3
3
4
- import re
5
4
import os
6
5
import sys
7
- from setuptools import setup
8
- from setuptools .command .test import test as TestCommand
9
-
10
6
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
18
8
19
- def run_tests (self ):
20
- import pytest
21
- errno = pytest .main (self .test_args )
22
- sys .exit (errno )
9
+ from setuptools import setup
23
10
24
11
25
12
name = 'djangorestframework-jwt'
13
+ version = rest_framework_jwt .__version__
26
14
package = 'rest_framework_jwt'
27
15
description = 'JSON Web Token based authentication for Django REST framework'
28
16
url = 'https://github.com/GetBlimp/django-rest-framework-jwt'
29
17
author = 'Jose Padilla'
30
18
author_email = '[email protected] '
31
19
license = 'MIT'
32
20
install_requires = [
33
- 'PyJWT>=0.3.0,<0.4 ' ,
21
+ 'PyJWT>=0.3.0,<0.5 ' ,
34
22
]
35
23
36
24
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
-
46
25
def get_packages (package ):
47
26
"""
48
27
Return root package and all sub-packages.
@@ -68,9 +47,6 @@ def get_package_data(package):
68
47
return {package : filepaths }
69
48
70
49
71
- version = get_version (package )
72
-
73
-
74
50
if sys .argv [- 1 ] == 'publish' :
75
51
os .system ("python setup.py sdist upload" )
76
52
os .system ("python setup.py bdist_wheel upload" )
@@ -90,7 +66,6 @@ def get_package_data(package):
90
66
author_email = author_email ,
91
67
packages = get_packages (package ),
92
68
package_data = get_package_data (package ),
93
- cmdclass = {'test' : PyTest },
94
69
install_requires = install_requires ,
95
70
classifiers = [
96
71
'Development Status :: 5 - Production/Stable' ,
0 commit comments