Skip to content

Lock file contains an absolute path when using extras #9128

Closed as not planned
@FelixDQ

Description

Description

When a path dependency uses extras with another path dependency, the resulting lock files contains an absolute path even though all the paths in pyproject.toml are relative.

I created a simple reproduction example here https://github.com/FelixDQ/poetry-lock-file-repro which contains 3 projects.

proj2 pyproject.toml:

[tool.poetry.dependencies]
python = "^3.8"
proj3 = {path = "../proj3", optional = true}

[tool.poetry.extras]
example = ["proj3"]

proj1 pyprojct.toml:

[tool.poetry.dependencies]
python = "^3.8"
proj2 = {path = "../proj2", extras = ["example"]}

This results in the following getting added to the lock file for proj1:

[package.extras]
example = ["proj3 @ file:///Users/felix/Projects/tmrow/poetry-lock-file-repro/proj3"]

This causes problems for us because the lock file is updated every time a developer runs poetry lock—- no-update even though nothing has changed. I would expect the file path to be relative as well

Workarounds

Not as far as i know.

Poetry Installation Method

pipx

Operating System

MacOs

Poetry Version

1.8.0

Poetry Configuration

cache-dir = "/Users/felix/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 = true
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/felix/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

No response

Poetry Runtime Logs

.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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