Correct. It’s just to get a different URL for a file. All other requirements about a file (e.g. hashes, etc.) would still stand. So I would imagine installers would either find a URL already set for a file and it 404s or no URL specified, in which case they look for the URL via the index instead. At that point the flow for the file would be the same even if the URL recorded in the lock file worked (e.g. if hash checking failed then just stop, don’t go hunting for another location).
Which is why it’s an open issue. As Charlie pointed out, it is more work for installers to support and I don’t know how critical it really is at the end of the day. I know @EpicWink would like this feature, but I don’t know how much farther this goes. How often will a URL for a file be an HTTP 404 and not an HTTP 307/308 redirect? At that point do we say the lock file is broken and people regenerate the lock file instead of having this feature in the PEP?
Does anyone know how stable package download URLs are considered on PyPI? When was the last time those URLs change and if they had redirects how long were the redirects kept working?
Yeah, I don’t want to tackle that in the PEP. If requirements files don’t need it and it doesn’t make installs inherently more secure or the lock file easier to audit, I would rather keep that can of worms sealed.
Hence why I don’t want to try and pioneer how to record auth details.
I would expect to make it a “MAY” feature anyway, so it would have to be acceptable that not all tools support the fallback.
To me that says you don’t like the feature, in which case pip and uv aren’t fans while Poetry is neutral/fine with it. That pretty much kills it even if Frost and PDM said they are in favour as that doesn’t get us 2 tools who support the idea. So short of a groundswell of user support I don’t see this idea making it into the PEP.