diff options
| author | Tomas Krizek <tomas.krizek@nic.cz> | 2018-07-30 16:25:40 +0200 |
|---|---|---|
| committer | Tomas Krizek <tomas.krizek@nic.cz> | 2018-07-30 16:25:40 +0200 |
| commit | 6a7c6f148a573c773f54296a52cdcdc1bcb5d170 (patch) | |
| tree | 8d5aaa4915fa6d561b47513f227ad56dd5cf7319 /setup.py | |
| parent | de3b5befcfbbbf48e1cd8779998220b2f07fff42 (diff) | |
| download | dnspython-6a7c6f148a573c773f54296a52cdcdc1bcb5d170.tar.gz | |
setup.py: support compilation with Cython
To provide a slight perfomrance boost, the Python code can be
compiled with Cython. Provide --cython-compile to setup.py, or
when usng pip:
pip install dnspython --install-option="--cython-compile"
Diffstat (limited to 'setup.py')
| -rwxr-xr-x | setup.py | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -20,6 +20,15 @@ from setuptools import setup version = '1.16.0' +try: + sys.argv.remove("--cython-compile") +except ValueError: + compile_cython = False +else: + compile_cython = True + from Cython.Build import cythonize + ext_modules = cythonize(['dns/*.py', 'dns/rdtypes/*.py', 'dns/rdtypes/*/*.py']) + kwargs = { 'name' : 'dnspython', 'version' : version, @@ -64,6 +73,8 @@ direct manipulation of DNS zones, messages, names, and records.""", 'IDNA': ['idna>=2.1'], 'DNSSEC': ['pycrypto>=2.6.1', 'ecdsa>=0.13'], }, + 'ext_modules': ext_modules if compile_cython else None, + 'zip_safe': False if compile_cython else None, } setup(**kwargs) |
