forked from discord/erlpack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
50 lines (46 loc) · 1.43 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
from setuptools import setup
import sys
use_cython = False
if '--use-cython' in sys.argv:
use_cython = True
sys.argv.remove('--use-cython')
from Cython.Distutils import build_ext, Extension
else:
from setuptools.command.build_ext import build_ext
from setuptools.extension import Extension
if use_cython:
packer = Extension(
"erlpack._packer",
cython_cplus=True,
extra_compile_args=['-O3'],
sources=["py/erlpack/_packer.pyx"]
)
unpacker = Extension(
"erlpack._unpacker",
cython_cplus=True,
extra_compile_args=['-O3'],
sources=["py/erlpack/_unpacker.pyx"]
)
else:
packer = Extension('erlpack._packer', sources=[
'py/erlpack/_packer.cpp'], extra_compile_args=['-O3'])
unpacker = Extension('erlpack._unpacker', sources=[
'py/erlpack/_unpacker.cpp'], extra_compile_args=['-O3'])
ext_modules = [packer, unpacker]
setup(
name='erlpack',
version='1.0.0',
author='Jake Heinz',
author_email='[email protected]',
url="http://github.com/discord/erlpack",
description='A high performance erlang term encoder for Python.',
license='Apache 2.0',
cmdclass={'build_ext': build_ext},
zip_safe=False,
package_dir={'': 'py'},
packages=['erlpack'],
ext_modules=ext_modules,
install_requires=['six~=1.15'],
setup_requires=['pytest-runner'],
tests_require=['pytest'],
)