question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Verify that the lock file is up to date

See original GitHub issue
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

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

Issue

When I run poetry export or poetry install, I receive a warning message that says Warning: The lock file is not up to date with the latest changes in pyproject.toml. You may be getting outdated dependencies. Run update to update them. if I have manually updated the pyproject.toml file.

Although I understand one should not edit dependencies in pyproject.toml and instead use poetry add, I have no control over what the other engineers at my company do and want to prevent this from happening in an automated test.

I see no way of verifying the lock file is up to date with CLI, and it does not appear that poetry install or poetry export return non-zero exit codes when this warning is displayed. I’d really like to avoid the brittle solution of parsing stdout for a warning message that may change.

I’d like to propose either:

  1. A poetry lock --check flag that will check if the lock file is up to date and return a non-zero exit code if it isn’t.
  2. Adding this check to poetry check. I’m just not certain if this fits in the scope of poetry check.
  3. Updating the docs (the FAQ) if there is a standard solution to doing this. If parsing stdout is an acceptable solution to the community, I think putting it in the docs will at least make it a less brittle solution for us
  4. I think I read that poetry will have an extension system somewhere (similar to pytest). If this is the case, I could also write this as an extension

I’m happy to implement any solution the maintainers see fit

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:39
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

10reactions
perluncommented, Oct 8, 2021

@jacobperron Might make sense to keep it open until 1.2.0 is released, since the feature is not yet available to end-users. (I came here because I was looking for this feature myself. 🙂)

8reactions
ashokdelphiacommented, Oct 22, 2019

I wonder if it would be reasonable to have a flag to pass to poetry install that would exit with a failure if the lock file is out of sync.

When building a container or using CI, I’d expect that would be the usual intent, so it would be nice if there was a succinct way to do it. If not, then poetry check && poetry install … isn’t terribly onerous.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Warning: The lock file is not up to date with the latest changes ...
I am getting the following error: Warning: The lock file is not up to date with the latest changes in pyproject.toml. You ...
Read more >
File Locking - GitLab Docs
By locking a file, you verify that no one else is editing it, and prevent anyone else from editing the file until you're...
Read more >
Handling Composer “lock file out of date” Warning | LornaJane
In that case, you'll see an error message like: Warning: The lock file is not up to date with the latest changes in...
Read more >
YarnLocking your dependencies - DEV Community ‍ ‍
as their versions might represent a wide range - the particular versions to use will be stored in your lock file · if...
Read more >
Composer: It's All About the Lock File - EngineYard
It enables you to spin up new instances weeks, or months later, without being concerned about dependency mismatch. Conclusion. So you see, it's ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found