poetry-core fails to install package with path dev dependency

Created on 19 Nov 2020  路  3Comments  路  Source: python-poetry/poetry

  • [x] I am on the latest Poetry version.
  • [x] 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: Windows 10

  • Poetry version: poetry-core 1.0.0
  • Link of a Gist with the contents of your pyproject.toml file: copied below, as it is very short
[tool.poetry]
name = "pip-install-dev-error"
version = "0.1.0"
description = ""
authors = []

[tool.poetry.dependencies]
python = "*"

[tool.poetry.dev-dependencies]
test = {path = "../something-only-for-devs", develop=true}

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

Issue

Packages with path dependencies in [tool.poetry.dev-dependencies] cannot be installed by pip.

When trying to install it, prepare_metadata_for_build_wheel in poetry-core tries to resolve development dependencies, even though they are not going to be installed, and this fails with ValueError: Directory ..\something-only-for-devs does not exist.

At this point, I don't think it make any sense to try to resolve development dependencies. In the example above, it is a path dependency that doesn't exist for users installing the package (actually, the path existing or not doesn't matter, since poetry-core won't find it anyway, not even with --no-build-isolation - not sure why though), however, there can be other reasons for a development dependency to fail to resolve (e.g. private repo) that shouldn't matter for users installing the package.

Bug Triage

All 3 comments

Is that a duplicate of https://github.com/python-poetry/poetry/issues/2174?

If yes, @absassi would you mind trying the fix at https://github.com/python-poetry/poetry-core/pull/101 if you get a chance?

Yes, I believe it is a duplicate. Thanks for finding it.

I'll give it a try as soon as possible, but looking at the diff, it seems that it will fix this.

It works with current master of poetry-core. Thanks again @sinoroc .

Was this page helpful?
0 / 5 - 0 ratings