Currently, you are not able to have a package name that contains all the valid characters, meaning every character in the alphabet at least once, and every digit at least once, and also the - (hyphen). If you try to do this, it will fail and tell you that you are using invalid characters even though you are not.
What went wrong?
Even though I am using all valid characters, it tells me I am not.
pydantic.v1.error_wrappers.ValidationError: 2 validation errors for PackageManifest
name
Characters in name must be one of a-z or 0-9 or '-' (type=assertion_error)
How can it be fixed?
Currently, the package name validator says this:
assert set(value) < ALPHABET.union(NUMBERS).union(
"-"
), "Characters in name must be one of a-z or 0-9 or '-'"
return value
Simply changing the < to <= fixes the bug!
btw I am fixing this on my pydantic v2 upgrade, I just thought this bug was absolutely hilarious so I took the time to open this issue. LOL
Environment information
Currently, you are not able to have a package name that contains all the valid characters, meaning every character in the alphabet at least once, and every digit at least once, and also the
-
(hyphen). If you try to do this, it will fail and tell you that you are using invalid characters even though you are not.What went wrong?
Even though I am using all valid characters, it tells me I am not.
Example, when I do:
It results in:
How can it be fixed?
Currently, the package name validator says this:
Simply changing the
<
to<=
fixes the bug!btw I am fixing this on my pydantic v2 upgrade, I just thought this bug was absolutely hilarious so I took the time to open this issue. LOL