ido50 / morgan

PyPI Mirror for Restricted/Offline Environments
Apache License 2.0
105 stars 7 forks source link

fix: wrong last version of selenium #20

Open shamilbi opened 8 months ago

shamilbi commented 8 months ago

closes #19

alex-orange commented 7 months ago

Two comments on this fix:

  1. Seems like packaging should get fixed on ignoring the - bit. packaging should accept selenium-2.0-dev9429.tar.gz but doesn't (despite it's misleading comment "We are requiring a PEP 440 version, which cannot contain dashes," vs "Development releases allow a ., -, or a _ separator as well as omitting the separator all together. The normal form of this is with the . separator. This allows versions such as 1.2-dev2 or 1.2dev2 which normalize to 1.2.dev2.")
  2. Selenium should be told that their file name selenium-2.0-dev-9429.tar.gz is invalid due to the - between dev and the number.
alex-orange commented 7 months ago

Well, after doing a bit more digging, apparently PEP-625 says that sdist filenames MUST be normalized. So someone should probably tell selenium that they need normalize their names (assuming they're still releasing in this fashion).

alex-orange commented 7 months ago

P.S. One last suggestion, if you absolutely need to handle packages with malformed versions, perhaps handling a quoted string in the place of version string, if a quoted string is put in it's treated as a filename that you want it to download. In that case it just ignores all its version selection code, just looks through the list of files and grabs that one (I think it would still need to look through the list for other metadata, but that's just a guess).