poetry icon indicating copy to clipboard operation
poetry copied to clipboard

change default of `installer.re-resolve` from `true` to `false`

Open radoering opened this issue 3 months ago • 1 comments

Pull Request Check List

Resolves: #10617

  • [ ] Added tests for changed code.
  • [x] Updated documentation for changed code.

We have probably reached a point where installation without re-resolving is stable enough to make it the default. Making it the default may reveal new bugs but on the other side https://github.com/python-poetry/poetry/issues/10617#issuecomment-3522733697 shows that the old way has its own bugs.

Summary by Sourcery

Change the default behavior of the installer to disable re-resolving dependencies by default and update associated configuration, documentation, and tests.

Enhancements:

  • Set installer.re-resolve default to false in configuration and installation logic

Documentation:

  • Update documentation to reflect the new default and note the version change in configuration and dependency specification guides

Tests:

  • Adjust console command tests to expect installer.re-resolve default as false

radoering avatar Nov 17 '25 16:11 radoering

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR inverts the default of installer.re-resolve to false by updating the Config default and installer logic, aligning tests to expect the new default, and adjusting documentation accordingly.

Class diagram for updated Config defaults

classDiagram
    class Config {
        +installer: dict
    }
    class Installer {
        -_config: Config
        +_do_install()
    }
    Config <|-- Installer
    Config : installer["re-resolve"] = False

Flow diagram for installer.re-resolve default logic

flowchart TD
    A["Start installation"] --> B["Read installer.re-resolve from config (default: false)"]
    B --> C{Is re-resolve true?}
    C -- Yes --> D["Perform re-resolve logic"]
    C -- No --> E["Skip re-resolve logic"]
    D --> F["Continue installation"]
    E --> F

File-Level Changes

Change Details Files
Change installer.re-resolve default in code
  • Set "re-resolve" default to false in Config class
  • Use false fallback when reading installer.re-resolve in installer logic
src/poetry/config/config.py
src/poetry/installation/installer.py
Update tests to expect new default
  • Replace expected installer.re-resolve value from true to false across tests
tests/console/commands/test_config.py
Adjust documentation for new default
  • Update default value description and add version note in configuration guide
  • Revise dependency-specification warning to reflect default change in 2.3
docs/configuration.md
docs/dependency-specification.md

Assessment against linked issues

Issue Objective Addressed Explanation
https://github.com/python-poetry/poetry/issues/10617 Ensure that adding an unrelated package (cloud-sql-python-connector) does not change the version resolution of pytest-asyncio inappropriately.
https://github.com/python-poetry/poetry/issues/10617 Ensure that pytest-asyncio 1.3.0 correctly includes the backports-asyncio-runner dependency in the lockfile when required (for Python <3.11).

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an issue from a review comment by replying to it. You can also reply to a review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull request title to generate a title at any time. You can also comment @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment @sourcery-ai summary on the pull request to (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the pull request to resolve all Sourcery comments. Useful if you've already addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull request to dismiss all existing Sourcery reviews. Especially useful if you want to start fresh with a new review - don't forget to comment @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

  • Contact our support team for questions or feedback.
  • Visit our documentation for detailed guides and information.
  • Keep in touch with the Sourcery team by following us on X/Twitter, LinkedIn or GitHub.

sourcery-ai[bot] avatar Nov 17 '25 16:11 sourcery-ai[bot]