mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 07:53:19 +00:00
python312Packages.http-parser: use fetchpatch
Co-authored-by: annaleeleaves <168274788+annaleeleaves@users.noreply.github.com>
This commit is contained in:
parent
bd53c79a73
commit
ed0e7323a8
@ -5,6 +5,7 @@
|
||||
cython,
|
||||
setuptools,
|
||||
pytestCheckHook,
|
||||
fetchpatch,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
@ -34,7 +35,12 @@ buildPythonPackage rec {
|
||||
# The imp module is deprecated since version 3.4, and was removed in 3.12
|
||||
# https://docs.python.org/3.11/library/imp.html
|
||||
# Fix from: https://github.com/benoitc/http-parser/pull/101/
|
||||
patches = [ ./imp-importlib.diff ];
|
||||
patches = [
|
||||
(fetchpatch {
|
||||
url = "https://github.com/benoitc/http-parser/commit/4d4984ce129253f9de475bfd3c683301c916e8b1.patch";
|
||||
hash = "sha256-d3k1X41/D9PpPWsDety2AiYyLv9LJIhpkOo3a6qKcB8=";
|
||||
})
|
||||
];
|
||||
|
||||
nativeCheckInputs = [ pytestCheckHook ];
|
||||
|
||||
|
@ -1,31 +0,0 @@
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 5c3f768..04de1d0 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -9,7 +9,8 @@ from distutils.errors import CCompilerError, DistutilsExecError, \
|
||||
from distutils.command.build_ext import build_ext
|
||||
from distutils.command.sdist import sdist as _sdist
|
||||
import glob
|
||||
-from imp import load_source
|
||||
+import importlib.machinery
|
||||
+import importlib.util
|
||||
import io
|
||||
import os
|
||||
import shutil
|
||||
@@ -28,6 +29,16 @@ if sys.platform == 'win32' and sys.version_info > (2, 6):
|
||||
# find the compiler
|
||||
ext_errors += (IOError,)
|
||||
|
||||
+
|
||||
+def load_source(modname, filename):
|
||||
+ loader = importlib.machinery.SourceFileLoader(modname, filename)
|
||||
+ spec = importlib.util.spec_from_file_location(
|
||||
+ modname, filename, loader=loader)
|
||||
+ module = importlib.util.module_from_spec(spec)
|
||||
+ loader.exec_module(module)
|
||||
+ return module
|
||||
+
|
||||
+
|
||||
http_parser = load_source("http_parser", os.path.join("http_parser",
|
||||
"__init__.py"))
|
||||
|
Loading…
Reference in New Issue
Block a user