Repository navigation
Respect requires-python when creating environments - #2021
Open
Mohammad Malik (mohammad-malik) wants to merge 1 commit into
Open
Mohammad Malik (mohammad-malik) wants to merge 1 commit into
Mohammad Malik (mohammad-malik) wants to merge 1 commit into
Conversation
Read project.requires-python from the pyproject.toml that owns the creation root and offer only interpreters that satisfy it. Quick Create keeps a compatible default and otherwise uses the newest match. Co-authored-by: Mohammad Malik <mohammad-malik@users.noreply.github.com>
|
Mohammad Malik (@mohammad-malik) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #412
Create Environment now reads
[project].requires-pythonfrom the pyproject.toml that owns the new environment (the creation root's file wins; otherwise the closest related file, preferring an enclosing project over a nested package). Quick Create keeps the default interpreter when it satisfies the specifier and otherwise picks the newest compatible Python 3. The custom picker lists only compatible interpreters. If the specifier can't be parsed or nothing installed satisfies it, all Python 3 interpreters are still offered and the reason is logged, so creation is never blocked. Happy to make that stricter if you'd prefer.Testing:
npm run lint,npm run compileandnpm run unittest(3580 passing, 12 pending) on Node 22.21.1 with a Python 3.12 venv.