Page MenuHomeFreeBSD

python.mk: Introduce PEP517_PKGNAME
Needs RevisionPublic

Authored by lwhsu on Jun 26 2023, 3:48 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 8, 2:34 AM
Unknown Object (File)
Mar 31 2024, 12:36 PM
Unknown Object (File)
Mar 30 2024, 5:53 PM
Unknown Object (File)
Mar 15 2024, 5:26 PM
Unknown Object (File)
Dec 20 2023, 7:50 AM
Unknown Object (File)
Nov 20 2023, 1:54 AM
Unknown Object (File)
Nov 19 2023, 1:01 PM
Unknown Object (File)
Nov 19 2023, 12:55 PM
Subscribers

Details

Reviewers
vishwin
Group Reviewers
Python
portmgr
Summary
python.mk: Introduce PEP517_PKGNAME

Like PYDISTUTILS_PKGNAME, used when PORTNAME is different from the name
of the python pacakge.

This is developed when I am updating databases/py-pymysql:
https://gist.github.com/lwhsu/7ed5a346faf96236a07dc288400daddb

Diff Detail

Repository
rP FreeBSD ports repository
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 52286
Build 49177: arc lint + arc unit

Event Timeline

lwhsu requested review of this revision.Jun 26 2023, 3:48 PM
vishwin requested changes to this revision.Jun 26 2023, 4:46 PM
vishwin added a subscriber: vishwin.

Not a good idea. I deliberately left something like this out for conformance and security/integrity reasons.

While name normalisation is the current rule, for compatibility reasons of PyPA's admission, tools "must be prepared to accept . (FULL STOP) and uppercase letters", and build (and gpep517) produce wheels in mixed case. While normalising full stops are easy enough, mixed case is a different problem. The wheel build process does not allow naming the wheel file arbitrarily, instead following the convention without opportunity for deviation. Generating the binary wheel then installing into STAGEDIR by supplying that exact file name is a security and integrity layer, unlike USE_PYTHON=distutils which lacks anything of this sort.

PyPI, like other language package repositories that have minimal at best curation, have and will continue to fall victim to security and integrity lapses like typo-squatting. Since we strongly encourage PYPI, we correspondingly need to ensure our own tree's security and integrity, and supplying the correct file name, matching the package name, without deviation, every build, is an easy step towards that. It is the package author/maintainer's sole discretion on what they want their package to be called, and we need to respect that.

This revision now requires changes to proceed.Jun 26 2023, 4:46 PM

I'm not sure if I understand these. This is not renaming whl file, but following the whl file the PYPI module wants.

And PORTNAME should match that, without deviation.