1 # -*- coding: utf-8 -*-
6 from setuptools
import setup
7 from setuptools
.command
.test
import test
as TestCommand
9 HERE
= os
.path
.dirname(os
.path
.realpath(__file__
))
12 class PyTest(TestCommand
):
14 Run py.test with the "python setup.py test command"
16 user_options
= [('pytest-args=', 'a', "Arguments to pass to py.test")]
18 def initialize_options(self
):
19 TestCommand
.initialize_options(self
)
22 def finalize_options(self
):
23 TestCommand
.finalize_options(self
)
24 self
.pytest_args
+= (' ' + self
.distribution
.test_suite
)
28 errno
= pytest
.main(self
.pytest_args
)
33 with
open(os
.path
.join(HERE
, *parts
)) as f
:
37 def parse_requirements(data
, exclude
=()):
38 return [line
for line
in data
.splitlines()
39 if line
and not line
.startswith("#") and line
not in exclude
]
43 return re
.findall(r
"__version__ = \"([\d
.]+)\"",
44 read("dlmanager
", "__init__
.py
"))[0]
49 description="download manager library
",
50 long_description=read("README
.rst
"),
51 author="Julien Pagès
",
52 author_email="j
.parkouss
@gmail.com
",
53 url="http
://github
.com
/parkouss
/dlmanager
",
55 install_requires=parse_requirements(read("requirements
.txt
")),
56 cmdclass={'test': PyTest},
57 tests_require=parse_requirements(read("requirements
.txt
"),