%global python3_pkgversion 3.15 # Bootstrap mode is needed to break circular dependency with setuptools-scm: # - setuptools_scm >= 10 requires vcs-versioning # - pytest itself also requires setuptools_scm # When bootstrapping, we cannot run tests at all. %bcond bootstrap 0 %bcond tests %{without bootstrap} Name: python%{python3_pkgversion}-vcs-versioning Version: 2.3.0 Release: %autorelease Summary: The blessed package to manage your versions by vcs metadata License: MIT URL: https://github.com/pypa/setuptools-scm Source: %{pypi_source vcs_versioning} BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-packaging BuildRequires: pyproject-rpm-macros %if %{with tests} BuildRequires: python%{python3_pkgversion}-pytest BuildRequires: /usr/bin/git %if %{undefined rhel} BuildRequires: /usr/bin/hg %endif %endif %global _description %{expand: This package extracts project version information from version control system (VCS) metadata, eliminating the need to manually maintain version numbers in multiple places. It automatically derives versions from VCS tags and commit history.} %description %_description %prep %autosetup -p1 -n vcs_versioning-%{version} # Remove unwanted test dependencies (coverage not needed, # pytest-timeout and pytest-xdist not in RHEL) %pyproject_patch_dependency pytest-cov:ignore %if %{defined rhel} %pyproject_patch_dependency pytest-timeout:ignore %pyproject_patch_dependency pytest-xdist:ignore sed -i -e '/^timeout *=/d' pyproject.toml %endif %generate_buildrequires %pyproject_buildrequires %{?with_tests:-x test} %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l vcs_versioning %if %{with tests} %check %pytest -v %{!?rhel:-n auto} %else %pyproject_check_import -e '*.test_api' %endif %files -n python%{python3_pkgversion}-vcs-versioning -f %{pyproject_files} %doc README.md %{_bindir}/vcs-versioning %changelog %autochangelog