Skip to content

The HUGE Draft pull request - #233

Draft
qr243vbi wants to merge 3 commits into
openSUSE:masterfrom
qr243vbi:main
Draft

qr243vbi wants to merge 3 commits into
openSUSE:masterfrom
qr243vbi:main

Conversation

@qr243vbi

@qr243vbi qr243vbi commented May 4, 2026 •

Copy link
Copy Markdown
Contributor

Fix builds in openSUSE and Fedora from generated specs, add option to get metadata from archive and local module, repair code related to metadata processing, fix #235

@mcepl mcepl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mcepl
mcepl marked this pull request as ready for review October 12, 2026 07:20
@mcepl
mcepl marked this pull request as draft October 12, 2026 07:20

@mcepl mcepl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, consider my comments.

Comment thread py2pack/parse.py Outdated
def pypi_text_metaextract(library):
# parse metadata from python module which already exists
pkg_info_lines = metadata.metadata(library)
return pypi_text_items(pkg_info_lines.items())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new installed-package metadata path loses descriptions and runtime dependencies. This function processes only metadata headers, dropping the description body. It retains dependencies as requires_dist, but templates consume install_requires, and this path skips archive augmentation.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rechecked at c00b9e9. This is still reproducible: parsing Metadata-Version: 2.1\nName: example\nVersion: 1.0\nRequires-Dist: requests\n\nExample description\n returns requires_dist: ["requests"], but no description or install_requires. Both text-metadata entry points still pass only .items(), so the description body is discarded. Please preserve the body and convert the metadata dependencies into the fields consumed by the templates, including when --local uses installed metadata without a source archive.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rechecked at 8a17563. The description body is kept now, thanks. One part is left: install_requires is copied straight from Requires-Dist, markers included. With Requires-Dist: pysocks; extra == "socks" and Requires-Dist: tomli>=1; python_version<"3.11", both end up in install_requires unchanged. When there is no archive to augment from (--local on an installed package), they render as Requires: python-pysocks; extra == "socks", which is not valid RPM and makes an optional extra a hard dependency. Please drop extra-only requirements (or move them to extras_require) and run the rest through _requirements_sanitize().

Comment thread py2pack/__init__.py Resolved
Comment thread py2pack/templates/opensuse.spec Resolved

@mcepl mcepl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rechecked c00b9e9. The --add-script initialization and the previously observed --maintainer crash are fixed, and all six current CI checks pass. The metadata-loss finding remains open. I have reopened the archive-directory thread because the default still fails on older sdists; the new override also exposes the separate installed-metadata path problem below.

Comment thread py2pack/templates/opensuse.spec Resolved
@qr243vbi
qr243vbi force-pushed the main branch 3 times, most recently from c53864c to 788ac69 Compare October 18, 2026 05:04
@qr243vbi
qr243vbi requested a review from mcepl October 18, 2026 05:09
@qr243vbi
qr243vbi force-pushed the main branch 9 times, most recently from 774ae88 to bd1cf54 Compare October 18, 2026 08:47
@mcepl

mcepl commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Yeah, this is overly broad, I really hate to return to this PR, which is a sign for me, something’s wrong.

Could you, please, split this into a few focused PRs? It currently combines metadata parsing from local packages and archives, changes to generated RPM spec paths, and CLI options including the maintainer fix for #235. These are useful changes, but reviewing and testing them separately would make it clearer which behavior each PR changes and easier to catch regressions.

I suggest submitting the metadata work, spec-generation changes, and CLI/maintainer changes separately.

@qr243vbi

Copy link
Copy Markdown
Contributor Author

Yeah, this is overly broad, I really hate to return to this PR, which is a sign for me, something’s wrong.

Could you, please, split this into a few focused PRs? It currently combines metadata parsing from local packages and archives, changes to generated RPM spec paths, and CLI options including the maintainer fix for #235. These are useful changes, but reviewing and testing them separately would make it clearer which behavior each PR changes and easier to catch regressions.

I suggest submitting the metadata work, spec-generation changes, and CLI/maintainer changes separately.

Fix username #238

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Maintainer field is empty

2 participants