-
Notifications
You must be signed in to change notification settings - Fork 2.4k
All extras #5452
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
Merged
Merged
All extras #5452
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
1887218
Add --all-extras flag for poetry install
kroeschl 9305d35
Update docs for install --all-extras
kroeschl d6976c4
Use line.error instead of ValueError on --extras with --all-extras
kroeschl 0182965
Update src/poetry/console/commands/install.py
neersighted 2145698
Merge branch 'master' into all-extras
neersighted 09b93b8
Update tests/console/commands/test_install.py
neersighted 0fe3679
Update src/poetry/console/commands/install.py
neersighted a7a316a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 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 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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,6 +29,8 @@ | |
|
|
||
| [tool.poetry.dependencies] | ||
| python = "~2.7 || ^3.4" | ||
| fizz = { version = "^1.0", optional = true } | ||
| buzz = { version = "^2.0", optional = true } | ||
|
|
||
| [tool.poetry.group.foo.dependencies] | ||
| foo = "^1.0" | ||
|
|
@@ -47,6 +49,10 @@ | |
|
|
||
| [tool.poetry.group.bam.dependencies] | ||
| bam = "^1.4" | ||
|
|
||
| [tool.poetry.extras] | ||
| extras_a = [ "fizz" ] | ||
| extras_b = [ "buzz" ] | ||
| """ | ||
|
|
||
|
|
||
|
|
@@ -130,3 +136,42 @@ def test_sync_option_is_passed_to_the_installer( | |
| tester.execute("--sync") | ||
|
|
||
| assert tester.command.installer._requires_synchronization | ||
|
|
||
|
|
||
| def test_no_all_extras_doesnt_populate_installer( | ||
| tester: CommandTester, mocker: MockerFixture | ||
| ): | ||
| """ | ||
| Not passing --all-extras means the installer doesn't see any extras. | ||
| """ | ||
| mocker.patch.object(tester.command.installer, "run", return_value=1) | ||
|
|
||
| tester.execute() | ||
|
|
||
| assert not tester.command.installer._extras | ||
|
|
||
|
|
||
| def test_all_extras_populates_installer(tester: CommandTester, mocker: MockerFixture): | ||
| """ | ||
| The --all-extras option results in extras passed to the installer. | ||
| """ | ||
| mocker.patch.object(tester.command.installer, "run", return_value=1) | ||
|
|
||
| tester.execute("--all-extras") | ||
|
|
||
| assert tester.command.installer._extras == ["extras_a", "extras_b"] | ||
|
|
||
|
|
||
| def test_extras_conlicts_all_extras(tester: CommandTester, mocker: MockerFixture): | ||
| """ | ||
| The --extras doesn't make sense with --all-extras. | ||
| """ | ||
| mocker.patch.object(tester.command.installer, "run", return_value=0) | ||
|
|
||
| tester.execute("--extras foo --all-extras") | ||
|
|
||
| assert tester.status_code == 1 | ||
| assert ( | ||
| tester.io.fetch_error() | ||
| == "You cannot specify explicit `--extras` while installing `--all-extras`.\n" | ||
|
||
| ) | ||
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.
Uh oh!
There was an error while loading. Please reload this page.