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.

`poetry lock` should overwrite broken `poetry.lock` file, not error out.

See original GitHub issue
… ~/my_project> poetry shell

[EmptyKeyError]
Empty key at line 36 col 0

shell

The actual reason is that I have a merge conflict in pyproject.toml. I wish poetry told me that! 🙏

Also, if the merge conflict is in poetry.lock the best action to resolve it is seemingly to run poetry lock (assuming project is close to HEAD and not some old branch merged with another old branch).

(poetry versions tested: 1.0.0a2 1.0.0a4 0.12.16)

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
passionsfruchtcommented, Sep 22, 2021

Not really a solution, but a tip, or how I integrate it in my workflow regarding --no-update. It usually happens when I do a rebase, thus to hinder it to do an unintended upgrade:

$ git checkout origin/master -- poetry.lock
??? updated 1 file ???
$ poetry lock --no-update

I’m quite positive that it can be done in a more elegant way using --ours or some .gitattributes magic with a check if the lock file needs an update, but this way it is good enough for me right now.

So maybe it can be handled as a documentation issue?

Disclaimer: I just looked it up in my command history. And wrote the results how I remembered it, I may have got a detail wrong.

0reactions
kkirschecommented, Sep 21, 2021

If there are concerns about the scope of this type of change, an alternative solution would be to restrict when situations overwriting or “fixing” the lockfile occurs. For example, automate fixing merge conflicts potentially as yarn does? Overall, a smaller scope allows for alternative technical implementations to be used in order to satisfy the requirement.

EDIT: Fixed grammatical issues

Read more comments on GitHub >

github_iconTop Results From Across the Web

poetry lock should overwrite broken poetry.lock file, not error ...
I can confirm that a broken poetry.lock still makes poetry lock to throw an error. In a fresh Python 3.8 with poetry 1.1.4...
Read more >
Basic usage | Documentation | Poetry - Python dependency ...
When Poetry has finished installing, it writes all the packages and their exact versions that it downloaded to the poetry.lock file, locking the...
Read more >
poetry update [--lock] is not updating the poetry.lock file?
When I ran poetry update. there were a few changes/updated libraries. But the poetry.lock file was unchanged. Puzzled, I also tried
Read more >
Dependency Scanning - GitLab Docs
The search begins with the root directory and then continues with subdirectories if no builds are found in the root directory. Consequently a...
Read more >
Third-party dependencies - Pants build
Note that Pants does not consume your poetry.lock file. Instead, see the section on lockfiles below. How dependencies are chosen. Once Pants knows ......
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