From 24b51937b65c4d2971bbed7dff4901bef1ed7b4c Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Sun, 13 Jul 2025 21:19:20 +0800 Subject: [PATCH] fix test usage --- python-graphviz.spec | 54 ++++++++++++++++++-------------------------- 1 file changed, 22 insertions(+), 32 deletions(-) diff --git a/python-graphviz.spec b/python-graphviz.spec index acc5520..1c29f75 100644 --- a/python-graphviz.spec +++ b/python-graphviz.spec @@ -1,7 +1,6 @@ -%global _empty_manifest_terminate_build 0 Name: python-graphviz Version: 0.20.3 -Release: 1 +Release: 2 Summary: Simple Python interface for Graphviz License: MIT URL: https://github.com/xflr6/graphviz @@ -17,6 +16,9 @@ Summary: Simple Python interface for Graphviz Provides: python-graphviz BuildRequires: python3-devel BuildRequires: python3-setuptools +BuildRequires: python3-pytest +BuildRequires: python3-pytest-mock +BuildRequires: python3-pytest-cov Requires: python3-tox Requires: python3-flake8 Requires: python3-wheel @@ -47,42 +49,30 @@ the DOT language which from the Python Graphviz graph drawing software. %install %py3_install -install -d -m755 %{buildroot}/%{_pkgdocdir} -if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi -if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi -if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi -if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi -pushd %{buildroot} -if [ -d usr/lib ]; then - find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst -fi -if [ -d usr/lib64 ]; then - find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst -fi -if [ -d usr/bin ]; then - find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst -fi -if [ -d usr/sbin ]; then - find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst -fi -touch doclist.lst -if [ -d usr/share/man ]; then - find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst -fi -popd -mv %{buildroot}/filelist.lst . -mv %{buildroot}/doclist.lst . %check -%{__python3} setup.py test +cat tests/backend/conftest.py >> tests/conftest.py +rm tests/backend/conftest.py -%files -n python3-graphviz -f filelist.lst -%dir %{python3_sitelib}/* +PYTHONPATH="${PYTHONPATH:-%{buildroot}%{python3_sitearch}:%{buildroot}%{python3_sitelib}}" \ +%{_bindir}/pytest --skip-exe \ + --only-exe \ + --collect-only \ + --verbose \ + --pdb \ + --exitfirst \ + --doctest-report none -%files help -f doclist.lst -%{_docdir}/* +%files -n python3-graphviz +%{python3_sitelib}/* + +%files help +%doc docs examples %changelog +* Sun Jul 13 2025 Funda Wang - 0.20.3-2 +- fix test usage + * Mon Aug 12 2024 yaoxin - 0.20.3-1 - Update to 0.20.3: * Drop Python 3.7 support (end of life 27 Jun 2023). -- Gitee