Skip to content
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

Extra option "format_nongpl" changed to "format-nongpl" in 5.6.0 #962

Closed
sbrandtb opened this issue Jun 7, 2022 · 5 comments
Closed

Extra option "format_nongpl" changed to "format-nongpl" in 5.6.0 #962

sbrandtb opened this issue Jun 7, 2022 · 5 comments
Labels
Bug Something doesn't work the way it should.

Comments

@sbrandtb
Copy link

sbrandtb commented Jun 7, 2022

Looks like a small regression, maybe due to the migration from setup.cfg to pyproject.toml?

# works and installs the dependencies as expected
$ pip install 'jsonschema[format_nongpl]==4.5.1'

# raises a warning and does not install dependencies
$ pip install 'jsonschema[format_nongpl]==4.6.0'
WARNING: jsonschema 4.6.0 does not provide the extra 'format_nongpl'

# Works as expected
$ pip install 'jsonschema[format-nongpl]==4.6.0'

Fixing this could be as simple as updating the docs, although I am suprised that tests did work because tox installs with underscore.

Or treat it as regression that everyone who used underscore has a bad surprise now because pip does even only treat this as a warning, not even as an error.

@Julian Julian changed the title Extra option "format_nongpl" changed to "format-gpl" in 5.6.0 Extra option "format_nongpl" changed to "format-nongpl" in 5.6.0 Jun 7, 2022
@Julian Julian added the Bug Something doesn't work the way it should. label Jun 7, 2022
@Julian
Copy link
Member

Julian commented Jun 7, 2022

This is apparently related to PEP 685 which is enforcing that extras names be normalized -- so in theory the two names should be equivalent, but pip doesn't have support for it yet until I believe pypa/packaging#526 is merged (at which point everything I think will just work as-is).

Not sure there's anything to do in the meantime (suggestions of course welcome). Will have to keep thinking.

@Julian
Copy link
Member

Julian commented Jun 7, 2022

I think Hatch is going to stop normalizing until pip catches up, so watch that linked Hatch ticket which will hopefully resolve this.

@Julian
Copy link
Member

Julian commented Jul 25, 2022

OK, the aforementioned PR is merged, but I think pypa/packaging#569 needs doing to get packaging a release, and then I think the next pip release will have it.

Julian added a commit that referenced this issue Jul 29, 2022
We're still waiting on the upstream fix for #962 which will
allow installing the extra with either form, but as-is, this is
technically not valid in a pyproject.toml (and is throwing some
schemastore errors) because keys here have to use hyphens, not
underscores.

See https://packaging.python.org/en/latest/specifications/declaring-project-metadata/#dependencies-optional-dependencies
@felixchenier
Copy link

felixchenier commented Feb 8, 2023

For those like me who work with conda environments, by the time it's solved, this workaround worked for me (largely inspired by the OP):

Install mamba so that you don't wait hours for conda to solve the environment:

>>> conda install -c conda-forge mamba

Install the specific version of jsonschema that works:

>>> mamba install jsonschema=4.6.0

Just my 2 cents. It's only a workaround, but it's better than nothing.

@Julian
Copy link
Member

Julian commented Apr 18, 2023

pypa/pip#11715 is what to watch out for here, which is still open. I of course didn't think it'd take this long (though not sure what we'd have done even with that knowledge), and of course pip is a volunteer project like this one is so anyone who might still care about this one should try to help out there, but going to close this as there's nothing to do here downstream for better or worse.

@Julian Julian closed this as not planned Won't fix, can't repro, duplicate, stale Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something doesn't work the way it should.
Projects
None yet
Development

No branches or pull requests

3 participants