`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:
- Created 4 years ago
- Reactions:13
- Comments:7 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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: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.
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