Skip to content

Set a limit on version identifiters for new releases - #2163

Open
JacobCoffee wants to merge 1 commit into
mainfrom
version-identifier-length-limit
Open

JacobCoffee wants to merge 1 commit into
mainfrom
version-identifier-length-limit

Conversation

@JacobCoffee

@JacobCoffee JacobCoffee commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

PEP440 does not contain a limit. Can we please add one?

things like https://pypi.org/project/uselesscapitalquiz/ happen without it, and other issues arise not least of which is user a11y related to trying to fit/show all of the wild versioning

stats from pypi:
we have 9.9mm releases, median version is 5 characters, 99th percentil is 20, and maximal is 217(!!)

I propose a 128 char cap, 100 would affect ~9 current releases some releases in the last months with ~110-115 char versioning which I honestly don't understand but... whatever! 128 is fine.

If you'd like to be restrictive, 32 or 64 would be nicer to handle from a designer/UI perspective.

 ┌──────────────┬───────────────────────────────┬─────────────────────────────────────────────────┐
 │ Proposed cap │ Stored versions exceeding cap │ PEP 440-valid normalized versions exceeding cap │
 ├──────────────┼───────────────────────────────┼─────────────────────────────────────────────────┤
 │ 32           │ 323                           │ 128                                             │
 ├──────────────┼───────────────────────────────┼─────────────────────────────────────────────────┤
 │ 64           │ 119                           │ 12                                              │
 ├──────────────┼───────────────────────────────┼─────────────────────────────────────────────────┤
 │ 100          │ 9                             │ 9                                               │
 ├──────────────┼───────────────────────────────┼─────────────────────────────────────────────────┤
 │ 128          │ 2                             │ 2                                               │
 └──────────────┴───────────────────────────────┴─────────────────────────────────────────────────┘

I am not certain on an edit being required to the PEP itself, I think adding a practical limit on PyPI regardless is possible but I would prefer to have it codified.

refs:


📚 Documentation preview 📚: https://python-packaging-user-guide--2163.org.readthedocs.build/en/2163/

@notatallshaw

Copy link
Copy Markdown
Member

Changes and clarifications to the spec are discussed first at https://discuss.python.org/c/packaging/14

After agreement, either clarifications are opened here or a PEP process is followed.

@JacobCoffee

Copy link
Copy Markdown
Member Author

@notatallshaw Sure, i'll do that. i was directed here when asking how a change like this should be brought up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants