-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·69 lines (57 loc) · 1.97 KB
/
setup.py
File metadata and controls
executable file
·69 lines (57 loc) · 1.97 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
from setuptools import setup, find_packages, Command
import os
print('Please install pytest(https://docs.pytest.org/en/latest/contents.html) as test suite.')
DESCRIPTION = "A python module for jsend"
LONG_DESCRIPTION = None
try:
LONG_DESCRIPTION = open('README.md').read()
except:
pass
def get_version(version_tuple):
version = '%s.%s' % (version_tuple[0], version_tuple[1])
if version_tuple[2]:
version = '%s.%s' % (version, version_tuple[2])
return version
init = os.path.join(os.path.dirname(__file__), 'jsend', '__init__.py')
version_line = list(filter(lambda l: l.startswith('VERSION'), open(init)))[0]
VERSION = get_version(eval(version_line.split('=')[-1]))
print('version: %s' % VERSION)
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Internet',
'Topic :: Software Development :: Libraries :: Python Modules',
]
class PyTest(Command):
''' class for py.test '''
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import sys,subprocess
# "test.pytest.py" is a file generated by command:
# " py.test --genscript=test.pytest.py "
pytest_file = 'jsend/test_jsend_pytest.py'
errno = subprocess.call([sys.executable, pytest_file])
raise SystemExit(errno)
setup(name='python-jsend',
version=VERSION,
packages=find_packages(),
author='darkdarkfruit',
author_email='darkdarkfruit@gmail.com',
url='https://github.com/darkdarkfruit/jsend',
license='MIT',
include_package_data=True,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
platforms=['any'],
classifiers=CLASSIFIERS,
install_requires=[],
# cmdclass = {'test' : PyTest},
# test_suite='py.test',
)