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
|
From: Michael Fladischer <FladischerMichael@fladi.at>
Date: Sat, 20 Oct 2018 21:13:00 +0200
Subject: Use cython to build extension from .pyx file.
---
setup.py | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/setup.py b/setup.py
index 836dda8..0172d53 100644
--- a/setup.py
+++ b/setup.py
@@ -1,4 +1,5 @@
from setuptools import setup, Extension
+from Cython.Build import cythonize
setup(
@@ -19,12 +20,9 @@ setup(
author_email='yury@magic.io',
license='MIT',
packages=['httptools', 'httptools.parser'],
- ext_modules=[
- Extension("httptools.parser.parser",
- ["httptools/parser/parser.c",
- "vendor/http-parser/http_parser.c"],
- extra_compile_args=['-O2'])
- ],
+ ext_modules=cythonize([
+ Extension("httptools.parser.parser", ["httptools/parser/parser.pyx"])
+ ]),
provides=['httptools'],
include_package_data=True
)
|