summarylogtreecommitdiffstats
path: root/0001-setup.py-Use-Cython-directly.patch
blob: a10065f5fdb00afba5490e9436a2d03ed1a64633 (plain)
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
35
36
37
38
39
40
41
From 79687e1a2d1d7177cca302a8ebd7ee176b291c0b Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Date: Sun, 1 Jan 2017 14:35:31 +0100
Subject: [PATCH 1/2] setup.py: Use Cython directly

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
---
 setup.py | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/setup.py b/setup.py
index 419c6c8..943acf8 100644
--- a/setup.py
+++ b/setup.py
@@ -1,5 +1,5 @@
 from setuptools import setup, Extension
-
+from Cython.Build import cythonize
 
 setup(
     name='httptools',
@@ -19,12 +19,10 @@ 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"])
+    ]),
+    setup_requires=["Cython"],
     provides=['httptools'],
     include_package_data=True
 )
-- 
2.11.0