forked from dimagi/jsonobject
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
64 lines (55 loc) · 2.09 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
from __future__ import absolute_import
from __future__ import print_function
from setuptools import setup
import io
from setuptools.extension import Extension
try:
# Only use Cython if it's installed in the environment, otherwise use the provided C
import Cython
USE_CYTHON = True
except ImportError:
USE_CYTHON = False
ext = '.pyx' if USE_CYTHON else '.c'
extensions = [
Extension('jsonobject.api', ["jsonobject/api" + ext],),
Extension('jsonobject.base', ["jsonobject/base" + ext],),
Extension('jsonobject.base_properties', ["jsonobject/base_properties" + ext],),
Extension('jsonobject.containers', ["jsonobject/containers" + ext],),
Extension('jsonobject.properties', ["jsonobject/properties" + ext],),
Extension('jsonobject.utils', ["jsonobject/utils" + ext],),
]
CYTHON_REQUIRES = ['cython>=0.29.21,<1.0.0']
if USE_CYTHON:
from Cython.Build import cythonize
extensions = cythonize(extensions)
else:
print("You are running without Cython installed. It is highly recommended to run\n"
" pip install {}\n"
"before you continue".format(' '.join(CYTHON_REQUIRES)))
with io.open('README.md', 'rt', encoding="utf-8") as readme_file:
long_description = readme_file.read()
setup(
name='jsonobject',
version='2.0.0+sbx1',
author='Danny Roberts',
author_email='[email protected]',
description='A library for dealing with JSON as python objects',
long_description=long_description,
long_description_content_type='text/markdown',
url='https://github.com/dimagi/jsonobject',
packages=['jsonobject'],
setup_requires=CYTHON_REQUIRES,
install_requires=['six'],
ext_modules=extensions,
test_suite='test',
classifiers=(
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'License :: OSI Approved :: BSD License',
),
)