change default of `installer.re-resolve` from `true` to `false`
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
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 |
|
src/poetry/config/config.pysrc/poetry/installation/installer.py |
| Update tests to expect new default |
|
tests/console/commands/test_config.py |
| Adjust documentation for new default |
|
docs/configuration.mddocs/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 reviewon 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 issueto create an issue from it. -
Generate a pull request title: Write
@sourcery-aianywhere in the pull request title to generate a title at any time. You can also comment@sourcery-ai titleon the pull request to (re-)generate the title at any time. -
Generate a pull request summary: Write
@sourcery-ai summaryanywhere in the pull request body to generate a PR summary at any time exactly where you want it. You can also comment@sourcery-ai summaryon the pull request to (re-)generate the summary at any time. -
Generate reviewer's guide: Comment
@sourcery-ai guideon the pull request to (re-)generate the reviewer's guide at any time. -
Resolve all Sourcery comments: Comment
@sourcery-ai resolveon 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 dismisson 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 reviewto 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.