-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
72 lines (54 loc) · 2.07 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env python
import os
from setuptools import setup, find_packages, Command
from setuptools.command.build_py import build_py
from hfcommon import version
def find_package_data(package, *directories):
data_files = []
current_dir = os.path.abspath(os.curdir)
package_dir = os.path.dirname(__import__(package, fromlist=['']).__file__)
os.chdir(package_dir)
for directory in directories:
for dirpath, dirnames, filenames in os.walk(directory):
[data_files.append(os.path.join(dirpath, f)) for f in filenames]
os.chdir(current_dir)
return data_files
class TestCommand(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import nose
nose.main(argv=['nosetests', 'hfcommon_tests/'])
class BuildHook(build_py):
def run(self):
build_py.run(self)
build_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), self.build_lib, 'hfcommon')
with open(os.path.join(build_dir, 'version.py'), 'w') as version_file:
version_file.write('version = "{0}"\n'.format(version))
install_requires = ['phonenumbers', 'arrow', 'python-dateutil', 'six', 'tortik']
setup(
name='hfcommon',
version=version,
description='Huntflow Common Library',
long_description=open('README.md').read(),
url='https://github.com/huntflow/hfcommon',
download_url='https://github.com/huntflow/hfcommon/tarball/{}'.format(version),
packages=find_packages(exclude=['hfcommon_tests', 'hfcommon_tests.*']),
package_data={
},
cmdclass={'test': TestCommand, 'build_py': BuildHook},
install_requires=install_requires,
setup_requires=['nose'],
classifiers=[
'License :: OSI Approved :: MIT License',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.7',
],
)