# Bootstrap mode is needed to break circular dependency with setuptools-scm: # - vcs-versioning tests require setuptools_scm # - setuptools_scm >= 10 requires vcs-versioning # - pytest itself also requires setuptools_scm # When bootstrapping, we cannot run tests at all. %bcond bootstrap 1 %bcond tests %{without bootstrap} Name: python-vcs-versioning Version: 1.1.1 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 %if %{with tests} BuildRequires: /usr/bin/git %if %{undefined rhel} BuildRequires: /usr/bin/hg %endif # some tests relies on setuptools-scm for file finder entry points # https://github.com/pypa/setuptools-scm/issues/1353 BuildRequires: python3-setuptools_scm >= 10 %endif BuildSystem: pyproject BuildOption(generate_buildrequires): -g test BuildOption(install): -l vcs_versioning %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 -a # Remove unwanted test dependencies (coverage not needed, pytest-xdist not in RHEL) sed -i -e '/pytest-cov/d' %{?rhel:-e '/pytest-xdist/d'} pyproject.toml %package -n python3-vcs-versioning Summary: %{summary} %description -n python3-vcs-versioning %_description %if %{with tests} %check -a %pytest -v %{!?rhel:-n auto} %endif %files -n python3-vcs-versioning -f %{pyproject_files} %doc README.md %{_bindir}/vcs-versioning %changelog %autochangelog