public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-kaptan] rawhide: Fixes F45FTBS plus spec cleanup and modernization
@ 2026-08-06  1:41 Filipe Rosset
  0 siblings, 0 replies; only message in thread
From: Filipe Rosset @ 2026-08-06  1:41 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/python-kaptan
            Branch : rawhide
            Commit : 2dc9d0154c97e2616790568963b4040218eeda77
            Author : Filipe Rosset <rosset.filipe@gmail.com>
            Date   : 2026-07-27T21:34:26-03:00
            Stats  : +29/-11 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/python-kaptan/c/2dc9d0154c97e2616790568963b4040218eeda77?branch=rawhide

            Log:
            Fixes F45FTBS plus spec cleanup and modernization

Resolves: rhbz#2423881
Resolves: rhbz#2377835

---
diff --git a/python-kaptan-importlib.patch b/python-kaptan-importlib.patch
new file mode 100644
index 0000000..2498ba5
--- /dev/null
+++ b/python-kaptan-importlib.patch
@@ -0,0 +1,17 @@
+--- kaptan-0.6.0/kaptan/handlers/pyfile_handler.py.orig	2026-07-27 21:28:00.000000000 -0300
++++ kaptan-0.6.0/kaptan/handlers/pyfile_handler.py	2026-07-27 21:28:00.000000000 -0300
+@@ -40,9 +40,11 @@
+         raise IOError('File {0} not found.'.format(pathname))
+ 
+     if sys.version_info[0] == 3 and sys.version_info[1] > 2:  # Python >= 3.3
+-        import importlib.machinery
+-        loader = importlib.machinery.SourceFileLoader('', pathname)
+-        mod = loader.load_module(mod_name)
++        import importlib.util
++        spec = importlib.util.spec_from_file_location(mod_name, pathname)
++        mod = importlib.util.module_from_spec(spec)
++        sys.modules[mod_name] = mod
++        spec.loader.exec_module(mod)
+     else:  # 2.6 >= Python <= 3.2
+         import imp
+         mod = imp.load_source(mod_name, pathname)

diff --git a/python-kaptan.spec b/python-kaptan.spec
index 50e3f48..d68de90 100644
--- a/python-kaptan.spec
+++ b/python-kaptan.spec
@@ -6,9 +6,10 @@ Release:        9%{?dist}
 Summary:        Configuration parser
 
 # Automatically converted from old format: BSD - review is highly recommended.
-License:        LicenseRef-Callaway-BSD
+License:        BSD-3-Clause
 URL:            https://github.com/emre/kaptan
 Source:         %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz
+Patch0:         python-kaptan-importlib.patch
 BuildArch:      noarch
 
 %description
@@ -18,34 +19,34 @@ BuildArch:      noarch
 Summary:        %{summary}
 
 BuildRequires:  python3-devel
+BuildRequires:  python3-pytest
 BuildRequires:  python3-setuptools
-BuildRequires:  python3dist(pyyaml)
-BuildRequires:  python3dist(pytest)
-%{?python_provide:%python_provide python3-%{srcname}}
+BuildRequires:  python3-yaml
 
 %description -n python3-%{srcname}
 %{summary}.
 
 %prep
-%autosetup -n %{srcname}-%{version}
+%autosetup -n %{srcname}-%{version} -p1
 sed -i -e 's/PyYAML>=3.13,<6/PyYAML/' requirements/base.txt
 
+%generate_buildrequires
+%pyproject_buildrequires
+
 %build
-%py3_build
+%pyproject_wheel
 
 %install
-%py3_install
+%pyproject_install
+%pyproject_save_files %{srcname}
 
 %check
 %pytest -v tests
 
 # A man page has been requested upstream here:
 # https://github.com/emre/kaptan/issues/44
-%files -n python3-%{srcname}
-%license LICENSE
+%files -n python3-%{srcname} -f %{pyproject_files}
 %doc README.rst
-%{python3_sitelib}/%{srcname}-*.egg-info/
-%{python3_sitelib}/%{srcname}/
 %{_bindir}/%{srcname}
 
 %changelog

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-06  1:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-06  1:41 [rpms/python-kaptan] rawhide: Fixes F45FTBS plus spec cleanup and modernization Filipe Rosset

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox