-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
192 lines (182 loc) · 5.4 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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
#!/usr/bin/env python
"""NavConfig.
Configuration Service for Navigator and DataIntegrator.
See:
https://github.com/phenobarbital/NavConfig
"""
import ast
from os import path
from setuptools import find_packages, setup, Extension
from Cython.Build import cythonize
def get_path(filename):
return path.join(path.dirname(path.abspath(__file__)), filename)
def readme():
with open(get_path('README.md'), 'r', encoding='utf-8') as rd:
return rd.read()
version = get_path('navconfig/version.py')
with open(version, 'r', encoding='utf-8') as meta:
# exec(meta.read())
t = compile(meta.read(), version, 'exec', ast.PyCF_ONLY_AST)
for node in (n for n in t.body if isinstance(n, ast.Assign)):
if len(node.targets) == 1:
name = node.targets[0]
if isinstance(name, ast.Name) and name.id in (
'__version__',
'__title__',
'__description__',
'__author__',
'__license__',
'__author_email__'
):
v = node.value
if name.id == '__version__':
__version__ = v.s
if name.id == '__title__':
__title__ = v.s
if name.id == '__description__':
__description__ = v.s
if name.id == '__license__':
__license__ = v.s
if name.id == '__author__':
__author__ = v.s
if name.id == '__author_email__':
__author_email__ = v.s
COMPILE_ARGS = ["-O2"]
extensions = [
Extension(
name='navconfig.exceptions',
sources=['navconfig/exceptions.pyx'],
extra_compile_args=COMPILE_ARGS,
language="c"
),
Extension(
name='navconfig.utils.functions',
sources=['navconfig/utils/functions.pyx'],
extra_compile_args=COMPILE_ARGS,
language="c++"
),
Extension(
name='navconfig.utils.types',
sources=['navconfig/utils/types.pyx'],
extra_compile_args=COMPILE_ARGS,
language="c++"
),
Extension(
name='navconfig.loaders.parsers.toml',
sources=['navconfig/loaders/parsers/toml.pyx'],
extra_compile_args=COMPILE_ARGS,
language="c++"
),
Extension(
name='navconfig.loaders.parsers.yaml',
sources=['navconfig/loaders/parsers/yaml.pyx'],
extra_compile_args=COMPILE_ARGS,
language="c++"
),
Extension(
name='navconfig.logging.logger',
sources=['navconfig/logging/logger.pyx'],
extra_compile_args=COMPILE_ARGS,
language="c++"
),
Extension(
name='navconfig.utils.json',
sources=['navconfig/utils/json.pyx'],
extra_compile_args=COMPILE_ARGS,
language="c++"
)
]
setup(
name=__title__,
version=__version__,
python_requires=">=3.9.13",
url='https://github.com/phenobarbital/NavConfig',
description=__description__,
long_description=readme(),
long_description_content_type='text/markdown',
license=__license__,
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Topic :: Software Development :: Build Tools',
'Environment :: Web Environment',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Framework :: AsyncIO'
],
author='Jesus Lara',
author_email='[email protected]',
packages=find_packages(
exclude=["docs", "tests", "settings", "examples", "dist", "etc"]
),
setup_requires=[
'setuptools==74.0.0',
'Cython==3.0.11',
'wheel==0.44.0'
],
install_requires=[
'Cython==3.0.11',
'asyncio==3.4.3',
'python-dotenv==1.0.1',
'configparser==6.0.0',
'python-dateutil>=2.8.2',
'objectpath==0.6.1',
'iso8601==2.1.0',
'pycparser==2.21',
"orjson>=3.10.3",
'pycryptodomex==3.20.0',
"cryptography>=43.0.1",
"aiofiles>=23.2.1,<=24.1.0",
"jsonpickle>=3.0.2",
],
extras_require={
"uvloop": [
"uvloop==0.21.0"
],
"memcache": [
"pylibmc==1.6.3",
"aiomcache==0.8.2",
],
"gdrive": [
'PyDrive==1.3.1',
],
"logstash": [
'python-logstash-async>=2.7.2,<=3.0.0',
],
"redis": [
'redis==5.0.8',
],
"toml": [
'pytomlpp==1.0.13'
],
"yaml": [
'PyYAML>=6.0',
],
"hvac": [
"hvac==2.3.0"
],
"default": [
'pytomlpp==1.0.13',
'redis==5.0.8',
'python-logstash-async==2.7.2',
'PyYAML>=6.0',
"hvac==2.3.0"
],
"all": [
'pytomlpp==1.0.13',
'redis==5.0.8',
'python-logstash-async==2.7.2',
'PyYAML>=6.0',
"aiomcache==0.8.2",
"hvac==2.3.0"
]
},
ext_modules=cythonize(extensions),
project_urls={ # Optional
'Source': 'https://github.com/phenobarbital/NavConfig',
'Funding': 'https://paypal.me/phenobarbital',
'Say Thanks!': 'https://saythanks.io/to/phenobarbital',
},
)