-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsetup.py
80 lines (66 loc) · 2.2 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
# -*- coding: utf-8 -*-
import os
import re
import sys
from setuptools import setup, Command, find_packages
with open(os.path.join('lib', 'woothee', '__init__.py'), 'r') as f:
version = re.compile(
r".*__version__ = '(.*?)'", re.S).match(f.read()).group(1)
with open('README.rst', 'r') as f:
long_description = f.read()
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: Libraries :: Python Modules",
]
setup_pkgs = ['PyYAML', 'pytest-runner']
test_pkgs = ['pytest', 'pytest-cov', 'pytest-mock', 'zipp==1.1.0']
class DatasetCommand(Command):
description = 'generate dataset.py'
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import os
import sys
root_dir = os.path.dirname(os.path.abspath(__file__))
scripts_dir = os.path.join(root_dir, 'scripts')
sys.path.insert(0, scripts_dir)
import dataset_yaml2py # NOQA
setup(
name='woothee',
version=version,
description='Cross-language UserAgent classifier library, python implementation', # NOQA
author='tell-k',
author_email='ffk2005@gmail.com',
url='https://github.com/woothee/woothee-python',
license='Apache License 2.0',
packages=find_packages('lib'),
package_dir={'': 'lib'},
package_data={
'woothee': ['py.typed', '*.pyi'],
},
platforms='any',
setup_requires=setup_pkgs,
tests_require=test_pkgs,
extras_require={
"test": test_pkgs,
"setup": setup_pkgs,
},
long_description=long_description,
classifiers=classifiers,
keywords=['web', 'user-agent', 'parser'],
cmdclass={'dataset': DatasetCommand},
)