2021-11-10 13:47:48 +00:00
#
# spec file for package python-hunter
#
2025-07-04 01:52:32 +00:00
# Copyright (c) 2025 SUSE LLC
2021-11-10 13:47:48 +00:00
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name : python-hunter
2025-07-23 10:53:38 +00:00
Version : 3.8.0
2021-11-10 13:47:48 +00:00
Release : 0
Summary : Pytest plugin for coverage reporting
License : BSD-2-Clause
URL : https://github.com/ionelmc/python-hunter
Source : https://files.pythonhosted.org/packages/source/h/hunter/hunter-%{version} .tar.gz
2025-07-04 01:52:32 +00:00
BuildRequires : %pythons
2021-11-10 13:47:48 +00:00
BuildRequires : %{python_module Cython}
2025-07-04 01:52:32 +00:00
BuildRequires : %{python_module aspectlib}
BuildRequires : %{python_module pip}
BuildRequires : %{python_module process-tests}
BuildRequires : %{python_module pytest-benchmark}
BuildRequires : %{python_module pytest}
BuildRequires : %{python_module py}
2021-11-10 13:47:48 +00:00
BuildRequires : %{python_module setuptools_scm}
2025-07-04 01:52:32 +00:00
BuildRequires : %{python_module six}
BuildRequires : %{python_module tzdata}
BuildRequires : %{python_module wheel}
2021-11-10 13:47:48 +00:00
BuildRequires : fdupes
BuildRequires : python-rpm-macros
2021-11-10 14:13:15 +00:00
Requires(post) : update-alternatives
2024-06-30 19:18:52 +00:00
Requires(postun) : update-alternatives
2021-11-10 13:47:48 +00:00
%python_subpackages
%description
Hunter is a flexible code tracing toolkit, not for measuring coverage,
2022-10-11 12:41:06 +00:00
but for debugging, logging, inspection and other nefarious purposes.
2021-11-10 13:47:48 +00:00
%prep
%autosetup -p1 -n hunter-%{version}
2025-07-04 01:52:32 +00:00
cat >src/build_tests.py <<EOF
from setuptools import setup
from Cython.Build import cythonize
setup(
name='Tests' ,
ext_modules=cythonize(" . . / t e s t s / * . p y x " ),
)
EOF
2021-11-10 13:47:48 +00:00
%build
2025-07-04 01:52:32 +00:00
%pyproject_wheel
export PYTHONDONTWRITEBYTECODE=1
pushd src
%python_exec build_tests.py build_ext
find . -name 'eviltracer.cpython-*-linux-gnu.so' -exec mv " { } " ../tests \;
find . -name 'sample5.cpython-*-linux-gnu.so' -exec mv " { } " ../tests \;
rm build_tests.py
popd
2021-11-10 13:47:48 +00:00
%install
2025-07-04 01:52:32 +00:00
%pyproject_install
%{python_expand \
rm -r %{buildroot} %{$python_sitearch}/build_tests.py %{buildroot} %{$python_sitearch}/__pycache__
%fdupes %{buildroot} %{$python_sitearch}/
}
2021-11-10 14:13:15 +00:00
%python_clone -a %{buildroot} %{_bindir} /hunter-trace
2021-11-10 13:47:48 +00:00
%check
2025-07-04 01:52:32 +00:00
export PYTHONPATH=tests
%pytest_arch -k 'not (test_pdb and (postmortem-ipdb or settrace-ipdb or debugger-ipdb) or test_fullsource_cython or test_source_cython or test_safe_repr or test_profile or test_errorsnooper)' --ignore tests/test_remote.py --ignore tests/test_integration.py
2021-11-10 13:47:48 +00:00
2021-11-10 14:13:15 +00:00
%post
%python_install_alternative hunter-trace
%postun
%python_uninstall_alternative hunter-trace
2021-11-10 13:47:48 +00:00
%files %{python_files}
2021-11-10 14:13:15 +00:00
%python_alternative %{_bindir} /hunter-trace
2021-11-10 13:47:48 +00:00
%license LICENSE
%doc AUTHORS.rst CHANGELOG.rst README.rst
2025-07-04 01:52:32 +00:00
%{python_sitearch} /hunter
%{python_sitearch} /hunter.pth
%{python_sitearch} /hunter-%{version} .dist-info
2021-11-10 13:47:48 +00:00
%changelog