Skip to content

If installation of a dependency fails, it remains in the lock file until it is updated with poetry lock #395

@13steinj

Description

@13steinj
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/installerRelated to the dependency installerkind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions