jsonschema
jsonschema copied to clipboard
Extra option "format_nongpl" changed to "format-nongpl" in 5.6.0
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.
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.
I think Hatch is going to stop normalizing until pip catches up, so watch that linked Hatch ticket which will hopefully resolve this.
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.
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.
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.