-
Notifications
You must be signed in to change notification settings - Fork 10
/
setup.py
69 lines (58 loc) · 1.98 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
#!/usr/bin/env python
'''
Created on 18-12-2012
@author: maciag.artur
'''
import os.path
import sys
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
"""Command to run unit tests after in-place build."""
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = [
'-s', 'tests', '--pep8', '--cov', 'wykop', '--cov-report',
'term-missing', '--cov-report', 'html',
]
self.test_suite = True
def run_tests(self):
# Importing here, `cause outside the eggs aren't loaded.
import pytest
errno = pytest.main(self.test_args)
sys.exit(errno)
def read_requirements(filename):
dirname = os.path.dirname(__file__)
filename_full = os.path.join(dirname, filename)
with open(filename_full) as f:
for line in f:
if not line or line.startswith('#'):
continue
yield line
requires = list(read_requirements('requirements.txt'))
tests_requires = list(read_requirements('requirements_test.txt'))
setup(
name='wykop-sdk',
version='0.5.0',
packages=find_packages(),
cmdclass={'test': PyTest},
# PyPI metadata
author='Artur Maciag',
author_email='[email protected]',
description='Client library for Wykop API',
long_description=open("README.rst").read(),
url='https://github.com/p1c2u/wykop-sdk',
install_requires=requires,
tests_require=requires + tests_requires,
license='BSD',
classifiers=[
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)