File cdsapi.spec of Package cdsapi

#
# spec file for package cdsapi
#
# 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:           cdsapi
Version:        0.7.6
Release:        0
Summary:        Copernicus Climate Data Store Web-API client
License:        Apache-2.0
Group:          Development/Libraries/Python
URL:            https://github.com/ecmwf/cdsapi
Source:         https://github.com/ecmwf/cdsapi/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
BuildRequires:  %{python_module devel}
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module setuptools}
BuildRequires:  python-rpm-macros
%if 0%{?suse_version}
BuildRequires:  fdupes
%endif
Requires:       python-requests
#--circular dependency: ecmwf-datastores-client is needed for the legacy_api_client
#--functionality, which requires cdsapi (!)
Requires:       python-ecmwf-datastores-client
Recommends:     python-tqdm
BuildArch:      noarch
%python_subpackages

%description
Client library to request and retrieve datasets from Copernicus Climate Data Store
(https://cds.climate.copernicus.eu).

%prep
%autosetup -p1

%build
%python_build

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

%files %{python_files}
%doc README.rst
%license LICENSE.txt
%{python_sitelib}/cdsapi
%{python_sitelib}/cdsapi-%{version}-py*.egg-info

%changelog
openSUSE Build Service is sponsored by