Skip to content

poetry lock has an issue with removing the marker caveat on certain packages #3048

@xM8WVqaG

Description

@xM8WVqaG
  • 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: Ubuntu 18.04 bionic
  • Poetry version: master-04833bc (1.1.0)
  • Link of a Gist with the contents of your pyproject.toml file: N/A

Issue

Following up to #3028, I grabbed master to run poetry lock --no-update on every project we have to fix the lockfile.

However, after running poetry lock --no-update on a package that installed docker it removed the win32 caveat breaking the install.

Source of pywin32:

$ poetry show --tree
|-- docker >=4.2.1,<5.0.0
|   |-- pypiwin32 223 
|   |   `-- pywin32 >=223 
|   |-- requests >=2.14.2,<2.18.0 || >2.18.0 
|   |   |-- certifi >=2017.4.17 
|   |   |-- chardet >=3.0.2,<4 
|   |   |-- idna >=2.5,<3 
|   |   `-- urllib3 >=1.21.1,<1.25.0 || >1.25.0,<1.25.1 || >1.25.1,<1.26 
|   |-- six >=1.4.0 
|   `-- websocket-client >=0.32.0 
|       `-- six * (circular dependency aborted here)
$ poetry install
Installing dependencies from lock file

Package operations: 65 installs, 0 updates, 0 removals

<snip>
  • Installing pywin32 (228): Failed

  RuntimeError

  Unable to find installation candidates for pywin32 (228)

  at /REDACTED/venv/lib/python3.8/site-packages/poetry/installation/chooser.py:72 in choose_for
       68│ 
       69│             links.append(link)
       70│ 
       71│         if not links:
    →  72│             raise RuntimeError(
       73│                 "Unable to find installation candidates for {}".format(package)
       74│             )
       75│ 
       76│         # Get the best link

  • Installing rsa (4.6)
  • Installing smmap (3.0.4)

Here is the relevant diff on the poetry.lock:

 [[package]]
-category = "dev"
-description = "Python for Window Extensions"
-marker = "sys_platform == \"win32\" and python_version >= \"3.6\""
 name = "pywin32"
+version = "228"
+description = "Python for Window Extensions"
+category = "dev"
 optional = false
 python-versions = "*"
-version = "228"

I can confirm that by restoring the marker = "sys_platform == \"win32\" and python_version >= \"3.6\"" poetry install works again.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/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