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

Directory does not exist errors for path dependencies #4245

Closed
3 tasks done
md384 opened this issue Jul 2, 2021 · 6 comments · Fixed by #4246
Closed
3 tasks done

Directory does not exist errors for path dependencies #4245

md384 opened this issue Jul 2, 2021 · 6 comments · Fixed by #4246
Labels
kind/bug Something isn't working as expected

Comments

@md384
Copy link
Contributor

md384 commented Jul 2, 2021

  • 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: MacOS Big Sur
  • Poetry version: 1.1.7
  • Link of a Gist with the contents of your pyproject.toml file: NA

Issue

v1.1.7 can cause path dependencies to not be found when packages are not all at the same directory depth. This appears to happen because the dependencies are searched for relative to the lockfile rather than relative to the lockfile and package.

As an example, for the directory structure

/
  pyproject.toml
  poetry.lock
  /lib
    /libA
      pyproject.toml
      poetry.lock
    /libB
      pyproject.toml
      poetry.lock

and relevant part of the poetry.lock file for the root

[[package]]
name = "lib-a"
version = "0.1.0"
description = ""
category = "main"
optional = false
python-versions = "^2.7.9"
develop = true

[package.dependencies]
lib-b = {path = "../libB", develop = true}

[package.source]
type = "directory"
url = "lib/libA"

[metadata]
lock-version = "1.1"
python-versions = "*"
content-hash = "115cf985d932e9bf5f540555bbdd75decbb62cac81e399375fc19f6277f8c1d8"

[metadata.files]
lib-a = []
lib-b = []

In 1.1.7, we get a Directory ../lib-b does not exist error because it tries to find the libB dependency at /../lib-b rather than /lib/libA/../libB.

This is likely a problem with previous versions of poetry but 1.1.7 changed the lockfiles for path dependencies to be paths rather than versions so becomes apparent when installing a package.

@md384 md384 added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jul 2, 2021
@bstadlbauer
Copy link

This seems to be a duplicate/related to #3368

@skovhus
Copy link

skovhus commented Jul 8, 2021

I'm experiencing the same issue. Downgrading to 1.1.6 is a temporary workaround.

@dylan-sharp
Copy link

I'm experiencing the same issue. Downgrading to 1.1.6 is a temporary workaround.

I downgraded poetry to v1.1.6 and still experience this same issue.

@skovhus
Copy link

skovhus commented Jul 9, 2021

I downgraded poetry to v1.1.6 and still experience this same issue.

Maybe this is caused by you lock file being generated with a newer version of Poetry. Regenerating the lock file with 1.1.6 solved it for me.

@dylan-sharp
Copy link

I downgraded poetry to v1.1.6 and still experience this same issue.

Maybe this is caused by you lock file being generated with a newer version of Poetry. Regenerating the lock file with 1.1.6 solved it for me.

So I played around a little and ended up getting it to work. I ended up getting it to work if I manually added the package to pyproject.toml, but when attempting to use poetry add I get this same issue in 1.1.6.

sdispater added a commit that referenced this issue Jul 29, 2021
fix: create path dependencies relative to package rather than lockfile (#4245)
sdispater added a commit that referenced this issue Jul 30, 2021
fix: create path dependencies relative to package rather than lockfile (#4245)
sdispater added a commit that referenced this issue Jul 30, 2021
fix: create path dependencies relative to package rather than lockfile (#4245)
sdispater added a commit that referenced this issue Jul 30, 2021
fix: create path dependencies relative to package rather than lockfile (#4245)
@abn abn removed the status/triage This issue needs to be triaged label Mar 3, 2022
Copy link

github-actions bot commented Mar 2, 2024

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 Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants