File: 0001-Use-cython-to-build-extension-from-.pyx-file.patch

package info (click to toggle)
python-httptools 0.0.11-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 220 kB
  • sloc: python: 529; makefile: 12
file content (34 lines) | stat: -rw-r--r-- 962 bytes parent folder | download
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
 )