From 9c1db8831e99bd729ba3e9f22f926b184b7fcf6d483d2a6e7cd0f79903f41e51 Mon Sep 17 00:00:00 2001 From: Steve Kowalik Date: Tue, 17 Dec 2024 01:54:27 +0000 Subject: [PATCH] - No longer skip building for Python 3.12. - Switch to pyproject and autosetup macros. - Add patch use-importlib.patch: * Use importlib, rather than imp. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-sat-search?expand=0&rev=9 --- .gitattributes | 23 +++++++++++ .gitignore | 1 + LICENSE | 19 +++++++++ python-sat-search.changes | 41 +++++++++++++++++++ python-sat-search.spec | 84 +++++++++++++++++++++++++++++++++++++++ sat-search-0.3.0.tar.gz | 3 ++ use-importlib.patch | 36 +++++++++++++++++ 7 files changed, 207 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 python-sat-search.changes create mode 100644 python-sat-search.spec create mode 100644 sat-search-0.3.0.tar.gz create mode 100644 use-importlib.patch diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f2e2ca9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2016 Development Seed + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/python-sat-search.changes b/python-sat-search.changes new file mode 100644 index 0000000..37c8399 --- /dev/null +++ b/python-sat-search.changes @@ -0,0 +1,41 @@ +------------------------------------------------------------------- +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 + +- skip build for python 3.12 + +------------------------------------------------------------------- +Fri Oct 7 15:21:21 UTC 2022 - Yogalakshmi Arunachalam + +- Update to version 0.3.0 + * Updated to work with STAC API v0.9.0 and v1.0.0-beta.2 + * SATUTILS_API_URL envvar changed to STAC_API_URL and default value removed. Specify with envvar or pass into Search when using library + * When downloading, specify filename_template for location instead of both datadir and filename. + * Update pagination to precisely follow STAC spec + +------------------------------------------------------------------- +Mon Aug 17 07:06:52 UTC 2020 - Tomáš Chvátal + +- Fix the download url + +------------------------------------------------------------------- +Mon Aug 10 11:48:05 UTC 2020 - Tomáš Chvátal + +- Do not pull in pytest-runner as it is deprecated + +------------------------------------------------------------------- +Sat Aug 1 16:24:24 UTC 2020 - andy great + +- Update spec file to use python alternative. + +------------------------------------------------------------------- +Sun Jul 26 12:16:56 UTC 2020 - andy great + +- Initial package release. diff --git a/python-sat-search.spec b/python-sat-search.spec new file mode 100644 index 0000000..1facc28 --- /dev/null +++ b/python-sat-search.spec @@ -0,0 +1,84 @@ +# +# spec file for package python-sat-search +# +# 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 +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?sle15_python_module_pythons} +%define packagename sat-search +Name: python-sat-search +Version: 0.3.0 +Release: 0 +Summary: A tool for discovering and downloading publicly available satellite imagery +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 +Requires(post): update-alternatives +Requires(postun): update-alternatives +BuildArch: noarch +%python_subpackages + +%description +Sat-search is a Python 3 library and a command line tool for discovering +and downloading publicly available satellite imagery using a conformant +API such as sat-api. + +%prep +%autosetup -p1 -n %{packagename}-%{version} +cp %{SOURCE99} . + +sed -i -e '/pytest-runner/d' setup.py + +%build +%pyproject_wheel + +%install +%pyproject_install +for p in %{packagename} ; do + %python_clone -a %{buildroot}%{_bindir}/$p +done +%python_expand rm -r %{buildroot}%{$python_sitelib}/test +%python_expand %fdupes %{buildroot}%{$python_sitelib} +%prepare_alternative %{packagename} + +%post +%python_install_alternative %{packagename} + +%postun +%python_uninstall_alternative %{packagename} + +%check +# polls server for data for searching +#%%pytest + +%files %{python_files} +%doc README.md +%license LICENSE +%python_alternative %{_bindir}/%{packagename} +%{python_sitelib}/satsearch +%{python_sitelib}/sat_search-%{version}.dist-info + +%changelog diff --git a/sat-search-0.3.0.tar.gz b/sat-search-0.3.0.tar.gz new file mode 100644 index 0000000..7e53234 --- /dev/null +++ b/sat-search-0.3.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bf59e96ae679bcddf4897a32d6f0e727a7b9a1b7443153681ee05fdecafc0245 +size 10742 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__))