6e5764e
Name:           python-eccodes
fc6ed34
Version:        1.7.0
8de5a6e
Release:        2%{?dist}
6e5764e
Summary:        Python interface to the ecCodes GRIB and BUFR decoder/encoder
5a25bff
License:        Apache-2.0
ebbb14c
ebbb14c
%global sphinx_doc_path build/sphinx/html/
ebbb14c
d6af7f3
# note: upstream has changed the name on pypi from eccodes-python to eccodes
d6af7f3
URL:            https://pypi.org/project/eccodes/
d6af7f3
Source0:        https://files.pythonhosted.org/packages/source/e/eccodes/eccodes-%{version}.tar.gz
6e5764e
# see https://github.com/ecmwf/eccodes-python/pull/21
6e5764e
Patch1:         python-eccodes-setup.patch
d6af7f3
# see https://github.com/ecmwf/eccodes-python/issues/36
d6af7f3
Patch2:         python-eccodes-sphinx-config.patch
c6856c7
# ECMWF introduced a new dependency called findlibs
c6856c7
# to find libeccodes.so easier on non-linux platforms.
c6856c7
# Since this is not useful at all for fedora users 
c6856c7
# I don't plan to package this python lib, so I patched out the use of it.
c6856c7
Patch3:         python-eccodes-disable-findlibs.patch
6e5764e
6e5764e
# note that the fast bindings are arch dependent
1770927
BuildRequires:  eccodes-devel
6e5764e
BuildRequires:  python3-devel
8c86b03
BuildRequires:  python3-setuptools
6e5764e
# needed to build the fast bindings
6e5764e
BuildRequires:  python3-cffi
6e5764e
# needed for checks/tests
6e5764e
BuildRequires:  python3-pytest
6e5764e
BuildRequires:  python3-numpy
6e5764e
# these next 2 seem not actually used, although they are mentioned as
6e5764e
# test dependencies in the setup.py file:
6e5764e
#BuildRequires:  python3-pytest-cov
6e5764e
#BuildRequires:  python3-pytest-flakes
6e5764e
6e5764e
# needed to build the documentation
6e5764e
BuildRequires:  python3-sphinx
6e5764e
fc8ef03
# dont try to build for architectures for which the main
fc8ef03
# ecccodes library cannot yet be build
fc8ef03
fc8ef03
# as explained in bugzilla #1562066
fc8ef03
ExcludeArch: i686
fc8ef03
# as explained in bugzilla #1562076
bef7e3b
# this one should no longer be necessary
bef7e3b
# ExcludeArch: s390x
fc8ef03
# as explained in bugzilla #1562084
fc8ef03
ExcludeArch: armv7hl
fc8ef03
fc8ef03
6e5764e
%global _description \
6e5764e
Python 3 interface to encode and decode GRIB and BUFR files via the \
6e5764e
ECMWF ecCodes library. It allows reading and writing of GRIB 1 and 2 \
6e5764e
files and BUFR 3 and 4 files.
6e5764e
6e5764e
%description %_description
6e5764e
6e5764e
%package -n python3-eccodes
6e5764e
Summary: %summary
6e5764e
6e5764e
%{?python_provide:%python_provide python3-eccodes}
6e5764e
6e5764e
%description -n python3-eccodes %_description
6e5764e
6e5764e
%prep
d6af7f3
%autosetup -n eccodes-%{version} -p1
6e5764e
6e5764e
%build
6e5764e
%py3_build
6e5764e
6e5764e
%install
6e5764e
%py3_install
6e5764e
543f320
# NOTE:
543f320
# this package includes 2 c header files named gribapi/eccodes.h and
543f320
# gribapi/grib_api.h in the python module. This is intentional.
543f320
# The cffi interface reads them during runtime and extracts some
543f320
# constants from them.
543f320
# The function grib_get_api_version is called during import of the eccodes
543f320
# module and crashes with a runtime error if the files are not there.
543f320
# Therefore this next delete has been disabled.
543f320
#rm %%{buildroot}%%{python3_sitearch}/gribapi/*.h
6e5764e
ebbb14c
# build documentation
ebbb14c
# note that the new sphinx-build command only works AFTER installation
ebbb14c
# of the module # so it can no longer be executed during the build stage.
ebbb14c
PYTHONPATH=%{buildroot}%{python3_sitearch} \
ebbb14c
sphinx-build -b html docs %sphinx_doc_path
2a40630
ebbb14c
# remove generated sphinx files that are not part of the actual documentation
ebbb14c
rm %sphinx_doc_path/.buildinfo
fc6ed34
rm -rf %sphinx_doc_path/.doctrees
2a40630
ebbb14c
%check
2a40630
ebbb14c
%{__python3} -m eccodes selfcheck
abf2d1b
%{__python3} -m pytest -v
6e5764e
6e5764e
%files -n python3-eccodes
6e5764e
%doc README.rst
ebbb14c
%doc %sphinx_doc_path
6e5764e
%license LICENSE
d6af7f3
%{python3_sitearch}/eccodes-*-py*.egg-info
6e5764e
%{python3_sitearch}/eccodes
6e5764e
%{python3_sitearch}/gribapi
6e5764e
6e5764e
6e5764e
%changelog
8de5a6e
* Sat Jun 08 2024 Python Maint <python-maint@redhat.com> - 1.7.0-2
8de5a6e
- Rebuilt for Python 3.13
8de5a6e
fc6ed34
* Sun Mar 24 2024 Jos de Kloe <josdekloe@gmail.com> 1.7.0-1
fc6ed34
- new upstream release 1.7.0
fc6ed34
4991d2e
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.1-3
4991d2e
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
4991d2e
c9928ef
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.6.1-2
c9928ef
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
c9928ef
ebbb14c
* Mon Nov 20 2023 Jos de Kloe <josdekloe@gmail.com> 1.6.1-1
ebbb14c
- new upstream release 1.6.1
ebbb14c
ebbb14c
* Tue Aug 01 2023 Jos de Kloe <josdekloe@gmail.com> 1.6.0-2
ebbb14c
- fix sphinx call #bz2221958
ebbb14c
f6873ce
* Sat Jul 29 2023 Jos de Kloe <josdekloe@gmail.com> 1.6.0-1
f6873ce
- new upstream release 1.6.0
f6873ce
f6972d1
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-3
f6972d1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
f6972d1
177d2f6
* Wed Jun 14 2023 Python Maint <python-maint@redhat.com> - 1.5.2-2
177d2f6
- Rebuilt for Python 3.12
177d2f6
abf2d1b
* Sat May 20 2023 Jos de Kloe <josdekloe@gmail.com> 1.5.2-1
abf2d1b
- new upstream release 1.5.2
abf2d1b
912ba4c
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.0-2
912ba4c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
912ba4c
5a25bff
* Wed Dec 28 2022 Jos de Kloe <josdekloe@gmail.com> 1.5.0-1
5a25bff
- SPDX migration: change ASL 2.0 to Apache-2.0
5a25bff
2a40630
* Thu Sep 15 2022 Jos de Kloe <josdekloe@gmail.com> 1.5.0-1
2a40630
- new upstream release 1.5.0
2a40630
7c4ebd4
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.2-2
7c4ebd4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
7c4ebd4
cde92df
* Tue Jun 28 2022 Jos de Kloe <josdekloe@gmail.com> 1.4.2-1
cde92df
- new upstream release 1.4.2
cde92df
bbc9f62
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 1.4.1-2
bbc9f62
- Rebuilt for Python 3.11
bbc9f62
1770927
* Sat Mar 12 2022 Jos de Kloe <josdekloe@gmail.com> 1.4.1-1
1770927
- new upstream release 1.4.1
8d2d088
1db1e23
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.3-3
1db1e23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
1db1e23
bef7e3b
* Sun Dec 05 2021 Jos de Kloe <josdekloe@gmail.com> 1.3.3-2
bef7e3b
- remove exclude arch voor s390x; should not be needed anymore
bef7e3b
  since eccodes builds now for this arch.
bef7e3b
8f3d240
* Tue Jul 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.3.3-2
8f3d240
- Second attempt - Rebuilt for
8f3d240
  https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
8f3d240
543f320
* Sat Jul 03 2021 Jos de Kloe <josdekloe@gmail.com> 1.3.3-1
543f320
- new upstream release 1.3.3
543f320
77296d0
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1.3.2-2
77296d0
- Rebuilt for Python 3.10
77296d0
c6856c7
* Sat Apr 17 2021 Jos de Kloe <josdekloe@gmail.com> 1.3.2-1
c6856c7
- new upstream release 1.3.2
c6856c7
237c476
* Fri Apr 09 2021 Jos de Kloe <josdekloe@gmail.com> 1.2.0-1
237c476
- new upstream release 1.2.0
237c476
da3d4f9
* Sat Jan 30 2021 Jos de Kloe <josdekloe@gmail.com> 1.1.0-1
da3d4f9
- new upstream release 1.1.0
da3d4f9
02b97bc
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-2
02b97bc
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
02b97bc
1e6c978
* Fri Nov 13 2020 Jos de Kloe <josdekloe@gmail.com> 1.0.0-1
1e6c978
- new upstream release 1.0.0; remove no longer needed patch 3
1e6c978
d6af7f3
* Sun Oct 18 2020 Jos de Kloe <josdekloe@gmail.com> 0.9.9-1
d6af7f3
- new upstream version, and adapt to upstream project name change
d6af7f3
- add patch for sphinx configuration problem
eec6f10
- add patch to fix test run for eccodes 2.19.0
9202cb7
9202cb7
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.8-2
9202cb7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
9202cb7
8c86b03
* Sat Jul 04 2020 Jos de Kloe <josdekloe@gmail.com> 0.9.8-1
8c86b03
- new upstream version
9202cb7
543f320
* Tue May 26 2020 Miro Hron?ok <mhroncok@redhat.com> - 0.9.7-2
9202cb7
- Rebuilt for Python 3.9
9202cb7
6e5764e
* Thu Mar 19 2020 Jos de Kloe <josdekloe@gmail.com> 0.9.7-1
6e5764e
- First version for Fedora, based on a spec file contributed by
6e5764e
  Emanuele Di Giacomo and Daniele Branchini.