-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
setup.py
133 lines (112 loc) · 3.65 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/usr/bin/env python
import os
import pathlib
from setuptools import setup, find_packages
sys_conf_dir = os.getenv("SYSCONFDIR", "/etc")
current_directory = os.path.dirname(os.path.abspath(__file__))
here = pathlib.Path(__file__).parent.resolve()
os_name = pathlib.Path('/etc/issue').read_text(encoding="utf-8")
long_description = (here / "README.md").read_text(encoding="utf-8")
def package_files(directory: str) -> list:
paths = []
for (path, directories, filenames) in os.walk(directory):
for filename in filenames:
paths.append(os.path.join('..', path, filename))
return paths
classes = """
Development Status :: 4 - Beta
Intended Audience :: Developers
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: Implementation :: CPython
Programming Language :: Python :: Implementation :: PyPy
Operating System :: OS Independent
"""
classifiers = [s.strip() for s in classes.split('\n') if s]
extra_files = [
'templates/*',
'migrations/alembic.ini',
'views/*/templates/*',
'views/*/templates/*/*',
'static/*'
]
extra_files.extend(package_files('blacklist/translations'))
extra_files.extend(package_files('blacklist/static/img'))
extra_files.extend(package_files('blacklist/static/pdf'))
# Bower components
extra_files.extend(package_files('blacklist/static/node_modules/bootstrap/dist'))
extra_files.extend(package_files('blacklist/static/node_modules/font-awesome/css'))
extra_files.extend(package_files('blacklist/static/node_modules/font-awesome/fonts'))
extra_files.extend(package_files('blacklist/static/node_modules/jquery/dist'))
extra_files.extend(package_files('blacklist/static/node_modules/ekko-lightbox/dist'))
install_requires = [
'redis==3.5.*',
'WTForms==2.2.1',
'psycopg2-binary==2.9.5',
'python-dateutil~=2.8.1',
'markupsafe==2.0.1',
'Flask-Babel>=0.12.2',
'Flask-Script~=2.0.6',
'flask-migrate~=2.6.0',
'Flask-Caching',
'pyyaml~=5.3.1',
'docopt~=0.6.2',
'celery~=5.0.0',
'blinker~=1.4',
'Flask-Celery-Tools',
'raven',
'tabula-py',
'PyPDF2',
'Pillow',
'lxml',
'dnspython',
'pygal'
]
if os_name.startswith('Debian'):
# Older versions for debian
install_requires.extend([
'flask~=1.1.2',
'requests~=2.25.1',
'Flask-Login==0.5.*',
])
else:
install_requires.extend([
'flask~=2.0.3',
'requests~=2.27.1',
'Flask-Login==0.6.*'
])
setup(
name='blacklist',
version='1.0.51',
description='Blacklist',
long_description=open('README.md').read(),
author='Adam Schubert',
author_email='[email protected]',
url='https://gitlab.salamek.cz/sadam/blacklist.git',
license='GPL-3.0',
classifiers=classifiers,
packages=find_packages(exclude=['tests', 'tests.*']),
install_requires=install_requires,
test_suite="tests",
tests_require=install_requires,
package_data={'blacklist': extra_files},
entry_points={
'console_scripts': [
'blacklist = blacklist.__main__:main',
],
},
data_files=[
(os.path.join(sys_conf_dir, 'systemd', 'system'), [
'etc/systemd/system/blacklist.service',
'etc/systemd/system/blacklist_celerybeat.service',
'etc/systemd/system/blacklist_celeryworker.service'
]),
(os.path.join(sys_conf_dir, 'blacklist'), [
'etc/blacklist/config.yml'
])
]
)