generated from pity7736/python_template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
79 lines (67 loc) · 1.94 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
import os
from setuptools import setup, Extension, find_packages
try:
from Cython.Build import cythonize
USE_CYTHON = True
except ImportError:
USE_CYTHON = False
if USE_CYTHON:
ext = 'pyx'
else:
ext = 'c'
init_file = os.path.join(
os.path.dirname(__file__),
'nyoibo',
'__init__.py'
)
with open(init_file) as f:
for line in f:
if line.startswith('__version__ ='):
_, _, version = line.partition('=')
VERSION = version.strip(" \n'\"")
break
with open('README.rst') as f:
readme = f.read()
tests_require = [
'pytest~=7.0.0',
'pytest-cov~=3.0.0'
]
extensions = [
Extension('nyoibo.fields', [f'nyoibo/fields.{ext}']),
Extension('nyoibo.entities.entity', [f'nyoibo/entities/entity.{ext}'])
]
for e in extensions:
e.cython_directives = {"embedsignature": True}
if USE_CYTHON:
extensions = cythonize(
extensions,
compiler_directives={'language_level': 3}
)
setup(
name='nyoibo',
version=VERSION,
packages=find_packages(),
author='Julián Cortés',
author_email='[email protected]',
description='Implement attributes accessors in an easy way',
long_description=readme,
keywords='accessors private',
ext_modules=extensions,
url='https://github.com/pity7736/nyoibo',
tests_require=tests_require,
python_requires='>=3.9',
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Topic :: Software Development',
'Topic :: Utilities',
'Typing :: Typed'
]
)