forked from mjschultz/py-radix
-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
executable file
·61 lines (51 loc) · 1.88 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
#!/usr/bin/env python
import codecs
import sys
import os
from setuptools import setup, find_packages, Extension
from os.path import abspath, dirname, join
here = abspath(dirname(__file__))
# determine the python version
IS_PYPY = hasattr(sys, 'pypy_version_info')
RADIX_NO_EXT = os.environ.get('RADIX_NO_EXT', '0')
RADIX_NO_EXT = True if RADIX_NO_EXT not in ('0', 'false', 'False') else False
with codecs.open(join(here, 'README.rst'), encoding='utf-8') as f:
README = f.read()
# introduce some extra setup_args if Python 2.x
extra_kwargs = {}
if not IS_PYPY and not RADIX_NO_EXT:
sources = ['radix/_radix.c', 'radix/_radix/radix.c']
radix = Extension('radix._radix',
sources=sources,
include_dirs=[join(here, 'radix')])
extra_kwargs['ext_modules'] = [radix]
tests_require = ['nose', 'coverage']
if sys.version_info < (2, 7):
tests_require.append('unittest2')
setup(
name='py-radix',
version='1.0.2',
maintainer='Raphael Cohen',
maintainer_email='[email protected]',
url='https://github.com/SEKOIA-IO/py-radix',
description='Radix tree implementation',
long_description=README,
license='BSD',
keywords='radix tree trie python routing networking',
classifiers=[
'Intended Audience :: Developers',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: System :: Networking',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
tests_require=tests_require,
packages=find_packages(exclude=['tests', 'tests.*']),
test_suite='nose.collector',
**extra_kwargs
)