Hi folks,
Python cygport downloads no longer work with required hashed downloads, so we
now have to override the SRC_URI or hack the cygport scripts; and the cygport
approach gets more complaints every package update I try, from using setup.py to
not supporting venv testing, so it is difficult to tell if the built package
with install and operate correctly, and if tests might work if they were run.
Please see my latest package hack job:
https://pypi.org/project/license-expression/
https://pypi.org/project/license-expression/#license_expression-30.4.3.tar.gz
https://pypi.org/simple/license-expression/
https://files.pythonhosted.org/packages/bb/79/efb4637d56dcd265cb9329ab502be0e01f4daed80caffdc5065b4b7956df/license_expression-30.4.3.tar.gz
https://cygwin.com/cgi-bin2/jobs.cgi?id=10039
https://cygwin.com/cgit/cygwin-packages/python-license-expression/tree/python-license-expression.cygport
https://github.com/cygwin/scallywag/actions/runs/15946573661/job/44981439043
Could someone who develops in python please have a look and suggest what we
should do about improving how the packaging scripts operate, to be able to
support python standard package downloads, installs, and testing, without these
complaints and failures?
On 2024-11-06 11:39, Brian Inglis via Cygwin-apps wrote:
[Should we loop in Marco Atzeri here if he does not respond with his €0.02?]
I like the Gentoo design ideas of "PYPI_NO_NORMALIZE=1" "PYPI_PN=..." and
"inherit pypi" to do things the new way?
On 2024-11-06 10:14, Brian Inglis via Cygwin-apps wrote:
On 2024-11-05 13:52, Jon Turney via Cygwin-apps wrote:
On 14/08/2024 08:17, Brian Inglis via Cygwin-apps wrote:
new source packages on pythonhosted appear to change dashes in package
names to underscores in archive names and directories, for example:
python-license-expression ->
license-expression ->
https://files.pythonhosted.org/packages/source/l/license_expression/
license_expression-30.3.1.tar.gz
-> license_expression-30.3.1/
although dashes in pythonhosted package directory names
still seem to work as an alternative:
https://files.pythonhosted.org/packages/source/l/license{-,_}expression/
license_expression-30.3.1.tar.gz
but dashes work and underscores do not in older package version
archives, although underscores in pythonhosted package directory names
still seem to work as an alternative:
https://files.pythonhosted.org/packages/source/l/license{-,_}expression/
license-expression-30.3.0.tar.gz
Thanks for this.
Sorry about the delay in looking at this, but I have been very short of time
recently.
So, first off, I am a bit unhappy about guessing how this supposed to work.
Have PyPI not made any announcement of this change, explaining exactly what
it is?
PEP 625 2020
https://peps.python.org/pep-0625/
normalization:
https://packaging.python.org/en/latest/specifications/binary-distribution-format/
TL;DR: distribution names cannot contain '-' as that is used to delimit version:
"In distribution names, any run of -_. characters (HYPHEN-MINUS, LOW LINE and
FULL STOP) should be replaced with _ (LOW LINE), and uppercase characters
should be replaced with corresponding lowercase ones.
This is equivalent to *regular* name normalization followed by replacing -
with _.
Tools consuming wheels must be prepared to accept . (FULL STOP) and uppercase
letters, however, as these were allowed by an earlier version of this
specification."
as opposed to project ("regular" above) name normalization rules:
https://packaging.python.org/en/latest/specifications/core-metadata/#core-
metadata
https://packaging.python.org/en/latest/specifications/name-normalization/
#name-normalization
So unnormalized names may work, or lowercased, or s/[-._]\+/-/, or s/[-._]\+/_/!
Secondly, I'm not crazy about the "try all the alternatives" approach.
Perhaps it would be better to form the URL using the current (new) rules,
with an escape (e.g. define PYTHON_ORG_OLD_STYLE_URL to form it using the old
rules)?
https://warehouse.pypa.io/api-reference/legacy.html#upload-api
"All fields need to be renamed to lowercase and hyphens need to replaced by
underscores.
So instead of “Description-Content-Type” the field must be named
“description_content_type”.
Note that adding a field “Description-Content-Type” will not raise an error
but will be silently ignored."
https://github.com/pypi/warehouse/milestone/12
"Post Legacy Shutdown priorities
Important issues that have gotten unblocked now that legacy PyPI is dead
(RIP). See https://lwn.net/Articles/751458/ for more info."
https://lwn.net/Articles/751458/
Perhaps we should consider the Gentoo eclass changes:
"It should be noted that legacy URLs are no longer supported and may stop
working at an arbitrary time."
like recently:
https://projects.gentoo.org/python/guide/pypi.html
--
Take care. Thanks, Brian Inglis Calgary, Alberta, Canada
La perfection est atteinte Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add
mais lorsqu'il n'y a plus rien à retrancher but when there is no more to cut
-- Antoine de Saint-Exupéry