File python-mock.spec of Package python-mock

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

%bcond_without tests

Name:           python-mock
Version:        4.0.3
Release:        %autorelease
Summary:        Deprecated, use unittest.mock from the standard library instead

License:        BSD-2-Clause
URL:            https://github.com/testing-cabal/mock
Source0:        %{url}/archive/%{version}/mock-%{version}.tar.gz

# Fix tests that should test mock but were testing unittest.mock
# Merged upstream
Patch1:         %{url}/commit/f3e3d82aab.patch

BuildArch:      noarch

BuildRequires:  %{vortex_pkg}-python3-devel
BuildRequires:  %{vortex_pkg}-python3-setuptools
%if %{with tests}
BuildRequires:  %{vortex_pkg}-python3-pytest
BuildRequires:  %{vortex_pkg}-python3-six
%endif


%description
This is a deprecated package.

The mock module is now part of the Python standard library,
available as unittest.mock in Python 3.3 onwards.

https://fedoraproject.org/wiki/Changes/DeprecatePythonMock


%package -n %{vortex_pkg}-python3-mock
Summary:        %{summary}

# This package is deprecated, no new packages in Fedora can depend on it
# https://fedoraproject.org/wiki/Changes/DeprecatePythonMock
Provides:       deprecated()

%description -n %{vortex_pkg}-python3-mock
This is a deprecated package.

The mock module is now part of the Python standard library,
available as unittest.mock in Python 3.3 onwards.

https://fedoraproject.org/wiki/Changes/DeprecatePythonMock


%prep
%autosetup -p1 -n mock-%{version}


%build
%py3_build


%if %{with tests}
%check
%pytest
%endif

%install
%py3_install


%files -n %{vortex_pkg}-python3-mock
%license LICENSE.txt
%doc README.rst
%{python3_sitelib}/*.egg-info/
%{python3_sitelib}/mock/


%changelog
%autochangelog
openSUSE Build Service is sponsored by