-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
should overwrite broken poetry.lock
file, not error out.
#1196
Comments
Still a problem with |
poetry lock
should overwrite broken poetry.lock
file, not error out.
Would a |
@dimaqq Does the issue still exist in newer poetry versions (>=1.1)? |
I can confirm that a broken In a fresh Python 3.8 with poetry 1.1.4 I get (I broke
Steps to reproduce with
|
Confirmed still an issue in 1.1.6. Looks like the only fix is The problem with that is that this will implicitly update dependencies, since you removed |
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 EDIT: Fixed grammatical issues |
Not really a solution, but a tip, or how I integrate it in my workflow regarding $ 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 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. |
…e exists (#6753) After having created a lock file 2.0, running `poetry lock` with poetry 1.2.1 results in the following output: ``` The lock file is not compatible with the current version of Poetry. Upgrade Poetry to be able to read the lock file or, alternatively, regenerate the lock file with the `poetry lock` command. ``` Ironically, the error message proposes to run `poetry lock` which results in this error message. Further, it doesn't make sense that `poetry lock` fails because it creates a new lock file from scratch (in contrast to `poetry lock --no-update`). Running `poetry lock` is now also possible if there is a broken lock file. Resolves: #1196
…e exists (#6753) After having created a lock file 2.0, running `poetry lock` with poetry 1.2.1 results in the following output: ``` The lock file is not compatible with the current version of Poetry. Upgrade Poetry to be able to read the lock file or, alternatively, regenerate the lock file with the `poetry lock` command. ``` Ironically, the error message proposes to run `poetry lock` which results in this error message. Further, it doesn't make sense that `poetry lock` fails because it creates a new lock file from scratch (in contrast to `poetry lock --no-update`). Running `poetry lock` is now also possible if there is a broken lock file. Resolves: #1196 (cherry picked from commit 7d414af)
…e exists (#6753) After having created a lock file 2.0, running `poetry lock` with poetry 1.2.1 results in the following output: ``` The lock file is not compatible with the current version of Poetry. Upgrade Poetry to be able to read the lock file or, alternatively, regenerate the lock file with the `poetry lock` command. ``` Ironically, the error message proposes to run `poetry lock` which results in this error message. Further, it doesn't make sense that `poetry lock` fails because it creates a new lock file from scratch (in contrast to `poetry lock --no-update`). Running `poetry lock` is now also possible if there is a broken lock file. Resolves: #1196 (cherry picked from commit 7d414af)
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. |
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 runpoetry lock
(assuming project is close toHEAD
and not some old branch merged with another old branch).(poetry versions tested:
1.0.0a2
1.0.0a4
0.12.16
)The text was updated successfully, but these errors were encountered: