File ecmwf-datastores-client.spec of Package ecmwf-datastores-client

#
# spec file for package ecmwf-datastores-client
#
# Copyright (c) 2025 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/
#

%if 0%{?sle_version} >= 150500 && 0%{?is_opensuse}
%{?sle15_python_module_pythons}
%endif

Name:           ecmwf-datastores-client
Version:        0.1.0
Release:        0
Summary:        ECMWF Data Stores Service (DSS) API Python client
License:        Apache-2.0
Group:          Development/Libraries/Python
URL:            https://ecmwf.github.io/ecmwf-datastores-client
Source:         https://github.com/ecmwf/ecmwf-datastores-client/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Source1:        setup.py
BuildRequires:  %{python_module attrs}
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module multiurl}
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module requests}
BuildRequires:  %{python_module responses}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module typing_extensions}
BuildRequires:  python-rpm-macros
%if 0%{?suse_version}
BuildRequires:  fdupes
%endif
Requires:       python-attrs
#--circular dependency: cdsapi is needed for the legacy_api_client
#--functionality, which requires ecmwf-datastores-client (!)
Requires:       python-cdsapi >= 0.7.5
Requires:       python-multiurl >= 0.3.2
Requires:       python-requests
Requires:       python-typing_extensions
BuildArch:      noarch
%python_subpackages

%description
API library to request and retrieve datasets from Copernicus Data Stores
(https://cds.climate.copernicus.eu, https://ads.atmosphere.copernicus.eu
and https://ewds.climate.copernicus.eu)

%prep
%autosetup
cp -a %{SOURCE1} .

%build
sed -i '/^ *version/ s/@VERSION@/%{version}/' setup.py
%python_build

%install
%python_install
%if 0%{?suse_version}
%python_expand %fdupes %{buildroot}%{$python_sitelib}/ecmwf*
%endif

%check
#---Only a subset of tests work without network:
%pytest tests/test_01_*.py tests/test_10_*.py tests/test_20_*.py

%files %{python_files}
%doc README.md
%license LICENSE
%{python_sitelib}/ecmwf
%{python_sitelib}/ecmwf_datastores_client-%{version}-py*.egg-info

%changelog
openSUSE Build Service is sponsored by