Skip to content

Conversation

@abn
Copy link
Member

@abn abn commented Sep 30, 2025

  • Change language from python to system for poetry-install hook
  • Add default args: ["--sync"] to poetry-install hook
  • Update documentation with warning about versions up to 2.2.1

Resolves: #9393

Summary by Sourcery

Configure the poetry-install pre-commit hook to use the system language with default sync arguments and update documentation with a warning for versions up to 2.2.1

Enhancements:

  • Change the poetry-install hook language from python to system
  • Add default args ["--sync"] to the poetry-install hook

Documentation:

  • Add a warning about version mismatches up to 2.2.1 and update documentation to reflect the new default sync behavior

@sourcery-ai
Copy link

sourcery-ai bot commented Sep 30, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

The PR updates the poetry-install pre-commit hook to use system language and include default sync arguments, and enhances the documentation with a warning about prior misconfigurations and details on the default args.

Flow diagram for updated poetry-install pre-commit hook configuration

flowchart TD
    A[".pre-commit-config.yaml"] --> B["poetry-install hook"]
    B --> C["language: system"]
    B --> D["args: [--sync]"]
    B --> E["entry: poetry install"]
    B --> F["stages: post-checkout, post-merge"]
Loading

Flow diagram for documentation update warning about poetry-install hook versions

flowchart TD
    A["Documentation"] --> B["Warning for versions <= 2.2.1"]
    B --> C["language: python (incorrect)"]
    A --> D["Info for versions >= 2.2.2"]
    D --> E["language: system"]
    D --> F["args: [--sync]"]
Loading

File-Level Changes

Change Details Files
Updated pre-commit hook configuration to system language with sync args
  • Changed hook language from python to system
  • Added default args ['--sync'] to hook
.pre-commit-hooks.yaml
Enhanced documentation with warnings and default argument details
  • Added warning about misconfiguration in versions up to 2.2.1
  • Documented default args ['--sync'] behavior and sync effect
docs/pre-commit-hooks.md

Possibly linked issues


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

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes - here's some feedback:

  • Record the language change and default args update in the project CHANGELOG so users upgrading from earlier versions see the breaking-note.
  • Consider adding a runtime check or clearer error in the hook when Poetry is not found on PATH under language: system to help users diagnose missing dependencies.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Record the language change and default args update in the project CHANGELOG so users upgrading from earlier versions see the breaking-note.
- Consider adding a runtime check or clearer error in the hook when Poetry is not found on PATH under `language: system` to help users diagnose missing dependencies.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@abn abn requested a review from Copilot October 2, 2025 20:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the configuration of the poetry-install pre-commit hook by changing its language setting and adding default synchronization arguments, along with updating documentation to warn users about the breaking change.

  • Changed language from python to system for the poetry-install hook
  • Added default --sync argument to ensure environment synchronization with lock file
  • Updated documentation with version-specific warnings and argument explanations

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
.pre-commit-hooks.yaml Updates hook configuration to use system language and adds default sync args
docs/pre-commit-hooks.md Adds version warning and documents the new default sync behavior

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@radoering radoering added the impact/docs Contains or requires documentation changes label Oct 17, 2025
entry: poetry install
language: python
language: system
args: ["--sync"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unlucky because we deprecated --sync in favor of poetry sync.

- Change language from python to system for poetry-install hook
- Add default args: ["--sync"] to poetry-install hook
- Update documentation with warning about versions up to 2.2.1

Resolves: python-poetry#9393
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

impact/docs Contains or requires documentation changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

poetry install run under pre-commit hook does not apply changes.

2 participants