Created
July 1, 2017 00:46
-
-
Save carlos-jenkins/5e77957261014d7e130470eab4dbf507 to your computer and use it in GitHub Desktop.
Cythonization of a pure Python package in setup.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run me with: | |
# python3 setup.py bdist_wheel --cythonize | |
# ... | |
if '--cythonize' in argv: | |
from Cython.Build import cythonize | |
packaging = { | |
'ext_modules': cythonize('lib/**/*.py'), | |
} | |
argv.remove('--cythonize') | |
else: | |
packaging = { | |
'package_dir': {'': 'lib'}, | |
'packages': find_packages('lib'), | |
} | |
setup( | |
# .... | |
**packaging | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment