Initial package

This commit is contained in:
Benjamin A. Beasley 2022-02-20 11:17:55 -05:00
parent 57eba56f99
commit 80dbc86237
5 changed files with 118 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/hatchling-0.11.3.tar.gz

View File

@ -0,0 +1,12 @@
diff -Naur hatchling-0.11.0-original/src/hatchling/ouroboros.py hatchling-0.11.0/src/hatchling/ouroboros.py
--- hatchling-0.11.0-original/src/hatchling/ouroboros.py 2020-02-01 19:00:00.000000000 -0500
+++ hatchling-0.11.0/src/hatchling/ouroboros.py 2022-02-05 07:40:37.160670864 -0500
@@ -40,7 +40,7 @@
'pluggy~=1.0.0; python_version > "3"',
'pluggy~=0.13; python_version < "3"',
'toml~=0.10.2; python_version < "3"',
- 'tomli~=2.0.0; python_version > "3"',
+ 'tomli>=1.2.2; python_version > "3"',
],
'scripts': {'hatchling': 'hatchling.cli:hatchling'},
'dynamic': ['version'],

20
hatchling.1 Normal file
View File

@ -0,0 +1,20 @@
.TH HATCHLING "1" "February 2022" "" "User Commands"
.SH NAME
.B hatchling
\(en the build backend used by Hatch
.SH SYNOPSIS
.B hatchling
.RB [ \-h ]
.RB { build , dep }\ ...
.SH DESCRIPTION
This is the extensible, standards compliant build backend used by Hatch.
.SH OPTIONS
.SS "POSITIONAL\ ARGUMENTS"
.TP
.B build
.TP
.B dep
.SS "OPTIONAL\ ARGUMENTS"
.TP
.B \-h\fR,\ \fB\-\-help
show a help message and exit

84
python-hatchling.spec Normal file
View File

@ -0,0 +1,84 @@
Name: python-hatchling
Version: 0.11.3
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, written for Fedora based on package metadata
# and --help output
Source1: hatchling.1
# Based on https://github.com/hukkin/tomli/blob/2.0.0/CHANGELOG.md#200, we
# should be able to use tomli 1.2.2 until
# https://bugzilla.redhat.com/show_bug.cgi?id=2032020 is closed.
#
# It doesnt make sense to upstream this, as it really would be better to use a
# current release.
Patch: hatchling-0.11.0-allow-tomli-1.2.2.patch
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} -p1
cp -p '%{SOURCE1}' .
%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 hatchling.1
%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}
# The license file is installed in an unusual subdirectory:
%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

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (hatchling-0.11.3.tar.gz) = 65c6f638d6d395320acc1d19287adfcfad13883e79a9e3f0ee8114363f92cd9a1b2be04ad97a3ec304c326f2e1d8e950d3f3808e07d6506a660a227eb7d3ecfb