## START: Set by rpmautospec ## (rpmautospec version 0.3.0) %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 3; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # We should package a commit corresponding to a release tag unless there is a # compelling reason to do otherwise. Normally this would mean referencing the # tag corresponding to the packaged version. However, packaging as a snapshot # ensures that we never forget to update the commit hash, which is used to # build the colorcet/.version file (imitating the upstream PyPI release # process). %global pypi_version 3.0.1 %global commit 809e2919d86241948b743fea741501f31674805a %global snapdate 20221003 %global shortcommit %(echo '%{commit}' | cut -b -7) Name: python-colorcet Version: %{pypi_version}^%{snapdate}git%{shortcommit} Release: %autorelease Summary: Collection of perceptually uniform colormaps License: CC-BY-4.0 URL: https://github.com/holoviz/colorcet # The PyPI archive lacks the Sphinx documentation sources, but since this # documentation requires nbsite (which is not packaged) and specifically # targets HTML output (which will not be suitable for packaging—see # https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion), we have # no use for the documentation anyway. # # It also lacks the file tox.ini for testing, but we need to skip linting and # tests with dependency issues, so we don’t use it anyway. # # It also lacks the baseline images for testing with pytest-mpl: that is enough # to convince us to switch to the GitHub archive. Source0: %{url}/archive/%{commit}/colorcet-%{commit}.tar.gz BuildArch: noarch # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} BuildRequires: python3-devel # Strictly speaking, the build dependency on pyct should include its [build] # extra; see https://github.com/holoviz/colorcet/pull/76. BuildRequires: %{py3_dist pyct[build]} %global common_description %{expand: Colorcet is a collection of perceptually uniform colormaps for use with Python plotting programs like bokeh, matplotlib, holoviews, and datashader based on the set of perceptually uniform colormaps created by Peter Kovesi at the Center for Exploration Targeting.} %description %{common_description} %package -n python3-colorcet Summary: %{summary} %description -n python3-colorcet %{common_description} # We don’t create a metapackage for the “all” extra because it includes several # extras (“tests”, “tests_extra”, “doc”, “build”) that are only suitable for # development. Only the “examples” extra really makes sense for packaging. %pyproject_extras_subpkg -n python3-colorcet examples %prep %autosetup -n colorcet-%{commit} # nbsmoke is not packaged, so we cannot run tests that use it sed -r -i '/\bnbsmoke\b/d' setup.py # holoviews is not packaged, so we cannot run examples that use it sed -r -i '/\bholoviews\b/d' setup.py # Don’t pull in dependencies for linting, PyPI uploading, or coverage analysis. sed -r -i '/\b(flake8|pytest-cov)\b/d' setup.py # Imitate the PyPI release process. cat > colorcet/.version <<'EOF' {"git_describe": "v%{pypi_version}-0-g%{shortcommit}", "version_string": "%{pypi_version}"} EOF %generate_buildrequires # We want the “all” extra minus the “doc” extra: %pyproject_buildrequires -x tests,examples,tests_extra,build %build %pyproject_wheel # Sphinx-generated HTML documentation is not suitable for packaging; see # https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion. # Since the documentation uses nbsite, which explicitly targets HTML, it’s # unlikely we could package satisfactory and guideline-compliant documentation # even if python3dist(nbsite) were packaged. %install %pyproject_install %pyproject_save_files colorcet # The command-line tool is not particularly useful, as it only copies examples # from one place to another. The other commands from pyct, which are supposed # to fetch data, aren’t set up to do anything useful. We choose not to package # it. If there is some need for it in the future, see # https://github.com/holoviz/colorcet/pull/76. rm -vf '%{buildroot}%{_bindir}/colorcet' %check # Based loosely on https://github.com/holoviz/colorcet/raw/v%%{pypi_version}/tox.ini # commands: unit %pytest colorcet # commands: unit_extra # Test the repository in the source tree so that tests have baseline images: PYTHONPATH="${PWD}" %pytest colorcet --mpl colorcet/tests # We cannot run the “examples” test command because nbsmoke is not packaged. %files -n python3-colorcet -f %{pyproject_files} %license LICENSE.txt %doc README.md %changelog * Fri Jan 20 2023 Fedora Release Engineering 3.0.1^20221003git809e291-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Mon Dec 19 2022 Elliott Sales de Andrade 3.0.1^20221003git809e291-2 - Drop support for i686 * Thu Oct 06 2022 Benjamin A. Beasley 3.0.1^20221003git809e291-1 - Update to 3.0.1 (close RHBZ#2131804) * Thu Oct 06 2022 Benjamin A. Beasley 3.0.0^20211128git39af94a-4 - Update License to SPDX * Fri Jul 22 2022 Fedora Release Engineering 3.0.0^20211128git39af94a-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Mon Jun 20 2022 Python Maint 3.0.0^20211128git39af94a-2 - Rebuilt for Python 3.11 * Wed Apr 20 2022 Benjamin A. Beasley 3.0.0^20211128git39af94a-1 - Drop “forge” macros and use “modern” snapshot versioning * Fri Jan 21 2022 Fedora Release Engineering 3.0.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Tue Dec 28 2021 Benjamin A. Beasley 3.0.0-1 - Initial package (close RHBZ#2022153)