#1 python-httptools 0.1.0
Merged 3 years ago by itamarjp. Opened 3 years ago by itamarjp.
https://github.com/itamarjp/python-httptools master  into  master

python-httptools 0.1.0
Itamar Reis Peixoto • 3 years ago  
.gitignore
file modified
+1
@@ -1,3 +1,4 @@

  /httptools-0.0.9.tar.gz

  /httptools-0.0.10.tar.gz

  /httptools-0.0.11.tar.gz

+ /httptools-0.1.0.tar.gz

0001-setup.py-Use-Cython-directly.patch
file removed
-41
@@ -1,41 +0,0 @@

- 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

- 

0002-use-system-http_parser.patch
file removed
-42
@@ -1,42 +0,0 @@

- From 5cfb2edc6541bb1bc74cd5973a2a3323b1e085e2 Mon Sep 17 00:00:00 2001

- From: Igor Gnatenko <i.gnatenko.brain@gmail.com>

- Date: Sun, 1 Jan 2017 14:37:03 +0100

- Subject: [PATCH 2/2] use system http_parser

- 

- Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>

- ---

-  httptools/parser/cparser.pxd | 2 +-

-  setup.py                     | 4 +++-

-  2 files changed, 4 insertions(+), 2 deletions(-)

- 

- diff --git a/httptools/parser/cparser.pxd b/httptools/parser/cparser.pxd

- index bad2060..7644a1c 100644

- --- a/httptools/parser/cparser.pxd

- +++ b/httptools/parser/cparser.pxd

- @@ -1,7 +1,7 @@

-  from libc.stdint cimport uint16_t, uint32_t, uint64_t

-  

-  

- -cdef extern from "../../vendor/http-parser/http_parser.h":

- +cdef extern from "http_parser.h":

-      ctypedef int (*http_data_cb) (http_parser*,

-                                    const char *at,

-                                    size_t length) except -1

- diff --git a/setup.py b/setup.py

- index 943acf8..dfe7268 100644

- --- a/setup.py

- +++ b/setup.py

- @@ -20,7 +20,9 @@ setup(

-      license='MIT',

-      packages=['httptools', 'httptools.parser'],

-      ext_modules=cythonize([

- -        Extension("httptools.parser.parser", ["httptools/parser/parser.pyx"])

- +        Extension("httptools.parser.parser",

- +                  ["httptools/parser/parser.pyx"],

- +                  libraries=['http_parser'])

-      ]),

-      setup_requires=["Cython"],

-      provides=['httptools'],

- -- 

- 2.11.0

- 

python-httptools.spec
file modified
+9 -8
@@ -1,17 +1,14 @@

  %global modname httptools

  

  Name:           python-%{modname}

- Version:        0.0.11

- Release:        9%{?dist}

+ Version:        0.1.0

+ Release:        1%{?dist}

  Summary:        Fast HTTP parser

  

  License:        MIT

  URL:            https://github.com/MagicStack/httptools

  Source0:        %{url}/archive/v%{version}/%{modname}-%{version}.tar.gz

  

- # Upstreamable patches

- Patch0001:      0001-setup.py-Use-Cython-directly.patch

- Patch0002:      0002-use-system-http_parser.patch

  

  BuildRequires:  gcc

  BuildRequires:  http-parser-devel
@@ -26,6 +23,7 @@

  %{?python_provide:%python_provide python3-%{modname}}

  BuildRequires:  python3-devel

  BuildRequires:  python3-setuptools

+ BuildRequires:  python3-wheel

  BuildRequires:  python3-Cython

  

  %description -n python3-%{modname} %{_description}
@@ -36,11 +34,11 @@

  %autosetup -n %{modname}-%{version} -p1

  # To be sure, no 3rd-party stuff

  rm -vrf vendor/

- # No need to ship .c files

- sed -i -e "/include_package_data=True/d" setup.py

+ sed -i 's#Cython==0.29.14#Cython>=0.29.14#' setup.py

+ sed -i 's#../../vendor/http-parser/http_parser.h#http_parser.h#' ./httptools/parser/cparser.pxd

  

  %build

- %py3_build

+ %py3_build build_ext \--use-system-http-parser

  

  %install

  %py3_install
@@ -59,6 +57,9 @@

  %{python3_sitearch}/%{modname}/

  

  %changelog

+ * Thu Jun 18 2020 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - 0.1.0-1

+ - Update to 0.1.0

+ 

  * Tue May 26 2020 Miro HronĨok <mhroncok@redhat.com> - 0.0.11-9

  - Rebuilt for Python 3.9

  

sources
file modified
+1 -1
@@ -1,1 +1,1 @@

- SHA512 (httptools-0.0.11.tar.gz) = a2f453fdd975a9273b14a5f9bbfe5aedd8c04da86763fcddf47b8eed2e264fbe8d0d93da37b03c2aa51827c7b42a26e4e0b764c098358d38c3a6a5b633c13711

+ SHA512 (httptools-0.1.0.tar.gz) = 5d374480bf7793a4751930b05551fdc8aa5536dd1ece73bef03cc833e3932137ed4f634b3a077505938502bbe098e096dfaa5a8e75f840a786fe82b4ee6b4251