python-healpy/python-healpy.spec
Matej Cepl 2919b40d11 (Note that the current stable 1.17.x series of releases are unusable because they rely on an unreleased version of healpix_cxx, and work-around that by setting rpaths to the build dir to find the bundled healpix_cxx.so library instead of installing the latter)
* Add python-healpy-scipy-1_14-compat.patch: Account for the renaming of trapz to trapezoid in scipy 1.14.
* Add python-healpy-matplotlib-1_9-compat.patch: Fix compatibility with matplotlib >= 3.9; upstream commit 0b1f498 rebased for current version.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-healpy?expand=0&rev=18
2024-07-20 16:26:22 +00:00

122 lines
4.6 KiB
RPMSpec

#
# spec file for package python-healpy
#
# 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}
Name: python-healpy
Version: 1.16.6
Release: 0
Summary: Python library to handle pixelated data on the sphere based on HEALPix
License: GPL-2.0-only
URL: https://github.com/healpy/healpy
Source: https://files.pythonhosted.org/packages/source/h/healpy/healpy-%{version}.tar.gz
# PATCH-FIX-UPSTREAM python-healpy-scipy-1_14-compat.patch badshah400@gmail.com -- Account for renaming of integrate.trapz to integrate.trapezoidal in scipy 1.14
Patch0: python-healpy-scipy-1_14-compat.patch
# PATCH-FIX-UPSTREAM python-healpy-matplotlib-1_9-compat.patch badshah400@gmail.com -- Compatibility with matplotlib 3.9 via upstream commit 0b1f498 rebased for current version
Patch1: python-healpy-matplotlib-1_9-compat.patch
BuildRequires: %{python_module Cython}
BuildRequires: %{python_module devel}
BuildRequires: %{python_module numpy-devel >= 1.13}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools_scm}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: gcc-c++
BuildRequires: pkgconfig
BuildRequires: python-rpm-macros
BuildRequires: pkgconfig(cfitsio)
BuildRequires: pkgconfig(healpix_cxx)
BuildRequires: pkgconfig(libsharp)
Requires: python-astropy >= 4.0
Requires: python-matplotlib
Requires: python-numpy >= 1.13
Requires: python-scipy
Requires(post): update-alternatives
Requires(postun):update-alternatives
# SECTION Additional test requirements
# Symbol clashes with astropy < 4.0
BuildRequires: %{python_module astropy >= 4.0}
BuildRequires: %{python_module matplotlib}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module requests}
BuildRequires: %{python_module scipy}
# /SECTION
%python_subpackages
%description
healpy is a Python package to handle pixelated data on the sphere. It is based
on the Hierarchical Equal Area isoLatitude Pixelization (HEALPix) scheme and
bundles the HEALPix C++ library.
healpy provides utilities to:
* convert between sky coordinates and pixel indices in HEALPix nested and ring schemes
* find pixels within a disk, a polygon or a strip in the sky
* apply coordinate transformations between Galactic, Ecliptic and Equatorial reference frames
* apply custom rotations either to vectors or full maps
* read and write HEALPix maps to disk in FITS format
* upgrade and downgrade the resolution of existing HEALPix maps
* visualize maps in Mollweide, Gnomonic and Cartographic projections
* transform maps to Spherical Harmonics space and back using multi-threaded C++ routines
* compute Auto and Cross Power Spectra from maps and create map realizations from spectra
%package devel
Summary: C++ header files and source codes for healpy
Requires: python-devel
Requires: python-numpy-devel
Requires: pkgconfig(healpix_cxx)
%description devel
This package provides the C++ header files and source codes for healpy.
%prep
%autosetup -p1 -n healpy-%{version}
chmod -x healpy/data/planck_*cmap.dat
%build
export CFLAGS="%{optflags}"
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/healpy_get_wmap_maps.sh
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%check
export PYTEST_DEBUG_TEMPROOT=$(mktemp -d -p ./)
# Skip tests requiring network access
%pytest_arch -k 'not (test_astropy_download_file or test_rotate_map_polarization or test_pixelweights_local_datapath)' %{buildroot}%{$python_sitearch}/healpy
%post
%python_install_alternative healpy_get_wmap_maps.sh
%postun
%python_uninstall_alternative healpy_get_wmap_maps.sh
%files %{python_files}
%doc CHANGELOG.rst README.rst
%license COPYING
%python_alternative %{_bindir}/healpy_get_wmap_maps.sh
%{python_sitearch}/healpy/
%{python_sitearch}/healpy-%{version}*-info/
%exclude %{python_sitearch}/healpy/src
%files %{python_files devel}
%{python_sitearch}/healpy/src/
%changelog