## 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 # Sphinx-generated HTML documentation is not suitable for packaging; see # https://bugzilla.redhat.com/show_bug.cgi?id=2006555 for discussion. # # We can generate PDF documentation as a substitute. %bcond_without doc_pdf # Upstream has vendored six in 33f5dd4f4ddc6d1f1b138c5358b4f4ed6eab125c; see: # https://github.com/nose-devs/nose2/commit/33f5dd4f4ddc6d1f1b138c5358b4f4ed6eab125c # We have de-vendored six downstream. %bcond_with vendored_six Name: python-nose2 Version: 0.12.0 Release: %autorelease Summary: The successor to nose, based on unittest2 # The entire source is BSD-2-Clause, except that unspecified portions are # derived from unittest2: # Portions derived from unittest2. unittest2 is Copyright (c) 2001-2012 # Python Software Foundation; All Rights Reserved. See: # http://docs.python.org/license.html # Research indicates unittest2 was distributed under a BSD-3-Clause license, # the text of which is included for the time being as an additional source # file. Upstream has been asked to clarify the situation and include the actual # license text: # https://github.com/nose-devs/nose2/issues/553 License: BSD-2-Clause AND BSD-3-Clause URL: https://nose2.io/ %global forgeurl https://github.com/nose-devs/nose2 Source0: %{forgeurl}/archive/%{version}/nose2-%{version}.tar.gz # Man page written for Fedora in groff_man(7) format based on --help output Source1: nose2.1 # We believe this to be the correct license text for unittest2; see the comment # above the License field. Source2: LICENSE-unittest2 # Keep the tox config from pulling in the dev extra. This makes sense upstream # (so the patch is not offered there), but for us it brings in unwanted # dependencies like coverage and linter tools, the Sphinx HTML theme and the # sphinx-issues package used for upstream changelog management, and the # deprecated PyPI “mock” package (which is not actually needed for the tests on # modern Python versions). Patch: nose2-0.11.0-tox-no-dev-extra.patch # Minor fixes regarding __version__ move # # Docs in conf.py and the CI build used `_version.py`, and just need # minor updates. # # https://github.com/nose-devs/nose2/commit/fc3d69290462930bc0fa81cb69bc4c6e15f8ae66 Patch: %{forgeurl}/commit/fc3d69290462930bc0fa81cb69bc4c6e15f8ae66.patch BuildArch: noarch BuildRequires: python3-devel BuildRequires: hardlink %if %{without vendored_six} BuildRequires: python3dist(six) %endif %if %{with doc_pdf} BuildRequires: make BuildRequires: python3-sphinx-latex BuildRequires: latexmk # This is in the “dev” extra as defined in setup.py, but we do not use it to # generate BuildRequires because we would have to patch out unwanted # dependencies like mock, coverage, and the HTML theme. BuildRequires: python3dist(sphinx) # Note that sphinx-issues is used upstream for changelog management but is not # required at build time. %endif %global common_description %{expand: nose2 is the successor to nose. It’s unittest with plugins. nose2’s purpose is to extend unittest to make testing nicer and easier to understand.} %description %{common_description} %package -n python3-nose2 Summary: Next generation of nicer testing for Python %if %{without vendored_six} # We have de-vendored six downstream. Requires: python3dist(six) %else Provides: bundled(python3dist(six)) = 1.16 %endif %description -n python3-nose2 %{common_description} %package doc Summary: Documentation for %{name} %description doc %{common_description} %pyproject_extras_subpkg -n python3-nose2 coverage_plugin %prep %autosetup -n nose2-%{version} -p1 cp -p '%{SOURCE2}' . # Patch out unnecessary documentation dependency on sphinx-issues, used # upstream for changelog generation. sed -r -i '/"sphinx_issues",/d' docs/conf.py %if %{without vendored_six} cat > nose2/_vendor/six.py <<'EOF' # This vendored copy of https://pypi.org/project/six/ has been replaced with a # trivial wrapper around the system copy. from six import * EOF %endif %generate_buildrequires %pyproject_buildrequires -t %build %pyproject_wheel %if %{with doc_pdf} PYTHONPATH="${PWD}" %make_build -C docs latex SPHINXOPTS='%{?_smp_mflags}' %make_build -C docs/_build/latex LATEXMKOPTS='-quiet' %endif %install %pyproject_install %pyproject_save_files nose2 hardlink -v '%{buildroot}%{_bindir}' install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 '%{SOURCE1}' %check %tox -e %{toxenv}-nocov %files -n python3-nose2 -f %{pyproject_files} %license license.txt LICENSE-unittest2 %doc AUTHORS %doc README.rst %{_bindir}/nose2 %{_mandir}/man1/nose2.1* %files doc %license license.txt LICENSE-unittest2 %doc AUTHORS %doc README.rst %doc docs/changelog.rst %doc contributing.rst %if %{with doc_pdf} %doc docs/_build/latex/nose2.pdf %endif %changelog * Fri Jan 20 2023 Fedora Release Engineering 0.12.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Thu Nov 24 2022 Benjamin A. Beasley 0.12.0-2 - Update License to SPDX * Sat Jul 23 2022 Benjamin A. Beasley 0.12.0-1 - Update to 0.12.0 (close RHBZ#2107926) - The nose2-%%%%{python3_version} command, e.g. nose2-3.11, is removed. - De-vendor six, which upstream has vendored. * Fri Jul 22 2022 Fedora Release Engineering 0.11.0-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Thu Jul 07 2022 Benjamin A. Beasley 0.11.0-10 - Fix extra newline in description * Mon Jun 13 2022 Python Maint 0.11.0-9 - Rebuilt for Python 3.11 * Wed Jun 08 2022 Benjamin A. Beasley 0.11.0-8 - Small typo fix in the man page * Mon Jun 06 2022 Benjamin A. Beasley 0.11.0-7 - A few dependency fixes - Drop versioning on sphinx dependency (matching backported commit fb770f4) - Drop spurious sphinx-issues BR - Stop generating unwanted BR’s from the “dev” extra via tox * Sun Jun 05 2022 Benjamin A. Beasley 0.11.0-6 - Add a man page * Sun Jun 05 2022 Benjamin A. Beasley 0.11.0-5 - Build Sphinx documentation as a PDF - Package from the GitHub archive instead of the PyPI sdist - Add a -doc subpackage - Use tox for running tests * Sun Jun 05 2022 Benjamin A. Beasley 0.11.0-4 - Port to pyproject-rpm-macros - Add metapackage for coverage_plugin extra - Update upstream URL - Hardlink identical entry point scripts * Mon May 16 2022 Tomáš Hrnčiar - 0.11.0-1 - Update to 0.11.0 * Fri Jan 21 2022 Fedora Release Engineering - 0.9.1-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild * Fri Jul 23 2021 Fedora Release Engineering - 0.9.1-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild * Wed Jun 02 2021 Python Maint - 0.9.1-6 - Rebuilt for Python 3.10 * Wed Jan 27 2021 Fedora Release Engineering - 0.9.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild * Wed Jul 29 2020 Fedora Release Engineering - 0.9.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild * Fri May 22 2020 Miro Hrončok - 0.9.1-3 - Rebuilt for Python 3.9 * Thu Jan 30 2020 Fedora Release Engineering - 0.9.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild * Tue Oct 01 2019 Aurelien Bompard - 0.9.1-1 - Version 0.9.1 * Sat Aug 17 2019 Miro Hrončok - 0.7.4-6 - Rebuilt for Python 3.8 * Fri Jul 26 2019 Fedora Release Engineering - 0.7.4-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild * Sat Feb 02 2019 Fedora Release Engineering - 0.7.4-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild * Sun Oct 21 2018 Miro Hrončok - 0.7.4-3 - Drop python2 subpackage https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal * Sat Jul 14 2018 Fedora Release Engineering - 0.7.4-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild * Fri Jun 29 2018 Miro Hrončok - 0.7.4-1 - Update to 0.7.4 (#1509750), fixes FTBFS (#1556222) * Tue Jun 19 2018 Miro Hrončok - 0.6.5-8 - Rebuilt for Python 3.7 * Mon Mar 26 2018 Iryna Shcherbina - 0.6.5-7 - Update Python 2 dependency declarations to new packaging standards (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3) * Fri Feb 09 2018 Fedora Release Engineering - 0.6.5-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild * Thu Jul 27 2017 Fedora Release Engineering - 0.6.5-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild * Sat Jun 10 2017 Aurelien Bompard - 0.6.5-4 - Rename a BuildRequires * Sat Feb 11 2017 Fedora Release Engineering - 0.6.5-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild * Mon Dec 19 2016 Miro Hrončok - 0.6.5-2 - Rebuild for Python 3.6 * Tue Sep 13 2016 Aurelien Bompard - 0.6.5-1 - Initial package.