-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
46 lines (37 loc) · 1.28 KB
/
setup.py
File metadata and controls
46 lines (37 loc) · 1.28 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
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
class TestCommand_(TestCommand):
def finalize_options(self):
self.test_args = []
self.test_suite = True
def run_tests(self):
import pytest
sys.exit(pytest.main(self.test_args))
def get_git_version():
from subprocess import check_output
return check_output(('git', 'describe', '--match', '[0-9].*')).strip()
def parse_requirements(filename):
with open(filename) as f:
for line in f:
if not line.startswith('git+'):
yield line.strip()
setup(
name='wonder-common',
version=get_git_version(),
author="Wonder Place Ltd",
author_email="developers@wonderpl.com",
description="Common/shared python web services code",
long_description=open('README.md').read(),
license='Copyright 2014 Wonder Place Ltd',
url='https://github.com/rockpack/wonder-common',
zip_safe=False,
packages=find_packages(exclude=['test']),
include_package_data=True,
install_requires=list(parse_requirements('requirements.txt')),
tests_require=list(parse_requirements('requirements-dev.txt')),
setup_requires=['setuptools_git'],
cmdclass={
'test': TestCommand_,
},
)