You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
python-hatch-vcs/python-hatch-vcs.spec

76 lines
1.6 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# Lets try to build this as early as we can, since its a dependency for
# some important libraries, such as python-platformdirs.
%bcond bootstrap 0
%bcond tests %{without bootstrap}
Name: python-hatch-vcs
Version: 0.4.0
Release: %autorelease
Summary: Hatch plugin for versioning with your preferred VCS
# SPDX
License: MIT
URL: https://github.com/ofek/hatch-vcs
Source: %{pypi_source hatch_vcs}
BuildArch: noarch
BuildRequires: python3-devel
%if %{with tests}
BuildRequires: python3dist(pytest)
BuildRequires: git-core
%endif
%global common_description %{expand:
This provides a plugin for Hatch that uses your preferred version control
system (like Git) to determine project versions.}
%description %{common_description}
%package -n python3-hatch-vcs
Summary: %{summary}
%description -n python3-hatch-vcs %{common_description}
%prep
%autosetup -n hatch_vcs-%{version}
# EPEL9-specific: allow python-setuptools_scm 6.0.1
sed -r -i 's/(setuptools-scm>=6\.)4\.0/\10\.1/' pyproject.toml
%generate_buildrequires
%pyproject_buildrequires
%build
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files hatch_vcs
%check
%if %{with tests}
# EPEL9: This test fails with setuptools-scm < 6.4.0. Upstream assumes that
# happens only for Python 2 (and skips the test accordingly), but we have
# allowed setuptools-scm 6.0.1 on Python 3 as well.
k="${k-}${k+ and }not test_fallback"
%pytest -k "${k-}"
%else
%pyproject_check_import
%endif
%files -n python3-hatch-vcs -f %{pyproject_files}
%doc HISTORY.md
%doc README.md
%changelog
%autochangelog