Bug 2545833 - Review Request: python-frontmatter - Parse and manage posts with YAML (or other) frontmatter
Summary: Review Request: python-frontmatter - Parse and manage posts with YAML (or oth...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nobody's working on this, feel free to take it
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-10-05 08:32 UTC by Clement Verna
Modified: 2026-11-02 19:35 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Clement Verna 2026-10-05 08:32:56 UTC
Spec URL:   https://cverna.fedorapeople.org/rpms/python-frontmatter/python-frontmatter.spec
SRPM URL:   https://cverna.fedorapeople.org/rpms/python-frontmatter/python-frontmatter-1.3.0-1.fc46.src.rpm
rpmlint:    https://cverna.fedorapeople.org/rpms/python-frontmatter/rpmlint.txt
Source URL: https://github.com/eyeseast/python-frontmatter/archive/v1.3.0/python-frontmatter-1.3.0.tar.gz
            https://github.com/eyeseast/python-frontmatter

Fedora Account System Username: cverna

Package Name:    python-frontmatter
Version:         1.3.0
Release:         1%{?dist}
License:         MIT
URL:             https://github.com/eyeseast/python-frontmatter
BuildArch:       noarch
Binary RPM:      python3-frontmatter

Description:
Python library for parsing and managing documents with YAML front matter,
such as Markdown posts.
It exposes a simple API to load a file or a string, read and change its
metadata, and serialize it back.

Why it is being packaged:
python-frontmatter is a runtime dependency of lola (https://github.com/LobsterTrap/lola). It does not exist in Fedora today.

Source checksums (sha256):
c123bd29cd209343941e6b28e09dbfbe10a5321760c0a4a6e6e0ce00d39283e9  python-frontmatter-1.3.0.tar.gz

The archive of the release tag is used rather than the PyPI sdist, as the
Python packaging guidelines ask ("Source files from PyPI"): the sdist omits
the test suite that the tag archive ships.


Build backend and the uv_build version bound (please review this):

Upstream builds with the uv_build PEP 517 backend and requires
"uv_build>=0.11.15,<0.12". Fedora ships uv_build 0.12.x only, so no version in
the distribution satisfies the upper bound and the generated BuildRequires
cannot be resolved. The spec therefore declares

    %prep
    %pyproject_patch_dependency uv_build:drop_upper

which is the pyproject-rpm-macros mechanism intended for exactly this case
(it drops upper bounds from generated BuildRequires and from the installed
dependency metadata).

Build:
mock -r fedora-rawhide-aarch64 (aarch64), Fedora Rawhide (f46): builds clean.
%check: %pyproject_check_import frontmatter plus upstream's pytest suite:
47 tests pass, 7 are deselected ("47 passed, 7 deselected").
The 7 deselected tests are the ones exercising TOML front matter, which needs
the optional `toml` module. `toml` is not packaged in Fedora, so
frontmatter.default_handlers.TOMLHandler is None here. Deselected nodes:
TOMLHandlerTest (4 tests), HandlerTest::test_detect_format,
HandlerTest::test_sanity_all and test_docs.py::test_handler_docs (a doctest
that instantiates TOMLHandler).
The TOML test data directory is also removed in %check: pytest puts tests/ on
sys.path, so tests/toml would be imported as a namespace package named `toml`,
shadowing the missing module and failing unrelated tests (16 failures before
this was handled).
Both exclusions follow the Python packaging guidelines, "Tests": specific
failing tests MAY be excluded, and "dependencies not packaged in Fedora" is
listed there as a valid reason to skip tests.
Upstream ships frontmatter/conftest.py inside the importable package and that
module imports pytest, hence BuildRequires: python3dist(pytest).
The tag archive is used as Source because it carries the tests, which the
PyPI sdist omits ("Source files from PyPI").

rpmlint output (also attached, python-frontmatter-rpmlint.txt):
  spec:    0 errors, 0 warnings
  srpm:    0 errors, 0 warnings
  binary:  0 errors, 0 warnings

Self-review against ReviewGuidelines.adoc:
- rpmlint: run on spec, srpm and binary rpm, output above.
- naming: the canonical project name already starts with python-, so the
  source package keeps it (Python guidelines, "Library naming").
- spec file name matches %{name}: python-frontmatter.spec.
- license: MIT, matches the LICENSE file in the sdist; enforced at build time
  by %pyproject_save_files -l.
- sources match upstream (sha256 above).
- builds successfully on aarch64.
- BuildRequires: python3-devel, python3dist(pytest), plus uv_build and
  pyproject-rpm-macros pulled in by %pyproject_buildrequires.
- runtime dependency python3dist(pyyaml) is already in Fedora.
- no locales, no bundled libraries, no shared libraries, no scriptlets.
- %files: %{pyproject_files} plus %doc README.md; only directories under
  %{python3_sitelib} are owned.

Open items:
- Optional: report the uv_build upper bound upstream, so that the
  %pyproject_patch_dependency override can eventually be dropped.
- Optional: if Fedora ever packages the `toml` module, remove the four
  deselects and the tests/toml removal and run the full suite.

Assisted-by: AI

Comment 1 Clement Verna 2026-10-05 08:48:15 UTC
Filed an upstream issue for dropping the uv-build version upper limit https://github.com/eyeseast/python-frontmatter/issues/142

Comment 2 ergün 2026-11-02 19:35:26 UTC
This is an informal review (I'm not a packager yet, so I can't approve).

I rebuilt the SRPM in a Fedora rawhide container (rpmbuild --rebuild, with the
dynamic BuildRequires resolved) and ran rpmlint.

Good:
- Source0 matches upstream: sha256 c123bd29...283e9 for the v1.3.0 GitHub archive
- Build OK on rawhide (Python 3.15); %check: 47 passed, 7 deselected
- rpmlint: 0 errors, 0 warnings
- License: MIT matches upstream; LICENSE is in the dist-info and marked
  %license (via %pyproject_save_files -l)
- Runtime Requires is only python3dist(pyyaml), as upstream declares
- The TOML deselects make sense: python3-toml is not in rawhide, so
  TOMLHandler is None; the comment explains it well

Suggestions (none of them block):
1. frontmatter/conftest.py ends up in site-packages. It is a pytest fixture
   for upstream's doctests and imports pytest, so it is not useful at runtime.
   You could remove it after %pyproject_install, before %pyproject_save_files:
     rm %{buildroot}%{python3_sitelib}/frontmatter/conftest.py
   (or ask upstream to exclude it from the wheel).
2. The %prep comment says "Fedora ships 0.12.x only"; rawhide now has
   python3-uv-build 0.13.6. The drop_upper patch is still needed (upstream
   pins <0.12); only the version in the comment is out of date.

Looks good to me otherwise.


Note You need to log in before you can comment on or make changes to this bug.