Repository navigation
Expand file tree
/
Copy pathsetup.py
More file actions
89 lines (80 loc) · 2.87 KB
/
Copy pathsetup.py
File metadata and controls
89 lines (80 loc) · 2.87 KB
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
import os
import sys
from vstcompile import make_setup, load_requirements
try:
from setuptools_rust import RustExtension, Binding
except ImportError:
RustExtension = None
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
os.environ.setdefault('NOT_COMPRESS', 'True')
ext_list = []
if 'develop' in sys.argv:
ext_list = []
elif os.environ.get('BUILD_OPTIMIZATION', 'false') == 'true':
ext_list = [
'vstutils.api.schema.inspectors',
'vstutils.api.schema.schema',
'vstutils.api.base',
'vstutils.api.decorators',
'vstutils.api.endpoint',
'vstutils.api.validators',
'vstutils.api.actions',
'vstutils.oauth2.authentication',
'vstutils.models.base',
'vstutils.models.queryset',
'vstutils.models.cent_notify',
'vstutils.models.fields',
'vstutils.models.custom_model',
'vstutils.auth',
'vstutils.celery_beat_scheduler',
'vstutils.environment',
'vstutils.middleware',
'vstutils.utils',
'vstutils.tools',
]
requirements = load_requirements('requirements.txt')
requirements_rpc = load_requirements('requirements-rpc.txt')
kwargs = dict(
ext_modules_list=ext_list,
static_exclude_min=[
r'vstutils/templates/.*\.js$',
r'vstutils/static/spa/.*\.js$'
r'vstutils/static/spa/.*\.css$'
],
install_requires=[
"django~=" + (os.environ.get('DJANGO_DEP', "") or "5.1.5"),
]
+ requirements,
extras_require={
'test': load_requirements('requirements-test.txt'),
'rpc': requirements_rpc,
'ldap': load_requirements('requirements-ldap.txt'),
'doc': load_requirements('requirements-doc.txt'),
'prod': load_requirements('requirements-prod.txt'),
'stubs': load_requirements('requirements-stubs.txt'),
'pil': ['Pillow~=11.1.0'],
'boto3': [
i.replace('libcloud', 'libcloud,s3')
for i in requirements
if isinstance(i, str) and 'django-storages' in i
],
'sqs': requirements_rpc + ['pycurl~=7.45.4'],
},
dependency_links=[
] + load_requirements('requirements-git.txt'),
entry_points={
'console_scripts': ['vstutilsctl=vstutils.__main__:cmd_execution']
},
)
if RustExtension is not None and os.path.exists("vstutils_utils/Cargo.toml") and os.environ.get('BUILD_OPTIMIZATION', 'false') == 'true':
kwargs['rust_extensions'] = [
RustExtension("vstutils._utils", path="vstutils_utils/Cargo.toml", binding=Binding.PyO3),
RustExtension("vstutils._tools", path="vstutils_tools/Cargo.toml", binding=Binding.PyO3),
]
all_deps = []
for key, deps in kwargs['extras_require'].items():
if key not in ('stubs', 'sqs'):
all_deps += deps
kwargs['extras_require']['all'] = all_deps
make_setup(**kwargs)