You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A few hours ago, virtualenv 21.0.0 was released, and it extracted the Python discovery logic
into a standalone python-discovery package (pypa/virtualenv#3070). As part of this refactoring, propose_interpreters is no longer exported from virtualenv.discovery.builtin, causing hatch to fail with:
Environment `my-env-name` is incompatible: module 'virtualenv.discovery.builtin' has no attribute 'propose_interpreters'
This PR adds a fallback import from python_discovery._discovery (which is installed as a dependency of virtualenv >=21).
I don’t think this makes sense, the monkeypatch sets the propose_interpreters attribute on virtualenv.discovery.builtin, but that module no longer has a propose_interpreters function. That function presumably lives in python-discovery now and would need to be patched there.
But as @agriyakhetarpal said, there’s no reason to import this from virtualenv.discovery.builtin anymore, get_interpreter should be directly imported from python-discovery.
After a hotfix, I think it’s best to take this upstream so it never breaks again. This would probably mean to add a filter parameter in python-discovery or so.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A few hours ago,
virtualenv21.0.0 was released, and it extracted the Python discovery logicinto a standalone
python-discoverypackage (pypa/virtualenv#3070). As part of this refactoring,propose_interpretersis no longer exported fromvirtualenv.discovery.builtin, causing hatch to fail with:This PR adds a fallback import from
python_discovery._discovery(which is installed as a dependency of virtualenv >=21).The related issue is #2193.
I've tested this locally and it resolved the issue for me.
This is my first contribution to hatch, so I'm happy to adjust the approach if maintainers prefer a different direction!