Skip to content

Poetry does not install a non-optional package from lock file #9636

@rgareev

Description

@rgareev

Description

Using pyproject.toml like this:

[tool.poetry]
name = "poetry-sandbox"
version = "0.1.0"
description = ""
authors = ["rinaldv"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"
burr = {extras = ["tracking-client-s3", "tracking-server-s3", "cli"], version = "^0", allow-prereleases = true }

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

Use poetry lock to generate the lock file (see in attachments, poetry.lock). Notice that it contains the following snippet about non-optional requests package:

[[package]]
name = "requests"
version = "2.32.3"
description = "Python HTTP for Humans."
optional = false
python-versions = ">=3.8"
files = [
    {file = "requests-2.32.3-py3-none-any.whl", hash = "sha256:70761cfe03c773ceb22aa2f671b4757976145175cdfca038c02654d061d6dcc6"},
    {file = "requests-2.32.3.tar.gz", hash = "sha256:55365417734eb18255590a9ff9eb97e9e1da868d4ccd6402399eaf68af20a760"},
]

[package.dependencies]
certifi = ">=2017.4.17"
charset-normalizer = ">=2,<4"
idna = ">=2.5,<4"
urllib3 = ">=1.21.1,<3"

[package.extras]
socks = ["PySocks (>=1.5.6,!=1.5.7)"]
use-chardet-on-py3 = ["chardet (>=3.0.2,<6)"]

[[package]]
name = "s3transfer"

Do poetry install and notice that requests is not installed. Logs for -vvv are attached, see poetry-install.log.
Expected behavior - it should be installed, because it seems to be resolved this way already into the lock file, and before it was resolved as dependency for burr[cli].

@radoering mentioned in discord that this might be related to poetry#9427 and installer.re-resolve but this is reported for 1.8.3 version

Workarounds

Adding missing dependencies manually into pyproject.toml

Poetry Installation Method

pipx

Operating System

MacOS 13.6.7

Poetry Version

1.8.3

Poetry Configuration

cache-dir = "/Users/rgareev/Library/Caches/pypoetry"
experimental.system-git-client = false
installer.max-workers = null
installer.modern-installation = true
installer.no-binary = null
installer.parallel = true
keyring.enabled = true
solver.lazy-wheel = true
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.no-setuptools = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}/virtualenvs"  # /Users/rgareev/Library/Caches/pypoetry/virtualenvs
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{project_name}-py{python_version}"
warnings.export = true

Python Sysconfig

No response

Example pyproject.toml

[tool.poetry]
name = "poetry-sandbox"
version = "0.1.0"
description = ""
authors = ["rinaldv"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"
burr = {extras = ["tracking-client-s3", "tracking-server-s3", "cli"], version = "^0", allow-prereleases = true }

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

Poetry Runtime Logs

[poetry-install.log](https://github.com/user-attachments/files/16641377/poetry-install.log)

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expectedstatus/triageThis issue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions