diff --git a/python-sat-stac.changes b/python-sat-stac.changes index 3af5a6e..49653b6 100644 --- a/python-sat-stac.changes +++ b/python-sat-stac.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Wed Dec 4 06:20:59 UTC 2024 - Steve Kowalik + +- Stop skipping on Python versions. +- Add patch use-importlib.patch: + * Use importlib to support Python 3.12+ +- Switch to autosetup and pyproject macros. + ------------------------------------------------------------------- Tue Oct 29 08:13:50 UTC 2024 - Dirk Müller diff --git a/python-sat-stac.spec b/python-sat-stac.spec index 817d2f2..58495d2 100644 --- a/python-sat-stac.spec +++ b/python-sat-stac.spec @@ -17,9 +17,6 @@ %{?sle15_python_module_pythons} -# from imp import load_source -%global skip_python312 1 -%global skip_python313 1 %define packagename sat-stac Name: python-sat-stac Version: 0.4.1 @@ -28,9 +25,13 @@ Summary: A library for reading and working with Spatio-Temporal Asset Cat License: MIT URL: https://github.com/sat-utils/sat-stac Source: https://files.pythonhosted.org/packages/source/s/sat-stac/sat-stac-%{version}.tar.gz +# PATCH-FIX-UPSTREAM gh#sat-utils/sat-stac#75 +Patch0: use-importlib.patch +BuildRequires: %{python_module pip} BuildRequires: %{python_module python-dateutil >= 2.7.5} BuildRequires: %{python_module requests >= 2.19.1} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-python-dateutil >= 2.7.5 @@ -46,13 +47,13 @@ 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} %build -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitelib} for p in %{packagename} ; do %python_clone -a %{buildroot}%{_bindir}/$p @@ -71,7 +72,7 @@ done %files %{python_files} %doc README.md %python_alternative %{_bindir}/%{packagename} -%{python_sitelib}/*egg-info %{python_sitelib}/satstac +%{python_sitelib}/sat_stac-%{version}.dist-info %changelog diff --git a/use-importlib.patch b/use-importlib.patch new file mode 100644 index 0000000..d018c72 --- /dev/null +++ b/use-importlib.patch @@ -0,0 +1,36 @@ +From 31dfa7c419c3bae3bab090631cb6a13486e0ffb9 Mon Sep 17 00:00:00 2001 +From: Victor Engmark +Date: Fri, 6 Sep 2024 09:00:10 +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 b2bd3d7..692d0cd 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('satstac.version', 'satstac/version.py').__version__ + + here = path.abspath(path.dirname(__file__))