Skip to content

Twine push to Package Registry fails with "Validation failed: Keywords is too long (maximum is 255 characters)"

Summary

We have a similar problem as in ticket #431505 (closed). We add a Python package, over which we have no control, to our package registry. Unfortunately, this package has a lot of keywords.

  1. PyPI packages with keywords longer than 255 chars fail to upload to the package registry.
  2. PyPI.org does not enforce a similar limit.

Steps to reproduce

Build and attempt to upload a PyPI package with a keywords longer than 255 chars.

Example Project

Example: https://github.com/fabiocaccamo/python-benedict/blob/main/pyproject.toml

What is the current bug behavior?

Uploading python_benedict-0.29.1-py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 86.0/86.0 kB • 00:00 • 38.4 MB/s
INFO     Response from                                                          
         https://git.ems.thomas-krenn.com/api/v4/projects/5/packages/pypi:      
         400 Bad Request                                                        
INFO     {"message":"Validation failed: Keywords is too long (maximum is 255    
         characters)"}                                                          
ERROR    HTTPError: 400 Bad Request from                                        
         https://git.ems.thomas-krenn.com/api/v4/projects/5/packages/pypi       
         Bad Request    

What is the expected correct behavior?

Gitlab package registry should allow more keywords.

Edited by Michael Hacker