diff --git a/python-sat-search.changes b/python-sat-search.changes index fd7a21c..37c8399 100644 --- a/python-sat-search.changes +++ b/python-sat-search.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Dec 17 01:53:28 UTC 2024 - Steve Kowalik + +- No longer skip building for Python 3.12. +- Switch to pyproject and autosetup macros. +- Add patch use-importlib.patch: + * Use importlib, rather than imp. + ------------------------------------------------------------------- Thu Mar 14 10:06:06 UTC 2024 - Dirk Müller diff --git a/python-sat-search.spec b/python-sat-search.spec index 1460702..1facc28 100644 --- a/python-sat-search.spec +++ b/python-sat-search.spec @@ -18,7 +18,6 @@ %{?sle15_python_module_pythons} %define packagename sat-search -%global skip_python312 1 Name: python-sat-search Version: 0.3.0 Release: 0 @@ -27,9 +26,13 @@ License: MIT URL: https://github.com/sat-utils/sat-search Source: https://files.pythonhosted.org/packages/source/s/sat-search/sat-search-%{version}.tar.gz Source99: https://raw.githubusercontent.com/sat-utils/sat-search/master/LICENSE +# PATCH-FIX-UPSTREAM gh#sat-utils/sat-search#136 +Patch0: use-importlib.patch +BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest >= 2.8.2} BuildRequires: %{python_module sat-stac} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-sat-stac @@ -44,16 +47,16 @@ and downloading publicly available satellite imagery using a conformant API such as sat-api. %prep -%setup -q -n %{packagename}-%{version} +%autosetup -p1 -n %{packagename}-%{version} cp %{SOURCE99} . sed -i -e '/pytest-runner/d' setup.py %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install for p in %{packagename} ; do %python_clone -a %{buildroot}%{_bindir}/$p done @@ -76,6 +79,6 @@ done %license LICENSE %python_alternative %{_bindir}/%{packagename} %{python_sitelib}/satsearch -%{python_sitelib}/*egg-info +%{python_sitelib}/sat_search-%{version}.dist-info %changelog diff --git a/use-importlib.patch b/use-importlib.patch new file mode 100644 index 0000000..9957986 --- /dev/null +++ b/use-importlib.patch @@ -0,0 +1,36 @@ +From 485ffadccbc95b738a63b6c9513a728f7e455ebc Mon Sep 17 00:00:00 2001 +From: Victor Engmark +Date: Fri, 6 Sep 2024 09:10:02 +1200 +Subject: [PATCH] fix: Use new importlib + +As recommended by . +--- + setup.py | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/setup.py b/setup.py +index 9feb1c8..dcc951c 100755 +--- a/setup.py ++++ b/setup.py +@@ -1,9 +1,20 @@ + #!/usr/bin/env python ++import importlib.util ++import importlib.machinery + from setuptools import setup, find_packages +-from imp import load_source + from os import path + import io + ++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) ++ # The module is always executed and not cached in sys.modules. ++ # Uncomment the following line to cache the module. ++ # sys.modules[module.__name__] = module ++ loader.exec_module(module) ++ return module ++ + __version__ = load_source('satsearch.version', 'satsearch/version.py').__version__ + + here = path.abspath(path.dirname(__file__))