summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2015-06-12 01:36:56 +0100
committerEmmanuel Gil Peyrot <emmanuel.peyrot@collabora.com>2015-06-20 01:14:46 +0100
commit7bce1ecc8aeeb33bcf25474647aeb86245c71c1c (patch)
tree2a235379715b47ce8b1ac8946794e0b8733409d9 /setup.py
parentbbce16d526be4b427ed5144a7e3ffee5656abd23 (diff)
downloadslixmpp-7bce1ecc8aeeb33bcf25474647aeb86245c71c1c.tar.gz
slixmpp-7bce1ecc8aeeb33bcf25474647aeb86245c71c1c.tar.bz2
slixmpp-7bce1ecc8aeeb33bcf25474647aeb86245c71c1c.tar.xz
slixmpp-7bce1ecc8aeeb33bcf25474647aeb86245c71c1c.zip
Add a Cython version of slixmpp.stringprep, using libidn.
This makes the validation of a JID a *lot* faster.
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index ca8be7f5..56fdc76e 100755
--- a/setup.py
+++ b/setup.py
@@ -13,6 +13,14 @@ try:
except ImportError:
from distutils.core import setup
+try:
+ from Cython.Build import cythonize
+except ImportError:
+ print('Cython not found, falling back to the slow stringprep module.')
+ ext_modules = None
+else:
+ ext_modules = cythonize('slixmpp/stringprep.pyx')
+
from run_tests import TestCommand
from slixmpp.version import __version__
@@ -43,6 +51,7 @@ setup(
license='MIT',
platforms=['any'],
packages=packages,
+ ext_modules=ext_modules,
requires=['aiodns', 'pyasn1', 'pyasn1_modules'],
classifiers=CLASSIFIERS,
cmdclass={'test': TestCommand}