From 7dc5700528a9e178aa0c0c3a8d171462f16b82d2 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Sun, 31 May 2026 17:47:11 +0200 Subject: [PATCH] - updated to 1.2.1 --- python3-resolvelib.spec | 19 ++++++----- remove-commentjson-dep.patch | 63 ------------------------------------ 2 files changed, 9 insertions(+), 73 deletions(-) delete mode 100644 remove-commentjson-dep.patch diff --git a/python3-resolvelib.spec b/python3-resolvelib.spec index 4987dae..5a32943 100644 --- a/python3-resolvelib.spec +++ b/python3-resolvelib.spec @@ -5,18 +5,18 @@ %define module resolvelib Summary: Resolve abstract dependencies into concrete ones Name: python3-%{module} -Version: 1.0.1 +Version: 1.2.1 Release: 1 License: ISC Group: Libraries/Python Source0: https://github.com/sarugaku/resolvelib/archive/refs/tags/%{version}.tar.gz -# Source0-md5: 8b974341f0aa7532d2a093fa79dd4b1e -Patch0: remove-commentjson-dep.patch +# Source0-md5: d5b1ef16527d3cc6ec4850d6b2e01007 URL: https://github.com/sarugaku/resolvelib +BuildRequires: python3-build +BuildRequires: python3-installer BuildRequires: python3-modules >= 1:3.6 -BuildRequires: python3-setuptools BuildRequires: rpm-pythonprov -BuildRequires: rpmbuild(macros) >= 1.714 +BuildRequires: rpmbuild(macros) >= 2.044 BuildArch: noarch BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -28,15 +28,14 @@ spit out a resolution result. %prep %setup -q -n %{module}-%{version} -%patch -P0 -p1 %build -%py3_build %{?with_tests:test} +%py3_build_pyproject %{?with_tests:test} %install rm -rf $RPM_BUILD_ROOT -%py3_install +%py3_install_pyproject %clean rm -rf $RPM_BUILD_ROOT @@ -44,5 +43,5 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) %doc README.rst -%{py3_sitescriptdir}/%{module} -%{py3_sitescriptdir}/%{module}-%{version}-py*.egg-info +%{py3_sitescriptdir}/resolvelib +%{py3_sitescriptdir}/resolvelib-%{version}.dist-info \ No newline at end of file diff --git a/remove-commentjson-dep.patch b/remove-commentjson-dep.patch deleted file mode 100644 index 2905a65..0000000 --- a/remove-commentjson-dep.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 3e50054d836b655b0868520bae8b85a3c18967ef Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Wed, 8 Nov 2023 17:12:16 +0100 -Subject: [PATCH] Replace the commentjson test dependency with re.sub - -While at it, only open the json files once. - -Co-authored-by: Maxwell G ---- - setup.cfg | 1 - - .../cocoapods/test_resolvers_cocoapods.py | 19 +++++++++++-------- - 2 files changed, 11 insertions(+), 9 deletions(-) - -diff --git a/setup.cfg b/setup.cfg -index 5eddf2f..e080991 100644 ---- a/setup.cfg -+++ b/setup.cfg -@@ -44,7 +44,6 @@ lint = - isort - types-requests - test = -- commentjson - packaging - pytest - release = -diff --git a/tests/functional/cocoapods/test_resolvers_cocoapods.py b/tests/functional/cocoapods/test_resolvers_cocoapods.py -index 12dff46..f54e27d 100644 ---- a/tests/functional/cocoapods/test_resolvers_cocoapods.py -+++ b/tests/functional/cocoapods/test_resolvers_cocoapods.py -@@ -5,7 +5,6 @@ - import re - import string - --import commentjson # type: ignore - import pytest - - from resolvelib import AbstractProvider, ResolutionImpossible, Resolver -@@ -124,14 +123,18 @@ def _version_in_specset(version, specset): - - - def _safe_json_load(filename): -- # Some fixtures has comments so the stdlib implementation doesn't work. -- # We only use commentjson if we absolutely need to because it's SLOW. -- try: -- with open(filename) as f: -+ # Some fixtures have comments so they are not valid json. -+ # We could use commentjson/json5 to load them, -+ # but it's easier to strip the comments. -+ # We only do it when json.load() fails to avoid unnecessary loading -+ # all the json files to strings. -+ with open(filename) as f: -+ try: - data = json.load(f) -- except ValueError: -- with open(filename) as f: -- data = commentjson.load(f) -+ except ValueError: -+ f.seek(0) -+ strippedjson = re.sub(r"//.*$", "", f.read(), flags=re.MULTILINE) -+ data = json.loads(strippedjson) - return data - - -- 2.52.0