%global upstream_name pytest-randomly %global python3_pkgversion 3.11 Name: python-%{upstream_name} Version: 3.15.0 Release: 2.ac12.py3.11%{?dist} Summary: Pytest plugin to randomly order tests and control random.seed License: MIT URL: https://github.com/pytest-dev/pytest-randomly Source0: %{url}/archive/%{version}/%{upstream_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: pyproject-rpm-macros # Required for tests BuildRequires: python%{python3_pkgversion}dist(factory-boy) BuildRequires: python%{python3_pkgversion}dist(numpy) BuildRequires: python%{python3_pkgversion}dist(pytest-forked) BuildRequires: python%{python3_pkgversion}dist(pytest-xdist) %description %{summary}. %package -n python%{python3_pkgversion}-%{upstream_name} Summary: %{summary} %description -n python%{python3_pkgversion}-%{upstream_name} %{summary}. %prep %autosetup -p1 -n %{upstream_name}-%{version} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files pytest_randomly %check # Skip test_model_bakery to avoid new dependency on model_bakery #pytest -p no:randomly -k 'not test_it_runs_before_stepwise and not test_model_bakery' for b in $(find %{buildroot}%{_bindir}/ -type f) ; do mv "$b" $(sed -re "s|(.*)$|\1-%{python3_pkgversion}|"<<<"$b"); done for m in $(find %{buildroot}%{_mandir}/ -type f) ; do mv "$m" $(sed -re "s|(.*).([1-8])(.*)$|\1-%{python3_pkgversion}.\2\3|"<<<"$m"); done for m in $(find %{buildroot}%{_datadir}/locale/* -type f) ; do mv "$m" $(sed -re "s|(.*).mo$|\1-%{python3_pkgversion}.mo|"<<<"$m"); done for l in $(find %{buildroot}/usr/lib64/lib* -type f -o -type l) ; do mv "$l" $(sed -re "s|(.*).so(.*)$|\1-py%{python3_pkgversion}.so\2|"<<<"$l"); done for p in $(find %{buildroot}/usr/lib64/pkgconfig/* -type f) ; do mv "$p" $(sed -re "s|(.*).pc$|\1-py%{python3_pkgversion}.pc|"<<<"$p"); done %files -n python%{python3_pkgversion}-%{upstream_name} -f %{pyproject_files} %doc README.rst HISTORY.rst %license LICENSE %changelog * Mon Apr 15 2024 Ding-Yi Chen - 3.15.0-2.ac12.py3.11 - Cut corner packaging