evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / development / python-modules / http-parser / default.nix
blob7e53465939f2819fd43d8fc6b10e0c436fe8b601
2   lib,
3   buildPythonPackage,
4   fetchFromGitHub,
5   cython,
6   setuptools,
7   pytestCheckHook,
8   fetchpatch,
9 }:
11 buildPythonPackage rec {
12   pname = "http-parser";
13   version = "0.9.0";
14   format = "pyproject";
16   src = fetchFromGitHub {
17     owner = "benoitc";
18     repo = pname;
19     rev = "refs/tags/${version}";
20     hash = "sha256-WHimvSaNcncwzLwwk5+ZNg7BbHF+hPr39SfidEDYfhU=";
21   };
23   nativeBuildInputs = [
24     cython
25     setuptools
26   ];
28   preBuild = ''
29     # re-run cython
30     make -B
31   '';
33   pythonImportsCheck = [ "http_parser" ];
35   # The imp module is deprecated since version 3.4, and was removed in 3.12
36   # https://docs.python.org/3.11/library/imp.html
37   # Fix from: https://github.com/benoitc/http-parser/pull/101/
38   patches = [
39     (fetchpatch {
40       url = "https://github.com/benoitc/http-parser/commit/4d4984ce129253f9de475bfd3c683301c916e8b1.patch";
41       hash = "sha256-d3k1X41/D9PpPWsDety2AiYyLv9LJIhpkOo3a6qKcB8=";
42     })
43   ];
45   nativeCheckInputs = [ pytestCheckHook ];
47   meta = {
48     description = "HTTP request/response parser for python in C";
49     homepage = "https://github.com/benoitc/http-parser";
50     license = lib.licenses.mit;
51     maintainers = [ ];
52   };