-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.py
executable file
·108 lines (83 loc) · 3.04 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/usr/bin/env python
import os
import sys
from subprocess import check_output
from distutils import log
from distutils.core import Command
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
from setuptools.command.develop import develop as DevelopCommand
from setuptools.command.sdist import sdist as SDistCommand
ROOT = os.path.realpath(os.path.join(os.path.dirname(__file__)))
execfile('strongpoc/version.py')
with open('requirements.txt') as requirements:
required = requirements.read().splitlines()
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', 'Arguments to pass to py.test')]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
#import here, cause outside the eggs aren't loaded
log.info('Running python tests...')
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)
class DevelopWithBuildStatic(DevelopCommand):
def install_for_development(self):
self.run_command('build_static')
return DevelopCommand.install_for_development(self)
class SDistWithBuildStatic(SDistCommand):
def run(self):
self.run_command('build_static')
SDistCommand.run(self)
class BuildStatic(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
log.info('running [npm install --quiet]')
check_output(['npm', 'install', '--quiet'], cwd=ROOT)
log.info('running [gulp clean]')
check_output([os.path.join(ROOT, 'node_modules', '.bin', 'gulp'), 'clean'], cwd=ROOT)
log.info('running [gulp build]')
check_output([os.path.join(ROOT, 'node_modules', '.bin', 'gulp'), 'build'], cwd=ROOT)
kwargs = {
'name': 'strongpoc',
'version': str(__version__),
'packages': find_packages(exclude=['tests*']),
'include_package_data': True,
'description': 'Strong Point of Contact (Team contact management)',
'author': 'Digant C Kasundra',
'maintainer': 'Digant C Kasundra',
'author_email': '[email protected]',
'maintainer_email': '[email protected]',
'license': 'Apache',
'install_requires': required,
'url': 'https://github.com/dropbox/strongpoc',
'tests_require': ['pytest'],
'cmdclass': {
'test': PyTest,
# 'build_static': BuildStatic,
# 'develop': DevelopWithBuildStatic,
# 'sdist': SDistWithBuildStatic,
},
'entry_points': """
[console_scripts]
strongpoc=strongpoc.cli:main
strongpoc-srv=strongpoc.server:main
""",
'classifiers': [
'Programming Language :: Python',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
]
}
setup(**kwargs)