-
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
If installation of a dependency fails, it remains in the lock file until it is updated with poetry lock
#395
Comments
I agree this is an undesired behavior. The installer should be more clever when rollbacking if an error occurs during installation. |
I can reproduce this bug on latest (1.2.1). I tried to install a difficult dependency on Linux, called $ poetry add pyaudio
Using version ^0.2.12 for PyAudio
Updating dependencies
Resolving dependencies... (0.5s)
Writing lock file
Package operations: 1 install, 0 updates, 0 removals
• Installing pyaudio (0.2.12): Failed
...stack tracebacks... $ git status -s
M poetry.lock $ git diff
diff --git a/poetry.lock b/poetry.lock
index f1d2d23..a26c47d 100644
--- a/poetry.lock
+++ b/poetry.lock
@@ -224,6 +224,17 @@ category = "dev"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
+[[package]]
+name = "PyAudio"
+version = "0.2.12"
+description = "Cross-platform audio I/O with PortAudio"
+category = "main"
+optional = false
+python-versions = "*" |
I probably can work to solve this issue. |
I opened a PR with a fix for this issue |
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. |
-vvv
option).Issue
When installation of a dependency fails, such as for example, it requires a system component that you do not have to complete the build process, the package/hash combo is still added to the pyproject.lock file, even though the dependency has not installed.
The pyproject.toml file does not incorrectly retain the dependency.
Example:
poetry add -D yappi
without the MSVC++ 14.0 build tools causes a VenvCommandError. This is fine and expected. However, after running this, the following lines was added to my pyproject.lock:and
My pyproject.toml was unaffected, as mentioned.
Running
poetry lock
clears this anomaly.The text was updated successfully, but these errors were encountered: