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-hatchling/python-hatchling.spec

85 lines
2.3 KiB

3 years ago
Name: python-hatchling
Version: 0.25.0
3 years ago
Release: %autorelease
Summary: The build backend used by Hatch
License: MIT
URL: https://pypi.org/project/hatchling
Source0: %{pypi_source hatchling}
# Man page in groff_man(7) format, hand-written for Fedora based on package
# metadata and --help output
3 years ago
Source1: hatchling.1
BuildArch: noarch
BuildRequires: python3-devel
%global common_description %{expand:
This is the extensible, standards compliant build backend used by Hatch.}
%description %{common_description}
%package -n python3-hatchling
Summary: %{summary}
%description -n python3-hatchling %{common_description}
%prep
%autosetup -n hatchling-%{version}
3 years ago
# F35, EPEL9, and older:
# The changes between pluggy 0.13.1 and 1.0.0 should not be significant, so we
# loosen the minimum version.
sed -r -i 's/(pluggy>=)1\.0\.0/\10.13.1/' src/hatchling/ouroboros.py
# EPEL9:
# Since hatchling uses packaging 20.9 for Python 2, we hope and expect it can
# work for Python 3 as well.
sed -r -i 's/(packaging>=)21\.3/\120.9/' src/hatchling/ouroboros.py
3 years ago
%generate_buildrequires
# Cannot use -r (the default) with hatchling: “ValueError: build backend cannot
# provide build metadata (incl. runtime requirements) before build”. We work
# around this by writing the dependencies from src/hatchling/ourobororos.py
# into a text file.
PYTHONPATH="${PWD}/src" '%{python3}' <<EOF
from hatchling.ouroboros import CONFIG
deps = CONFIG['project']['dependencies']
with open('requirements.ouroboros.txt', 'w') as reqfile:
reqfile.writelines(f'{dep}\n' for dep in deps)
EOF
%pyproject_buildrequires -R requirements.ouroboros.txt
%build
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files hatchling
install -t '%{buildroot}/%{_mandir}/man1' -D -p -m 0644 '%{SOURCE1}'
3 years ago
%check
# Its not yet clear how, or if, we can run the upstream tests.
# https://github.com/ofek/hatch/issues/120
%pyproject_check_import
%files -n python3-hatchling -f %{pyproject_files}
# Workaround for RHBZ#1985340 required for pyproject-rpm-macros < 1.1.0.
3 years ago
%dir %{python3_sitelib}/hatchling-%{version}.dist-info/license_files
%license %{python3_sitelib}/hatchling-%{version}.dist-info/license_files/LICENSE.txt
%doc README.md
%{_bindir}/hatchling
%{_mandir}/man1/hatchling.1*
%changelog
%autochangelog