File python-pynose.spec of Package python-pynose

%{?vortex_header}%{!?vortex_header:%global vortex_pkg vortex-2024-07}

%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:        LGPL-2.1
URL:            %forgeurl
Source:         %forgesource

BuildArch:      noarch
BuildRequires:  help2man
BuildRequires:  %{vortex_pkg}-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 %{vortex_pkg}-python3-%{pypi_name}
Summary:        %{summary}
# `pynose` provides `nose` and uses the same namespace
Conflicts:      %{vortex_pkg}-python3-nose
# Some packages depending on `nose` rely on it providing `setuptools`
Requires:       %{vortex_pkg}-python3-setuptools

%description -n %{vortex_pkg}-python3-%{pypi_name} %_description


%prep
%forgeautosetup -p1


%generate_buildrequires
%pyproject_buildrequires


%build
%pyproject_wheel


%install
%pyproject_install
%pyproject_save_files -l nose

# 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 %{vortex_pkg}-python3-%{pypi_name} -f %{pyproject_files}
%doc README.*
%{_bindir}/nosetests*
%{_bindir}/pynose
%{_mandir}/man1/nosetests*.1*
%{_mandir}/man1/pynose.1*


%changelog
%autochangelog
openSUSE Build Service is sponsored by