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

poetry-lock pre-commit hook does not only check but also updates poetry.lock #7532

Closed
4 tasks done
yrro opened this issue Feb 18, 2023 · 3 comments
Closed
4 tasks done
Labels
status/duplicate Duplicate issues

Comments

@yrro
Copy link

yrro commented Feb 18, 2023

  • Poetry version: 1.3.2

  • Python version: 3.11.1

  • OS version and name: Fedora 37

  • pyproject.toml: N/A

  • I am on the latest stable Poetry version, installed using a recommended method.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • I have consulted the FAQ and blog for any relevant entries or release notes.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

I've added the poetry-lock pre-commit hook to my project and was surprised by the behaviour of dependencies being updated when the pre-commit hook run.

I expected the hook to only concern itself with whether I'd forgotten to update poetry.lock after editing pyproject.toml, not with additionally updating dependencies.

I worked around this by configuring the pre-commit hook as follows:

- repo: https://github.com/python-poetry/poetry
  rev: 1.3.2
  hooks:
  - id: poetry-lock
    args:
    - --no-update

I think this should be the default behaviour.

For context, there is already a request in #3248 about switching poetry lock to behave as if --no-update is passed by default.

@yrro yrro added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Feb 18, 2023
@dimbleby
Copy link
Contributor

poetry lock --no-update also doesn't only check, sounds like you are looking for poetry lock --check

which would make this a duplicate of #6450

@yrro
Copy link
Author

yrro commented Feb 19, 2023

Agree, thanks :)

@yrro yrro closed this as completed Feb 19, 2023
@neersighted neersighted added status/duplicate Duplicate issues and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Feb 20, 2023
@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Feb 20, 2023
yrro added a commit to yrro/hitron-exporter that referenced this issue Feb 20, 2023
Even with --no-update I still observe fighting between my own system and
the GitHub actions runner, which disagree on exactly which eggs hashes
should be recorded for in poetry.lock.

<python-poetry/poetry#7532 (comment)>
Copy link

This issue 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
status/duplicate Duplicate issues
Projects
None yet
Development

No branches or pull requests

3 participants