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.

command to check lock file

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

Issue

Would it be possible to add a poetry check command (oh, I see you’e used that already, maybe the command could be extended or have a poetry lock --check?) that will return zero if the current poetry.lock is both correct w.r.t. the pyproject.toml (ie: packages match) and that it matches the output of poetry lock.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:35
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
KonstantinSchubertcommented, Feb 4, 2021

The problem is that poetry update does two things, if my understanding is right:

  1. Updates/installs/removes packages to match changes that were made to pyproject.toml

  2. Updates packages even their specification did not change in pyproject.toml wasn’t because it finds a new version which is allowed by semver

In the first case, the peotry.lock does no longer match the pyproject.toml, it’s “illegal”. In the second case, the poetry.lock still matches the the pyproject.toml, it’s legal, just not using the latest semver-allowed version.

In CI, you usually want to force a poetry update in the first case, but not the second.

The proposed solutions in this thread do not differentiate between these two cases as far as I could tell. Therefore they aren’t really a solution and we still need a command.

3reactions
littlebtccommented, Feb 7, 2020

I had figure out script to emulate the behavior of #1954 and fortunately it is simple:

python -c "from poetry.factory import Factory; l = Factory().create_poetry('.').locker; exit(0) if l.is_locked() and l.is_fresh() else exit(1)"  && echo 'OK'
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Find Which Process has Locked a File in Windows
1. Resource Monitor · 2. Process Explorer · 3. Handle from Windows Sysinternals · 4. OpenFiles.exe — a built-in console tool · 5....
Read more >
How to check in command-line if a given file or directory is ...
( type nul >> file.txt ) 2>nul || echo File is locked! type nul command gives an empty output and does not affect...
Read more >
How to tell which Process is locking or using a File in ...
In the Resource Monitor window, go to the CPU tab and expand the Associated Handles option. Now, in the search box, type the...
Read more >
Find out which process is locking a file or folder in Windows
Go to Find, Find Handle or DLL.. or simply press Ctrl + F . Enter image description here · Enter the name of...
Read more >
lockfile-check(1) - Linux man page
The lockfile-check command tests whether or not a valid lock already exists. Options. -q, --quiet. Suppress any output. Success or failure will only...
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