-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
55 lines (49 loc) · 1.81 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/bin/env python
import os
from os.path import join as pathjoin
from os.path import dirname
from subprocess import check_output, CalledProcessError
from setuptools import setup
from setuptools import find_packages
package_name = 'django-session-jwt'
readme = os.path.join(os.path.dirname(__file__), 'README.rst')
with open(readme) as readme_file:
long_description = readme_file.read()
version_msg = '# Do not edit. See setup.py.{nl}__version__ = "{ver}"{nl}'
version_py = pathjoin(
dirname(__file__), package_name.replace('-', '_'), 'version.py')
# Get version from GIT or version.py.
try:
version_git = check_output(['git', 'describe', '--tags']).rstrip()
version_git = version_git.decode('utf-8')
except (CalledProcessError, OSError):
with open(version_py, 'rt') as f:
version_git = f.read().strip().split('=')[-1].replace('"', '')
else:
# Write out version.py.
with open(version_py, 'wt') as f:
f.write(version_msg.format(ver=version_git, nl=os.linesep))
setup(
name = package_name,
version = version_git,
description = 'A django application that combines django.contrib.sessions with JWT.',
long_description = long_description,
author = 'SmartFile',
author_email = '[email protected]',
maintainer = 'Ben Timby',
maintainer_email = '[email protected]',
url = 'http://github.com/smartfile/' + package_name + '/',
license = 'MIT',
install_requires = [
'pyjwt>=2',
],
packages = find_packages(),
classifiers = (
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3',
'Topic :: Software Development :: Libraries :: Python Modules',
),
)