File ecmwf-opendata.spec of Package ecmwf-opendata
#
# spec file for package ecmwf-opendata
#
# 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/
#
#---not enough libraries available in Leap 15.5; python3 and >=python311 for 15.6
%if 0%{?sle_version} >= 150600 && 0%{?is_opensuse}
%{?sle15allpythons}
%endif
Name: ecmwf-opendata
Version: 0.3.19
Release: 0
Summary: Client library to download ECMWF open data
License: Apache-2.0
Group: Development/Libraries/Python
URL: https://pypi.org/project/ecmwf-opendata/
Source: https://github.com/ecmwf/ecmwf-opendata/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: pass-debug.patch
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: python-rpm-macros
%if 0%{?suse_version}
BuildRequires: fdupes
%endif
Requires: python-multiurl >= 0.2.1
BuildArch: noarch
%python_subpackages
%description
Package to simplify the download of ECMWF open data. It implements a
request-based interface to the dataset using ECMWF's MARS language to
select meteorological fields, similar to the existing
ecmwf-api-client Python package. For details, see
* https://confluence.ecmwf.int/display/DAC/ECMWF+open+data%3A+real-time+forecasts+from+IFS+and+AIFS
* https://www.ecmwf.int/en/forecasts/datasets/open-data
%prep
%autosetup -p1
%build
#---env-shebangs generate warning / error messages.
#---These files are not executable though, remove the shebangs therefore.
#---Fix it at %%build time due to subpackages mechanism.
for fil in `find ecmwf/ -name "*.py"`; do
sed -i -e '1 s|[!]/usr/bin/env python.*||' "$fil"
done
%python_build
%install
%python_install
%if 0%{?suse_version}
%python_expand %fdupes %{buildroot}%{$python_sitelib}/ecmwf/opendata
%endif
%files %{python_files}
%doc README.md
%license LICENSE
%dir %{python_sitelib}/ecmwf
%{python_sitelib}/ecmwf/opendata
%{python_sitelib}/ecmwf_opendata-%{version}-py*.egg-info
%changelog