-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify valid manifest name
keys
#37
Comments
hey @DragaDoncila. I believe the goal is that the name must be the package name, but normalized to a python identifier. so dashes will be replaced by underscores. (pypi still treats those as unique). I definitely imagined that we would get around to all of these things, with nicer error message, before anyone actually used them, but it looks like we're under a time crunch now |
basically... none of this is ready for mass consumption. |
Ah ok perfect so I think then the "change" required would be to validate the
Completely understand - I'm only testing things now with the plugin workshop in mind. If we need more manpower on |
thank you @DragaDoncila. I added a note about this to the pre-release checklist #32 I agree with proposed changes. note that we could technically do this for the user (coerce the name at discovery), but I think it's best to just error: so that they are aware of the key. The best place to do this is somewhere in the manifest creation, when we have both the validated manifest, and the distribution object itself. Like in or in from_distribution or from_entrypoint |
Description
There are some inconsistencies in the way the
name
key of the manifest is defined/parsed bynpe2
.The docs currently mention that it should be a valid package name (or at least that is the intention as I understood from @nclack). However, based on the command validation regex, it looks like they should be module names instead?
e.g. this manifest snippet is validated as ok by
npe2 validate
but if I add a reader command referencing this name:
then
npe2 validate
gives me:I can change the name (and associated commands)
nag-demo
tonag_demo
(the module name) and this works fine. However, I can also change the name to any random word I want and that also still works e.g.gives us
Questions/issue
name
key that can't be used as part of a commandname
can be any identifier i.e. it doesn't have to relate in any way to the package name or module name? Are there best practice guidelines for what it should be?name
supposed to be any valid package name (in which case we need to modify behaviour to accept-
) or any valid module name?The text was updated successfully, but these errors were encountered: