Skip to content

docs: clarify install vs update command differences#10713

Open
abdullahmujahidali wants to merge 4 commits intopython-poetry:mainfrom
abdullahmujahidali:docs/improve-install-update-docs
Open

docs: clarify install vs update command differences#10713
abdullahmujahidali wants to merge 4 commits intopython-poetry:mainfrom
abdullahmujahidali:docs/improve-install-update-docs

Conversation

@abdullahmujahidali
Copy link

@abdullahmujahidali abdullahmujahidali commented Feb 1, 2026

Pull Request Check List

Resolves: #4117

  • Added tests for changed code.
  • Updated documentation for changed code.

Summary

Improves documentation for install and update commands to address common user confusion.

Changes

  • Added note in install section explaining when to use install vs update
  • Clarified that update also installs packages after updating the lock file
  • Added note that update does not modify pyproject.toml

Questions Addressed (from issue)

  • When doing update, are new packages installed?-> Yes
  • Is pyproject.toml updated? -> No, only poetry.lock
  • When should one do install? → After cloning or for reproducible installs

Summary by Sourcery

Clarify the behavioral differences between the poetry install and poetry update commands in the CLI documentation.

Documentation:

  • Document when to use poetry install versus poetry update, emphasizing reproducible installs and lockfile creation.
  • Clarify that poetry update both updates and installs dependencies while only modifying poetry.lock and not pyproject.toml, and direct users to add for changing version constraints.

@sourcery-ai
Copy link

sourcery-ai bot commented Feb 1, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Clarifies Poetry CLI docs for install vs update by adding guidance on when to use each, explicitly stating that update both refreshes the lockfile and installs dependencies, and noting that update does not modify pyproject.toml.

Sequence diagram for poetry update behavior on lockfile and environment

sequenceDiagram
  actor User
  participant Poetry_CLI
  participant pyproject_toml
  participant poetry_lock
  participant Environment

  User->>Poetry_CLI: poetry update
  Poetry_CLI-->>pyproject_toml: Read version_constraints
  Poetry_CLI-->>poetry_lock: Read_existing_locked_versions
  Poetry_CLI->>Poetry_CLI: Resolve_dependencies_to_latest_compatible_versions
  Poetry_CLI-->>poetry_lock: Write_updated_locked_versions
  Poetry_CLI--x pyproject_toml: Do_not_modify_constraints
  Poetry_CLI->>Environment: Install_updated_dependencies
  Environment-->>User: Updated_packages_available
Loading

File-Level Changes

Change Details Files
Document when to use install vs update and how they behave with the lockfile and environment.
  • Added a note under the install command explaining typical use cases for install versus update, including reproducible installs and initial project setup.
  • Clarified update command description to state that it both updates dependency resolutions in poetry.lock and installs them into the environment.
  • Added a note under the update command that it does not modify pyproject.toml and that version constraint changes should be done via the add command.
docs/cli.md

Assessment against linked issues

Issue Objective Addressed Explanation
#4117 Clarify in the documentation what poetry install does and when it should be used (e.g., after cloning a project, for reproducible installs, versus other commands).
#4117 Clarify in the documentation what poetry update does, including that it updates and installs dependencies according to constraints, and that it updates only poetry.lock (not pyproject.toml).

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

@dosubot
Copy link

dosubot bot commented Feb 1, 2026

Related Documentation

No published documentation to review for changes on this repository.

Write your first living document

How did I do? Any feedback?  Join Discord

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 - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `docs/cli.md:480` </location>
<code_context>

+{{% note %}}
+**When to use `install` vs `update`:**
+- Use `poetry install` to install dependencies as specified in `poetry.lock` (or resolve and create it if missing).
+  This is what you run after cloning a project or when you want reproducible installs.
+- Use `poetry update` when you want to update dependencies to their latest versions (within constraints)
</code_context>

<issue_to_address>
**suggestion (typo):** Clarify the phrase "or resolve and create it if missing" to avoid ambiguity.

The parenthetical is grammatically ambiguous: "resolve" has no clear object, and "it" refers to `poetry.lock`, which isn’t something you typically "resolve." Please reword to make it explicit, e.g. "(or resolve dependencies and create it if missing)" or "(or resolve dependencies and create the lock file if it’s missing)."

```suggestion
- Use `poetry install` to install dependencies as specified in `poetry.lock` (or resolve dependencies and create the lock file if it’s missing).
```
</issue_to_address>

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.

docs/cli.md Outdated
{{% note %}}
**When to use `install` vs `update`:**
- Use `poetry install` to install dependencies as specified in `poetry.lock` (or resolve dependencies and create the lock file if it's missing).
This is what you run after cloning a project or when you want reproducible installs.
Copy link
Member

Choose a reason for hiding this comment

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

Especially for reproducible installs sync is even better than install.

docs/cli.md Outdated
**When to use `install` vs `update`:**
- Use `poetry install` to install dependencies as specified in `poetry.lock` (or resolve dependencies and create the lock file if it's missing).
This is what you run after cloning a project or when you want reproducible installs.
- Use `poetry update` when you want to update dependencies to their latest versions (within constraints)
Copy link
Member

Choose a reason for hiding this comment

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

Which constraints? Maybe, better:

Suggested change
- Use `poetry update` when you want to update dependencies to their latest versions (within constraints)
- Use `poetry update` when you want to update dependencies to their latest versions (within the constraints from the `pyproject.toml`)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve documentation on the behaviour of update and install

2 participants