-
Notifications
You must be signed in to change notification settings - Fork 19
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
Support installing Poetry dependency groups #1080
Open
Niicck
wants to merge
16
commits into
cjolowicz:main
Choose a base branch
from
Niicck:feat/poetry-groups
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
7b7143a
Initial support for installing Poetry dependency groups
edgarrmondragon cddb7e1
specify only_groups when running poetry export
Niicck 98c2921
upgrade minimum poetry version in noxfile tests
Niicck 7d9b460
fix list type-checking for pythonn 3.8
Niicck df7e052
add v1.2.0-example test data project
Niicck bdfd7f6
Merge branch 'feat/poetry-install-groups' into feat/poetry-groups
Niicck 3dcb0d7
create test_install_groups
Niicck 57fab6c
add install_groups to sessions.pyi
Niicck ed3d005
add python 3.7 compatibility to session.install_groups
Niicck 3f24bab
fix Config version for xdoctest compatibility
Niicck f8b16bc
fix mypy checks
Niicck a68884d
install_groups takes args instead of list of groups
Niicck ccdad2a
clean up comments
Niicck 605d839
fix importlib.metadata import for python 3.7
Niicck d142245
revert changes to example pyproject.toml
Niicck 6403718
clean example-v1.2.0 data structure
Niicck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ | |
/docs/_build/ | ||
/src/*.egg-info/ | ||
__pycache__/ | ||
.vscode |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the check on
self.config.is_compatible_with_group_deps()
only for--with
? Isn't--only
also only available forpoetry>=1.2
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What we want to do is export the "main" group along with the "dev" group.
poetry export --with=dev
implicitly exports the "main" group as well.If we ran
poetry export --only=dev
then we'd only be exporting the "dev" group without "main," which is not what we want.poetry export --with=dev
is the equivalent ofpoetry export --dev
. We want the expected default behavior to be the same regardless of what version of poetry the user is using.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading this again, it looks like I misunderstood your comment. Ok. You're asking why the first
if groups:
clause doesn't also check forself.config.is_compatible_with_group_deps()
since thatif groups:
clause uses the--only
flag which is only available for poetry v>=1.2.The reason is because earlier in the code we have a check within
_PoetrySession.export_requirements
that makes sure that if you're using "groups" that you're using the right version of poetry. And there's a unit test to ensure that.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Thanks!