%global python3_pkgversion 3.11 Name: python%{python3_pkgversion}-hatchling-epel Version: 1.17.1 Release: %autorelease Summary: The build backend used by Hatch # SPDX License: MIT URL: https://pypi.org/project/hatchling Source0: %{pypi_source hatchling} # Written for Fedora in groff_man(7) format based on --help output Source100: hatchling.1 Source200: hatchling-build.1 Source300: hatchling-dep.1 Source310: hatchling-dep-synced.1 Source400: hatchling-metadata.1 Source500: hatchling-version.1 BuildArch: noarch BuildRequires: python%{python3_pkgversion}-devel # Yes, we're intentionally depending on an old version, # as python3.11-rpm-macros has a broken %%py3_check_import. # See https://bugzilla.redhat.com/2207631. BuildRequires: python39-rpm-macros BuildRequires: %{py3_dist editables} >= 0.3 BuildRequires: %{py3_dist packaging} >= 21.3 BuildRequires: %{py3_dist pathspec} >= 0.10.1 BuildRequires: %{py3_dist pluggy} >= 1.0.0 BuildRequires: %{py3_dist trove_classifiers} # For %%py3_install_wheel BuildRequires: %{py3_dist pip} %global common_description %{expand: This is the extensible, standards compliant build backend used by Hatch.} %description %{common_description} %package -n python%{python3_pkgversion}-hatchling Summary: %{summary} %description -n python%{python3_pkgversion}-hatchling %{common_description} %prep %autosetup -n hatchling-%{version} # Remove conditional deps due to RHEL 8's deficient dependency generator that # ignores environment specifiers. # See https://bugzilla.redhat.com/2211705. sed -i \ -e '/"importlib-metadata;/d' \ -e '/"tomli/d' \ pyproject.toml %build export PYTHONPATH="$(pwd)/src" %python3 -c 'from hatchling.build import build_wheel; build_wheel("dist")' %install %py3_install_wheel hatchling-%{version}-py3-none-any.whl DISTINFO=%{buildroot}%{python3_sitelib}/hatchling-%{version}.dist-info rm -rv "${DISTINFO}/RECORD" "${DISTINFO}/REQUESTED" echo rpm >"${DISTINFO}/INSTALLER" install -t '%{buildroot}%{_mandir}/man1' -D -p -m 0644 \ '%{SOURCE100}' \ '%{SOURCE200}' \ '%{SOURCE300}' '%{SOURCE310}' \ '%{SOURCE400}' \ '%{SOURCE500}' %check # It’s not yet clear how, or if, we can run the upstream tests. # https://github.com/pypa/hatch/issues/120 ( cd src/ modules="$(find -type f -name '*.py' -printf '%%P\n' | grep -v __ | sed -e 's|/|.|g' -e 's|\.py$||')" %py3_check_import "${modules}" ) %files -n python%{python3_pkgversion}-hatchling %doc README.md %{_bindir}/hatchling %{_mandir}/man1/hatchling.1* %{_mandir}/man1/hatchling-*.1* %{python3_sitelib}/hatchling/ %{python3_sitelib}/hatchling-%{version}.dist-info/ %changelog %autochangelog