## START: Set by rpmautospec ## (rpmautospec version 0.6.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 4; 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 %global pypi_name pynose %global forgeurl https://github.com/mdmintz/pynose Name: python-%{pypi_name} Version: 1.5.1 Release: %{autorelease} Summary: pynose fixes nose to extend unittest and make testing easier 🐍 👃 %forgemeta # SPDX License: MIT URL: %forgeurl Source: %forgesource BuildArch: noarch BuildRequires: help2man BuildRequires: python3-devel %global _description %{expand: pynose is an updated version of nose, originally made by Jason Pellerin. This version of nose is compatible with Python 3.7+ (including 3.13+). Changes in pynose from legacy nose include: - Fixes "AttributeError: module 'collections' has no attribute 'Callable'." - Fixes "AttributeError: module 'inspect' has no attribute 'getargspec'." - Fixes "ImportError: cannot import name '_TextTestResult' from 'unittest'." - Fixes "RuntimeWarning: TestResult has no addDuration method." - Fixes "DeprecationWarning: pkg_resources is deprecated as an API." - Fixes all flake8 issues from the original nose. - Replaces the imp module with the newer importlib module. - The default logging level now hides "INFO" logs for less noise. - Adds --capture-logs for hiding output from all logging levels. - Adds --logging-init to use logging.basicConfig(level). - The -s option is always active to see the output of print(). - Adds --capture-output for hiding the output of print(). - Adds --co as a shortcut to using --collect-only.} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} # Make this package a drop-in replacement for old `nose` %py_provides python3-nose Obsoletes: python3-nose < 1.3.8 Requires: python3-setuptools %description -n python3-%{pypi_name} %_description %prep %forgeautosetup -p1 %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel # Since `pynose` is using the same module namespace as old `nose` it # can be used as a drop-in replacement. Provide the required meta data. %global nose_distinfo nose-%{version}.dist-info mkdir %{nose_distinfo} cat > %{nose_distinfo}/METADATA << EOF Metadata-Version: 2.1 Name: nose Version: %{version} EOF echo rpm > %{nose_distinfo}/INSTALLER %install %pyproject_install %pyproject_save_files -l nose cp -a %{nose_distinfo} %{buildroot}%{python3_sitelib} # Provide binaries provided by python3-nose for compatability mv %{buildroot}%{_bindir}/nosetests{,-%{python3_version}} ln -sf nosetests-%{python3_version} %{buildroot}%{_bindir}/nosetests-3 ln -sf nosetests-3 %{buildroot}%{_bindir}/nosetests # Create man pages mkdir man %{py3_test_envvars} help2man --section 1 --no-discard-stderr \ --no-info --output man/%{pypi_name}.1 %{pypi_name} %{py3_test_envvars} help2man --section 1 --no-discard-stderr \ --no-info --output man/nosetests-%{python3_version}.1 nosetests mkdir -p %{buildroot}%{_mandir}/man1 install -m 0644 man/*.1 %{buildroot}%{_mandir}/man1 ln -sf nosetests-%{python3_version}.1 %{buildroot}%{_mandir}/man1/nosetests-3.1 ln -sf nosetests-3.1 %{buildroot}%{_mandir}/man1/nosetests.1 %check # Package doesn't provide any tests %pyproject_check_import %files -n python3-%{pypi_name} -f %{pyproject_files} %doc README.* %{_bindir}/nosetests* %{_bindir}/pynose %{_mandir}/man1/nosetests*.1* %{_mandir}/man1/pynose.1* %{python3_sitelib}/%{nose_distinfo}/ %changelog ## START: Generated by rpmautospec * Thu Apr 11 2024 Sandro - 1.5.1-4 - Requires setuptools * Wed Apr 10 2024 Sandro - 1.5.1-3 - Add additional Provides: and meta data for nose * Tue Apr 09 2024 Sandro - 1.5.1-2 - Add compatability binaries and man pages * Tue Apr 09 2024 Sandro - 1.5.1-1 - Initial package ## END: Generated by rpmautospec