Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-http-parser for openSUSE:Factory checked in at 2024-02-15 21:00:30 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-http-parser (Old) and /work/SRC/openSUSE:Factory/.python-http-parser.new.1815 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-http-parser" Thu Feb 15 21:00:30 2024 rev:18 rq:1146668 version:0.9.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-http-parser/python-http-parser.changes 2020-06-17 14:55:13.929986770 +0200 +++ /work/SRC/openSUSE:Factory/.python-http-parser.new.1815/python-http-parser.changes 2024-02-15 21:01:49.843009282 +0100 @@ -1,0 +2,9 @@ +Thu Jan 11 03:17:05 UTC 2024 - Steve Kowalik <steven.kowa...@suse.com> + +- Switch to autosetup and pyproject macros. +- Stop using greedy globs in %files. +- Actually run fdupes. +- Add patch remove-imp-module.patch: + * Use importlib, not imp. + +------------------------------------------------------------------- New: ---- remove-imp-module.patch BETA DEBUG BEGIN: New:- Actually run fdupes. - Add patch remove-imp-module.patch: * Use importlib, not imp. BETA DEBUG END: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-http-parser.spec ++++++ --- /var/tmp/diff_new_pack.cHFwJ8/_old 2024-02-15 21:01:50.299025310 +0100 +++ /var/tmp/diff_new_pack.cHFwJ8/_new 2024-02-15 21:01:50.303025451 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-http-parser # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,18 +16,21 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-http-parser Version: 0.9.0 Release: 0 Summary: HTTP Request/Response Parser for Python in C License: MIT -Group: Development/Languages/Python URL: https://github.com/benoitc/http-parser/ Source: https://files.pythonhosted.org/packages/source/h/http-parser/http-parser-%{version}.tar.gz +# PATCH-FIX-UPSTREAM gh#benoitc/http-parser#101 +Patch0: remove-imp-module.patch BuildRequires: %{python_module Cython} BuildRequires: %{python_module devel} +BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes BuildRequires: python-rpm-macros %python_subpackages @@ -36,21 +39,23 @@ http-parser from Ryan Dahl. %prep -%setup -q -n http-parser-%{version} +%autosetup -p1 -n http-parser-%{version} %build # fix wrongly generated cyx files find . -name '*.pyx' -exec cython {} \; export CFLAGS="%{optflags} -fno-strict-aliasing" -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install # Remove exec bits from example scripts chmod a-x examples/* +%python_expand %fdupes %{buildroot}%{$python_sitearch} %files %{python_files} %license LICENSE %doc NOTICE README.rst examples -%{python_sitearch}/* +%{python_sitearch}/http_parser +%{python_sitearch}/http_parser-%{version}.dist-info ++++++ remove-imp-module.patch ++++++ >From 4d4984ce129253f9de475bfd3c683301c916e8b1 Mon Sep 17 00:00:00 2001 From: Steve Kowalik <ste...@wedontsleep.org> Date: Thu, 11 Jan 2024 14:14:07 +1100 Subject: [PATCH] Switch to importlib in setup.py The imp module has been deprecated and was removed in Python 3.12. Switch to using importlib functions to load the module, rather than imp.load_source(). Fixes #99 --- setup.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5c3f768..04de1d0 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,8 @@ 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 @@ # 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"))