-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
45 lines (35 loc) · 1.16 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
# coding=utf-8
import os
from setuptools import setup, find_packages
from setuptools.command.build_py import build_py
from setuptools.command.test import test
from hhwebutils import version
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, 'hhwebutils')
with open(os.path.join(build_dir, 'version.py'), 'w') as version_file:
version_file.write('version = "{0}"\n'.format(version))
class TestHook(test):
def run_tests(self):
import nose
nose.main(argv=['nosetests', 'hhwebutils_tests/', '-v'])
setup(
name='hhwebutils',
version=__import__('hhwebutils').__version__,
description='hh.ru python common web utility library',
url='https://github.com/hhru/hh-webutils',
cmdclass={'build_py': BuildHook, 'test': TestHook},
packages=find_packages(exclude=['hhwebutils_tests']),
install_requires=[
'lxml >= 2.2.4',
],
test_suite='hhwebutils_tests',
tests_require=[
'nose',
'lxml-asserts',
'pycodestyle == 2.0.0',
'freezegun'
],
zip_safe=False
)