From cbf2cd442baa9b97e3c90258d898978a262bd069 Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Fri, 2 Jun 2023 20:43:49 -0600 Subject: [PATCH] Update to 0.21.0 Use SPDX License Enable tests skivi was removed in 0.20.0, so dropped the scikit-image-tools package --- .gitignore | 2 + python-scikit-image-version.patch | 12 ++++ python-scikit-image.spec | 105 ++++++++++++++++-------------- sources | 3 +- 4 files changed, 73 insertions(+), 49 deletions(-) create mode 100644 python-scikit-image-version.patch diff --git a/.gitignore b/.gitignore index 04a29e8..4623530 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,5 @@ /scikit-image-0.18.3.tar.gz /scikit-image-0.19.2.tar.gz /scikit-image-0.19.3.tar.gz +/scikit-image-0.21.0.tar.gz +/scikit-image-data.tar.xz diff --git a/python-scikit-image-version.patch b/python-scikit-image-version.patch new file mode 100644 index 0000000..f27a878 --- /dev/null +++ b/python-scikit-image-version.patch @@ -0,0 +1,12 @@ +diff -up scikit-image-0.21.0/meson.build.version scikit-image-0.21.0/meson.build +--- scikit-image-0.21.0/meson.build.version 2023-06-01 20:12:41.000000000 -0600 ++++ scikit-image-0.21.0/meson.build 2023-06-02 20:39:40.048765638 -0600 +@@ -4,7 +4,7 @@ project( + # Note that the git commit hash cannot be added dynamically here + # That only happens when importing from a git repository. + # See `skimage/__init__.py` +- version: run_command('skimage/_build_utils/version.py', check: true).stdout().strip(), ++ version: run_command('python3', 'skimage/_build_utils/version.py', check: true).stdout().strip(), + license: 'BSD-3', + meson_version: '>= 0.63.0', + default_options: [ diff --git a/python-scikit-image.spec b/python-scikit-image.spec index 0f5313f..8136967 100644 --- a/python-scikit-image.spec +++ b/python-scikit-image.spec @@ -1,18 +1,21 @@ -%bcond_with check +%bcond_without check %global srcname scikit-image Name: python-scikit-image -Version: 0.19.3 +Version: 0.21.0 Release: 1%{?dist} Summary: Image processing in Python # The following files are BSD 2 clauses, the rest BSD 3 clauses # skimage/graph/_mcp.pyx # skimage/graph/heap.pyx -License: BSD +License: BSD-2-Clause AND BSD-3-Clause URL: http://scikit-image.org/ -Source0: %{pypi_source} +Source0: https://github.com/scikit-image/scikit-image/archive/v%{version}/%{srcname}-%{version}.tar.gz +# Select extra test data - you can build the package locally and then run: +# tar cJvf scikit-image-data.tar.xz -C scikit-image-0.21.0/scikit-image/0.21.0 . +Source1: scikit-image-data.tar.xz BuildRequires: gcc gcc-c++ BuildRequires: xorg-x11-server-Xvfb @@ -26,85 +29,91 @@ versatile set of image processing routines.} %package -n python3-%{srcname} Summary: %{summary} BuildRequires: python3-devel -BuildRequires: %{py3_dist setuptools} -BuildRequires: %{py3_dist Cython} +BuildRequires: python-unversioned-command +BuildRequires: %{py3_dist meson-python} +BuildRequires: %{py3_dist pip} BuildRequires: %{py3_dist numpy} -BuildRequires: pythran -%if %{with check} -BuildRequires: %{py3_dist pytest} BuildRequires: %{py3_dist scipy} -BuildRequires: %{py3_dist matplotlib} BuildRequires: %{py3_dist networkx} BuildRequires: %{py3_dist pillow} BuildRequires: %{py3_dist imageio} BuildRequires: %{py3_dist tifffile} BuildRequires: %{py3_dist PyWavelets} -# Not in fedora: -# pytest-localserver -# Pooch +BuildRequires: %{py3_dist packaging} +BuildRequires: %{py3_dist lazy_loader} +# optional-dependencies +BuildRequires: %{py3_dist Cython} +BuildRequires: pythran +%if %{with check} +BuildRequires: %{py3_dist pytest} +BuildRequires: %{py3_dist pytest-localserver} +BuildRequires: %{py3_dist matplotlib} +BuildRequires: %{py3_dist pooch} %endif +Obsoletes: %{srcname}-tools < 0.20.0 %description -n python3-%{srcname} %_description -%package -n %{srcname}-tools -Summary: Scikit-image utility tools -BuildArch: noarch -Requires: python3-%{srcname} = %{version}-%{release} - -%description -n %{srcname}-tools -Utilities provided by scikit-image: 'skivi' - %prep -%setup -n %{srcname}-%{version} -q -# Remove some shebangs -pushd skimage -for i in $(grep -l -r "/usr/bin/env"); do - sed -i -e '1d' $i; -done -popd +%autosetup -n %{srcname}-%{version} -p1 +# Extract test data - pooch looks for this path in XDG_CACHE_HOME +mkdir -p scikit-image/%{version} +tar xf %SOURCE1 -C scikit-image/%{version} +# Remove pinned numpy versions +sed -i -e '/numpy==/d' pyproject.toml +# For regeneration of cython source rm -f $(grep -rl '/\* Generated by Cython') +# This currently requires building the whole package with -w, which is just too expensive +#generate_buildrequires +#pyproject_buildrequires -t -w + %build -%py3_build +%pyproject_wheel %install -%py3_install -# This is also installed -rm -rf %{buildroot}/%{python3_sitearch}/doc/ +%pyproject_install +%pyproject_save_files skimage %if %{with check} %check # Fake matplotlibrc mkdir -p matplotlib touch matplotlib/matplotlibrc -export XDG_CONFIG_HOME=`pwd` +# For test data +export XDG_CACHE_HOME=$PWD +export XDG_CONFIG_HOME=$PWD export PYTHONDONTWRITEBYTECODE=1 export PYTEST_ADDOPTS='-p no:cacheprovider' pushd %{buildroot}/%{python3_sitearch} -# We deselect tests that require network -# or packages not in Fedora -# require Pooch -# require pytest-localserver - xvfb-run pytest \ - --deselect="data/tests/test_data.py::test_skin" \ - --deselect "io/tests/test_collection.py::TestImageCollection::test_custom_load_func_w_kwarg" \ - --deselect "restoration/tests/test_rolling_ball.py::test_ndim" \ - --deselect="io/tests/test_io.py::test_imread_http_url" \ +# We deselect tests that require network data + xvfb-run pytest -v \ + --deselect="skimage/data/tests/test_data.py::test_download_all_with_pooch" \ + --deselect="skimage/data/tests/test_data.py::test_eagle" \ + --deselect="skimage/data/tests/test_data.py::test_brain_3d" \ + --deselect="skimage/data/tests/test_data.py::test_cells_3d" \ + --deselect="skimage/data/tests/test_data.py::test_kidney_3d_multichannel" \ + --deselect="skimage/data/tests/test_data.py::test_lily_multichannel" \ + --deselect="skimage/data/tests/test_data.py::test_skin" \ + --deselect="skimage/data/tests/test_data.py::test_vortex" \ + --deselect="skimage/measure/tests/test_blur_effect.py::test_blur_effect_3d" \ + --deselect="skimage/registration/tests/test_masked_phase_cross_correlation.py::test_masked_registration_3d_contiguous_mask" \ skimage popd %endif -%files -n python3-%{srcname} +%files -n python3-%{srcname} -f %{pyproject_files} %doc CONTRIBUTORS.txt RELEASE.txt %license LICENSE.txt -%{python3_sitearch}/skimage -%{python3_sitearch}/scikit_image-*.egg-info - -%files -n %{srcname}-tools -%{_bindir}/skivi %changelog +* Sat Jun 03 2023 Orion Poplawski - 0.21.0-1 +- Update to 0.21.0 +- Use SPDX License +- Enable tests +- skivi was removed in 0.20.0, so dropped the scikit-image-tools package + * Sat Jun 03 2023 Orion Poplawski - 0.19.3-1 - Update to 0.19.3 diff --git a/sources b/sources index 68415ce..9751e35 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ -SHA512 (scikit-image-0.19.3.tar.gz) = cda1699200e19155da13e313eb129771b7bb895913e552b959a3374267fe4f73c33d5e6e2fa2d49326903c901925797e46b9f05342a78c5332df1c266d37471a +SHA512 (scikit-image-0.21.0.tar.gz) = 3d289050e0d1c6a24f8625be8bf553ad29714d5265e485e42eae0b958c1d013bfda17d6565d2ad22ae258fea3d8d0a50379573bacf23128303d30ddd4a25cba1 +SHA512 (scikit-image-data.tar.xz) = cbf61d09ed0a34f8f8360ff42f23f25da41e863db7da178891230bea826cf632fda789707d6adee04aff889ae4d29a068c87a78c9da9544a511cd60f32d670e9