Bug 280646 - devel/py-pyproject_hooks: fix entry-point loading
Summary: devel/py-pyproject_hooks: fix entry-point loading
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks: 270358
  Show dependency treegraph
 
Reported: 2024-08-06 07:13 UTC by Charlie Li
Modified: 2024-10-10 02:17 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (sunpoet)


Attachments
v0 (2.30 KB, patch)
2024-08-06 07:13 UTC, Charlie Li
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Charlie Li freebsd_committer freebsd_triage 2024-08-06 07:13:27 UTC
Created attachment 252539 [details]
v0

On this version, devel/py-setuptools fails to build or run under PEP-517:
https://github.com/pypa/setuptools/issues/4333
https://github.com/pypa/pyproject-hooks/issues/192

Two upstream pull request variants are open, this patch uses the one without introducing an additional devel/py-importlib-metadata dependency: https://github.com/pypa/pyproject-hooks/pull/199
Comment 1 commit-hook freebsd_committer freebsd_triage 2024-08-15 11:56:50 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=281005ac6d0d21a003e5a975aa94dc0c527cb855

commit 281005ac6d0d21a003e5a975aa94dc0c527cb855
Author:     Charlie Li <vishwin@freebsd.org>
AuthorDate: 2024-08-15 09:47:17 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2024-08-15 11:53:27 +0000

    devel/py-pyproject_hooks: Fix entry-point loading

    - Bump PORTREVISION for package change

    PR:             280646
    Obtained from:  https://github.com/pypa/pyproject-hooks/pull/199

 devel/py-pyproject_hooks/Makefile | 4 ++++
 devel/py-pyproject_hooks/distinfo | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)
Comment 2 Po-Chuan Hsieh freebsd_committer freebsd_triage 2024-08-15 12:07:16 UTC
(In reply to Charlie Li from comment #0)

The addition of "LICENSE_FILE=${WRKSRC}/LICENSE" in attachment 252539 [details] is incorrect, therefore I removed it.

Thanks.
Comment 3 John Hein 2024-10-10 01:51:21 UTC
Backing out this change seems to fix py38 and py39 builds for at least:
 devel/py-incremental
 devel/py-setuptools-scm

Build error is:

    AttributeError: 'PathDistribution' object has no attribute '_normalized_name'
Comment 4 Charlie Li freebsd_committer freebsd_triage 2024-10-10 01:59:01 UTC
(In reply to John Hein from comment #3)
This will not be backed out especially since the exact pull request/commit has been incorporated into the next/latest upstream release 1.2.0.
Comment 5 John Hein 2024-10-10 02:17:42 UTC
(In reply to Charlie Li from comment #4)
Yes, understood.

My observation is mostly for documentation.

It seems that setuptools 63.1.0 and pyproject_hooks > 1.1.0 (1.1.0_1 or 1.2.0) are fatal for some pep517 builds with python 3.8 and 3.9.

I don't fully understand the root cause yet except it's somewhere in the depths of the importlib / entry hooks / module dependency implementation.  Maybe there's an elegant fix for older python (but that would be lower priority than some of the other work).

Both of the ports that have so far been observed to be affected (py-incremental 24.7.2 and py-setuptools-scm 8.0.4) DO build with setuptools 75.1.0 and the latest pyproject_hooks (1.1.0_1 or 1.2.0).  And, yes, I am aware of the pending update for setuptools and the blockers for it.