Skip to content
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

misc. improvements to group filtering logic and related options #5338

Merged
merged 12 commits into from
Mar 24, 2022

Conversation

abn
Copy link
Member

@abn abn commented Mar 21, 2022

  • Fix install --only logic to no longer implicitly disable root package installation. (added test coverage)
  • Dedupe logic for group aware command and improve "active" group determination.
  • Reduce cognitive load for installer by removing without and with group specifications, replacing with only group logic.
  • Improve test cases to more reliably verify installer logic and increase coverage.
  • Increase coverage for install command with group filtering options.
  • Improve documenration relating to dependency group to further highlight distinction between default group and default dependencies.
  • Get documentation in sync with cli --help output and warning around combining --only with --with | --without.
  • Deprecate the use of --default option to reduce CLI cognitive load on users.
  • Mark install --remove-untracked as deprecated
  • Improve test coverage for show command with groups.
  • Translate legacy options correctly. --no-dev => --only default, --only-dev => --without default etc.

Closes: #4361
Resolves: #4577

Discussion: https://github.com/orgs/python-poetry/teams/core/discussions/8

PS: Commits are separated by functional changes.

@abn
Copy link
Member Author

abn commented Mar 21, 2022

This is a draft for now as it still requires some changes to documentation to clarify expected behaviour and add more test cases to ensure we do not regress.

@abn abn requested a review from a team March 21, 2022 23:33
@abn abn marked this pull request as ready for review March 22, 2022 15:30
src/poetry/installation/installer.py Outdated Show resolved Hide resolved
src/poetry/console/commands/group_command.py Outdated Show resolved Hide resolved
tests/console/commands/test_install.py Outdated Show resolved Hide resolved
@abn abn requested a review from radoering March 22, 2022 18:47
tests/console/commands/test_install.py Show resolved Hide resolved
docs/managing-dependencies.md Show resolved Hide resolved
tests/console/commands/test_show.py Outdated Show resolved Hide resolved
tests/console/commands/test_show.py Show resolved Hide resolved
@abn abn requested a review from radoering March 23, 2022 21:36
@abn abn mentioned this pull request Mar 23, 2022
2 tasks
docs/cli.md Show resolved Hide resolved
tests/console/commands/test_install.py Outdated Show resolved Hide resolved
tests/console/commands/test_install.py Show resolved Hide resolved
abn and others added 12 commits March 24, 2022 11:49
This change removed code duplication for group option handling in
commands and group activation in installer. The installer now only
allows for `only_groups` and removes `with_groups`/`without_groups`.

Additionally, this change enables code reuse for group flags in the
update command and centralises deprecated option handling logic for
these options.

Further, this fixes regression when using `update --no-dev`.
This change adds a warning that values of `with`/`without` options are
ignored when used with `only`.
This change improves test scenarios for installer with dependency
groups. Previously, the usage of populated installed repositories
could lead to tests incorrectly passing as no operations were
performed. These cases now forces syncronisation and uses a clean
installed repository instance instead.
Co-authored-by: Randy Döring <30527984+radoering@users.noreply.github.com>
@abn abn requested a review from finswimmer March 24, 2022 10:53
@abn abn merged commit 16495c3 into python-poetry:master Mar 24, 2022
@abn abn deleted the improve-group-filtering branch March 24, 2022 19:23
@abn abn mentioned this pull request Jun 6, 2022
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

poetry install --without installs optional dependency groups
3 participants