Add a Cython version of slixmpp.stringprep, using libidn.

This makes the validation of a JID a *lot* faster.
This commit is contained in:
Emmanuel Gil Peyrot
2015-06-12 01:36:56 +01:00
committed by Emmanuel Gil Peyrot
parent bbce16d526
commit 7bce1ecc8a
2 changed files with 80 additions and 0 deletions

View File

@@ -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}