## START: Set by rpmautospec ## (rpmautospec version 0.3.5) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 6; 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 Name: python-pyct Version: 0.5.0 Release: %autorelease Summary: Python packaging Common Tasks # The entire source is BSD-3-Clause, except for pyct/cmd.py, which is # (BSD-3-Clause and ISC). License: BSD-3-Clause AND ISC URL: https://github.com/pyviz-dev/pyct # The PyPI archive lacks tox.ini, but it was not exactly suitable for testing # in the RPM build environment anyway, so we just re-created the needed tests # in %%check. # # Note that if we ever switch to the GitHub tarball we will need to re-create # the pyct/.version file that appears in the PyPI source tarball in order for # package versioning to work correctly. See the python-param package for an # example of this. Source0: %{pypi_source pyct} # Man pages written by hand for Fedora in groff_man(7) format using the # command’s --help output Source10: pyct.1 Source11: pyct-report.1 BuildArch: noarch # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} BuildRequires: python3-devel BuildRequires: python3dist(pytest) %global common_description %{expand: A utility package that includes: 1. pyct.cmd: Makes various commands available to other packages. (Currently no sophisticated plugin system, just a try import/except in the other packages.) The same commands are available from within python. Can either add new subcommands to an existing argparse based command if the module has an existing command, or create the entire command if the module has no existing command. Currently, there are commands for copying examples and fetching data. 2. pyct.build: Provides various commands to help package building, primarily as a convenience for project maintainers.} %description %{common_description} %package -n python3-pyct Summary: %{summary} # The file pyct/cmd.py contains a progress bar implementation copied (and # possibly slightly forked?) from an unknown version of # https://pypi.org/project/clint/. It doesn’t make sense to ask pyct’s upstream # to support using an external copy of clint, because clint appears to be # unmaintained upstream. Provides: bundled(python3dist(clint)) %description -n python3-pyct %{common_description} %pyproject_extras_subpkg -n python3-pyct build cmd %prep %autosetup -n pyct-%{version} -p1 # https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters sed -r -i '/\bflake8\b/d' setup.py # Remove shebangs from subcommand modules. These are executable in the source # tarball, but once installed in site-packages will no longer be executable and # should be executed indirectly, typically via the “pyct” command. The # find-then-modify pattern keeps us from discarding mtimes on sources that do # not need modification. find pyct -type f -exec \ gawk '/^#!/ { print FILENAME }; { nextfile }' '{}' '+' | xargs -r -t sed -r -i '1{/^#!/d}' %generate_buildrequires %pyproject_buildrequires -x build,cmd,tests %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 -l pyct install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 \ '%{SOURCE10}' '%{SOURCE11}' %check # Based loosely on https://github.com/pyviz-dev/pyct/raw/v%%{version}/tox.ini # _cmd_examples %pytest ( set -o errexit export %{py3_test_envvars} %{python3} -c "import pyct; pyct.report('pyct','python','system')" # _build_examples %{python3} -c "from pyct.build import examples, get_setup_version" # _unit # (no need to run pytest again!) pyct --help pyct --version pyct report --help pyct report pyct python %{python3} -m pyct --version ) %files -n python3-pyct -f %{pyproject_files} %doc README.md %{_bindir}/pyct %{_mandir}/man1/pyct.1* %{_mandir}/man1/pyct-*.1* %changelog * Mon Dec 18 2023 Benjamin A. Beasley - 0.5.0-6 - Assert that %%pyproject_files contains a license file * Thu Oct 12 2023 Benjamin A. Beasley - 0.5.0-5 - F38+: Use %%{py3_test_envvars} to run supplementary tests * Fri Jul 21 2023 Fedora Release Engineering - 0.5.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Tue Jun 13 2023 Python Maint - 0.5.0-3 - Rebuilt for Python 3.12 * Sat Jun 03 2023 Benjamin A. Beasley - 0.5.0-2 - Remove explicit %%set_build_flags, not needed since F36 * Thu Feb 02 2023 Benjamin A. Beasley - 0.5.0-1 - Update to 0.5.0 (close RHBZ#2165496) * Sat Jan 28 2023 Benjamin A. Beasley - 0.4.8-10 - Fix a test that was skipped on Python 3.11 * Fri Jan 20 2023 Fedora Release Engineering - 0.4.8-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Mon Dec 19 2022 Benjamin A. Beasley - 0.4.8-8 - Drop support for i686 * Sun Nov 27 2022 Benjamin A. Beasley - 0.4.8-7 - Update License to SPDX * Fri Jul 22 2022 Fedora Release Engineering - 0.4.8-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Mon Jun 20 2022 Benjamin A. Beasley - 0.4.8-5 - Skip a failing test on Python 3.11 (close RHBZ#2099064) * Tue Jun 14 2022 Python Maint - 0.4.8-4 - Rebuilt for Python 3.11 * Fri Apr 22 2022 Benjamin A. Beasley - 0.4.8-3 - Patch out flake8 linter BR * Fri Jan 21 2022 Fedora Release Engineering - 0.4.8-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Mon Nov 22 2021 Benjamin A. Beasley - 0.4.8-1 - Initial package