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

Depencendy listed in poetry.lock is not installed #4111

Closed
3 tasks done
bstadlbauer opened this issue May 27, 2021 · 12 comments · Fixed by #4202
Closed
3 tasks done

Depencendy listed in poetry.lock is not installed #4111

bstadlbauer opened this issue May 27, 2021 · 12 comments · Fixed by #4202
Labels
area/solver Related to the dependency resolver kind/bug Something isn't working as expected

Comments

@bstadlbauer
Copy link

bstadlbauer commented May 27, 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: Ubuntu 20.04.2 LTS (Focal Fossa)
  • Poetry version: 1.1.6

Issue

Hi!

I currently have a project structure similar to:

├── first_package
│   ├── first_package
│   │   └── __init__.py
│   └── pyproject.toml
├── second_package
│   ├── pyproject.toml
│   └── second_package
│       └── __init__.py
└── third_package
    ├── poetry.lock
    ├── pyproject.toml
    └── third_package
        └── __init__.py

Where third_package depends on second_package which in turn depends on first_package and first package depends on psycopg2-binary = "2.8.5". The dependencies third_package -> second_package as well as second_package -> first_package are created using a path dependency, where develop is set to true. E.g.:

second_package = { path = "../second_package", develop = true }

I set develop to true as this seems to mitigate #3368 (in the real usecase, these projects might have different root directories).

When I now poetry lock in the third package, it looks as expected:

Click to expand!
[[package]]
name = "first-package"
version = "0.1.0"
description = ""
category = "main"
optional = false
python-versions = "^3.8"
develop = true

[package.dependencies]
psycopg2-binary = "2.8.5"

[package.source]
type = "directory"
url = "../first_package"

[[package]]
name = "psycopg2-binary"
version = "2.8.5"
description = "psycopg2 - Python-PostgreSQL Database Adapter"
category = "main"
optional = false
python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*"

[[package]]
name = "second-package"
version = "0.1.0"
description = ""
category = "main"
optional = false
python-versions = "^3.8"
develop = true

[package.dependencies]
first_package = "0.1.0"

[package.source]
type = "directory"
url = "../second_package"

[metadata]
lock-version = "1.1"
python-versions = "^3.8"
content-hash = "a4761308323e3d889233f68448936ee5a50a55bd476d4054bc9f0dccb90810ef"

[metadata.files]
first-package = []
psycopg2-binary = [
    {file = "psycopg2-binary-2.8.5.tar.gz", hash = "sha256:ccdc6a87f32b491129ada4b87a43b1895cf2c20fdb7f98ad979647506ffc41b6"},
    {file = "psycopg2_binary-2.8.5-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl", hash = "sha256:96d3038f5bd061401996614f65d27a4ecb62d843eb4f48e212e6d129171a721f"},
    {file = "psycopg2_binary-2.8.5-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:08507efbe532029adee21b8d4c999170a83760d38249936038bd0602327029b5"},
    {file = "psycopg2_binary-2.8.5-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:b9a8b391c2b0321e0cd7ec6b4cfcc3dd6349347bd1207d48bcb752aa6c553a66"},
    {file = "psycopg2_binary-2.8.5-cp27-cp27m-win32.whl", hash = "sha256:3286541b9d85a340ee4ed42732d15fc1bb441dc500c97243a768154ab8505bb5"},
    {file = "psycopg2_binary-2.8.5-cp27-cp27m-win_amd64.whl", hash = "sha256:008da3ab51adc70a5f1cfbbe5db3a22607ab030eb44bcecf517ad11a0c2b3cac"},
    {file = "psycopg2_binary-2.8.5-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:ba13346ff6d3eb2dca0b6fa0d8a9d999eff3dcd9b55f3a890f12b0b6362b2b38"},
    {file = "psycopg2_binary-2.8.5-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:c8830b7d5f16fd79d39b21e3d94f247219036b29b30c8270314c46bf8b732389"},
    {file = "psycopg2_binary-2.8.5-cp34-cp34m-win32.whl", hash = "sha256:51f7823f1b087d2020d8e8c9e6687473d3d239ba9afc162d9b2ab6e80b53f9f9"},
    {file = "psycopg2_binary-2.8.5-cp34-cp34m-win_amd64.whl", hash = "sha256:107d9be3b614e52a192719c6bf32e8813030020ea1d1215daa86ded9a24d8b04"},
    {file = "psycopg2_binary-2.8.5-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl", hash = "sha256:930315ac53dc65cbf52ab6b6d27422611f5fb461d763c531db229c7e1af6c0b3"},
    {file = "psycopg2_binary-2.8.5-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:6bb2dd006a46a4a4ce95201f836194eb6a1e863f69ee5bab506673e0ca767057"},
    {file = "psycopg2_binary-2.8.5-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:3939cf75fc89c5e9ed836e228c4a63604dff95ad19aed2bbf71d5d04c15ed5ce"},
    {file = "psycopg2_binary-2.8.5-cp35-cp35m-win32.whl", hash = "sha256:a20299ee0ea2f9cca494396ac472d6e636745652a64a418b39522c120fd0a0a4"},
    {file = "psycopg2_binary-2.8.5-cp35-cp35m-win_amd64.whl", hash = "sha256:cc30cb900f42c8a246e2cb76539d9726f407330bc244ca7729c41a44e8d807fb"},
    {file = "psycopg2_binary-2.8.5-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl", hash = "sha256:40abc319f7f26c042a11658bf3dd3b0b3bceccf883ec1c565d5c909a90204434"},
    {file = "psycopg2_binary-2.8.5-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:702f09d8f77dc4794651f650828791af82f7c2efd8c91ae79e3d9fe4bb7d4c98"},
    {file = "psycopg2_binary-2.8.5-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:d1a8b01f6a964fec702d6b6dac1f91f2b9f9fe41b310cbb16c7ef1fac82df06d"},
    {file = "psycopg2_binary-2.8.5-cp36-cp36m-win32.whl", hash = "sha256:17a0ea0b0eabf07035e5e0d520dabc7950aeb15a17c6d36128ba99b2721b25b1"},
    {file = "psycopg2_binary-2.8.5-cp36-cp36m-win_amd64.whl", hash = "sha256:e004db88e5a75e5fdab1620fb9f90c9598c2a195a594225ac4ed2a6f1c23e162"},
    {file = "psycopg2_binary-2.8.5-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl", hash = "sha256:a34826d6465c2e2bbe9d0605f944f19d2480589f89863ed5f091943be27c9de4"},
    {file = "psycopg2_binary-2.8.5-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:cac918cd7c4c498a60f5d2a61d4f0a6091c2c9490d81bc805c963444032d0dab"},
    {file = "psycopg2_binary-2.8.5-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:7b832d76cc65c092abd9505cc670c4e3421fd136fb6ea5b94efbe4c146572505"},
    {file = "psycopg2_binary-2.8.5-cp37-cp37m-win32.whl", hash = "sha256:bb0608694a91db1e230b4a314e8ed00ad07ed0c518f9a69b83af2717e31291a3"},
    {file = "psycopg2_binary-2.8.5-cp37-cp37m-win_amd64.whl", hash = "sha256:eb2f43ae3037f1ef5e19339c41cf56947021ac892f668765cd65f8ab9814192e"},
    {file = "psycopg2_binary-2.8.5-cp38-cp38-macosx_10_9_x86_64.macosx_10_9_intel.macosx_10_10_intel.macosx_10_10_x86_64.whl", hash = "sha256:07cf82c870ec2d2ce94d18e70c13323c89f2f2a2628cbf1feee700630be2519a"},
    {file = "psycopg2_binary-2.8.5-cp38-cp38-manylinux1_i686.whl", hash = "sha256:a69970ee896e21db4c57e398646af9edc71c003bc52a3cc77fb150240fefd266"},
    {file = "psycopg2_binary-2.8.5-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:7036ccf715925251fac969f4da9ad37e4b7e211b1e920860148a10c0de963522"},
    {file = "psycopg2_binary-2.8.5-cp38-cp38-win32.whl", hash = "sha256:8f74e631b67482d504d7e9cf364071fc5d54c28e79a093ff402d5f8f81e23bfa"},
    {file = "psycopg2_binary-2.8.5-cp38-cp38-win_amd64.whl", hash = "sha256:fa466306fcf6b39b8a61d003123d442b23707d635a5cb05ac4e1b62cc79105cd"},
]
second-package = []

However, after a poetry install, psycopg2 is missing in the environment. This issue does not occur on one level of nesting (e.g. psycopg2 being a dependency of second_package)

I added a zip of my minimum example if you would like to try this yourself:
poetry_dependency_bug.zip

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

Hi, I encountered the same issue. Just FYI personally I don't have this issue with 1.1.4 and 1.1.5, it starts with 1.1.6.

@bstadlbauer
Copy link
Author

Thanks @ThomasRobertFr - can confirm that downgrading to 1.1.5 (temporarily) fixes this issue

@kalyangvs
Copy link

kalyangvs commented May 29, 2021

Can confirm this issue is present in both 1.1.6 and also the pre-release 1.2.0a1 . Is this intended?
@finswimmer @abn

@kalyangvs
Copy link

kalyangvs commented May 29, 2021

Could be related issues -
#3956
#4000

@sdispater
Copy link
Member

The root cause has been identified (see #4202) and this will be fixed in the next bugfix release.

Note that you will to regenerate the lock file for the fix to take effect.

@ThomasRobertFr
Copy link

ThomasRobertFr commented Jun 29, 2021

Actually, I believe this issue has not been fixed in the 1.1.7 release. I still have the problem of having packages not being installed. And the great test case provided by @bstadlbauer still fails.

Can it be re-opened?

EDIT: I does seem to be fixed in 1.2.0a1 though.
EDIT 2: My bad, it does seem to work fine.

@bstadlbauer
Copy link
Author

@ThomasRobertFr just tried the testcase on my machine. I recreated the lockfile (rm poetry.lock && poetry lock) in the third_pacakge and it seems to work

@bstadlbauer
Copy link
Author

After a bit of additional testing it seems as even though locking works, the benefit of adding develop = true to mitigate #3368 is gone and thus updating is not an option in my case.

@ThomasRobertFr
Copy link

ThomasRobertFr commented Jul 5, 2021

My bad, I don't know what I did wrong when I tried last time, but it does seem fixed, thanks a lot for trying and letting me know @bstadlbauer

Regarding develop = true and #3368, I'm curious what problem you are encountering. I assume we have quite similar repo structure but I don't seem to have issues with poetry 1.1.7 to install my projects.

@bstadlbauer
Copy link
Author

So not all of my dependencies are on the same file system level. E.g.:

.
├── foobar
│   ├── first_package
│   │   ├── first_package
│   │   │   └── __init__.py
│   │   └── pyproject.toml
│   └── second_package
│       ├── pyproject.toml
│       └── second_package
│           └── __init__.py
└── third_package
    ├── poetry.lock
    ├── pyproject.toml
    └── third_package
        └── __init__.py

And third_package now depends on "second_package" = { path = "../foobar/second_package", develop = true }.

When doing a rm poetry.lock && poetry lock && poetry install in third_package now, you'd get a

Installing dependencies from lock file

  ValueError

  Directory ../first_package does not exist

in version 1.1.7. In version 1.1.5 this only happened when develop = false, so I used this as a workaround.

Again, a minimum example to reproduce this:
poetry_dependency_bug_2.zip

@ThomasRobertFr
Copy link

Ah ok I see! So actually your problem comes from the fact that when installing 3rd package, the relative path ../first_package from 2nd package to 1st package seems to pose problem, probably because it's applied from the 3rd package's root path and not the 2nd I guess.

I don't have this issue because I have a structure similar to your first example where all my dev packages are at the same level without the foobar additional path :/

Hope this will be fixed soon, and good luck in your projects!

@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
area/solver Related to the dependency resolver kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants