Skip to content
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

Closed
3 tasks done
13steinj opened this issue Aug 15, 2018 · 5 comments · Fixed by #7498
Closed
3 tasks done
Labels
area/installer Related to the dependency installer kind/bug Something isn't working as expected

Comments

@13steinj
Copy link

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: Windows 10 64-bit
  • Poetry version: 0.11.4
  • Link of a Gist with the contents of your pyproject.toml file: not really applicable

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:

[[package]]
category = "dev"
description = "Yet Another Python Profiler"
name = "yappi"
optional = false
platform = "UNKNOWN"
python-versions = "*"
version = "0.98"

and

yappi = ["5f657129e1b9b952379ffbc009357d0dcdb58c50f3bfe88ffbb992e4b27b263c"]

My pyproject.toml was unaffected, as mentioned.

Running poetry lock clears this anomaly.

@sdispater
Copy link
Member

I agree this is an undesired behavior.

The installer should be more clever when rollbacking if an error occurs during installation.

@sdispater sdispater added kind/bug Something isn't working as expected area/installer Related to the dependency installer labels Sep 13, 2018
@wagnerluis1982
Copy link
Contributor

wagnerluis1982 commented Oct 9, 2022

I can reproduce this bug on latest (1.2.1). I tried to install a difficult dependency on Linux, called pyaudio.

$ 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 = "*"

@wagnerluis1982
Copy link
Contributor

I probably can work to solve this issue.

@wagnerluis1982
Copy link
Contributor

I opened a PR with a fix for this issue

Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/installer Related to the dependency installer kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants