%global python3_pkgversion 3.11 %bcond tests 0 Name: python-rfc3339-validator Version: 0.1.4 Release: 2.ac17.py3.11%{?dist} Summary: Pure python RFC3339 validator # SPDX License: MIT URL: https://github.com/naimetti/rfc3339-validator Source: %{pypi_source rfc3339_validator} BuildArch: noarch # Drop the pytest-runner test dependency and “setup.py test” support # https://github.com/naimetti/rfc3339-validator/pull/7 # # Fixes: # # Consider dropping the pytest-runner test dependency # https://github.com/naimetti/rfc3339-validator/issues/6 # # See also the deprecation notice at https://pypi.org/project/pytest-runner/. # # This version of the patch has been modified to apply to the PyPI sdist, which # does not contain requirements_dev.txt; see: # # Include files for tox testing in the sdist # https://github.com/naimetti/rfc3339-validator/pull/8 Patch: rfc3339-validator-0.1.4-drop-pytest-runner.patch BuildRequires: python%{python3_pkgversion}-devel %if %{with tests} # We use manual BR’s rather than generating dependencies from tox (which uses # requirements_dev.txt) because dependencies there are pinned to exact versions # and most of them are linter, coverage, and other tools that we would need to # patch out. BuildRequires: python%{python3_pkgversion}dist(pytest) BuildRequires: python%{python3_pkgversion}dist(hypothesis) BuildRequires: python%{python3_pkgversion}dist(strict-rfc3339) %endif %global common_description %{expand: A pure python RFC3339 validator.} %description %{common_description} %package -n python%{python3_pkgversion}-rfc3339-validator Summary: %{summary} %description -n python%{python3_pkgversion}-rfc3339-validator %{common_description} %prep %autosetup -n rfc3339_validator-%{version} %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files rfc3339_validator %check %if %{with tests} %pytest %else %pyproject_check_import %endif 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}-rfc3339-validator -f %{pyproject_files} %doc CONTRIBUTING.rst %doc HISTORY.rst %doc README.md %changelog * Fri May 24 2024 Ding-Yi Chen - 0.1.4-2.ac17.py3.11 - Cut corner packaging