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

Poetry fails if a local dep is missing while only defined as extra #3936

Closed
3 tasks done
ClementWalter opened this issue Apr 13, 2021 · 7 comments
Closed
3 tasks done
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@ClementWalter
Copy link

Checklist

  • 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: Mac OS 10.15.7 (19H524)

  • Poetry version: Poetry version 1.1.5

  • Link of a Gist with the contents of your pyproject.toml file:

[tool.poetry]
name = "tmp-1"
version = "0.1.0"
description = ""
authors = ["Clement Walter <[email protected]>"]

[tool.poetry.dependencies]
python = "^3.7"
tmp-0 = {path = "../tmp-0", optional = true, develop = true}

[tool.poetry.extras]
tmp0 = ["tmp-0"]

[tool.poetry.dev-dependencies]

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

Issue

Poetry does not manage to handle missing deps defined as extra, even though a complete poetry.lock exists and has been generated previously.

Workflow to generate the error:

  • create an dummy project in tmp-0
  • create tmp-1 project. Add tmp-0 as extra deps as above.
  • poetry env remove python && rm -rf ../tmp-0 to start over fresh
  • poetry install fails
> poetry install
  ValueError

  Directory ../tmp-0 does not exist

@ClementWalter ClementWalter added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Apr 13, 2021
@ClementWalter
Copy link
Author

ClementWalter commented Apr 13, 2021

The use case is: I am working on two packages simultaneously with the second one depending on the first one. When I am developing, I want to have the tmp-0 I am working on installed in develop mode, but elsewhere a true dep declared as any other

@Wirg
Copy link

Wirg commented Apr 14, 2021

Hi !

I am running in the same issue with optionable path to wheels (like prodi.gy ones) without develop mode.
I think all commands requiring the pyproject.toml fail :

  • poetry install even without the extra
  • poetry config

Expected results

Everything works without checking the path.
poetry install -E poetry fails if the user does not have the required files.
I am not clear on the process for poetry update, but I think it may be normal to require the paths locally.

Error log

  ValueError
  Directory does not exists
  at ~/.poetry/lib/poetry/_vendor/py3.8/poetry/core/packages/directory_dependency.py:41 in __init__
       37│         self._develop = develop
       38│         self._supports_poetry = False
       39│
       40│         if not self._full_path.exists():
    →  41│             raise ValueError("Directory {} does not exist".format(self._path))
       42│
       43│         if self._full_path.is_file():
       44│             raise ValueError("{} is a file, expected a directory".format(self._path))

Note : it's probably related to the poetry.lock has it fails after changing the pyproject.toml

Snippet

[tool.poetry.dependencies]
prodigy = [
    {path = "./data/prodigy_wheels/prodigy-1.10.8-cp36.cp37.cp38-cp36m.cp37m.cp38-win_amd64.whl", markers = "sys_platform == 'win32'", optional = true},
    {path = "./data/prodigy_wheels/prodigy-1.10.8-cp36.cp37.cp38-cp36m.cp37m.cp38-linux_x86_64.whl", markers = "sys_platform == 'linux'", optional = true},
    {path = "./data/prodigy_wheels/prodigy-1.10.8-cp36.cp37.cp38-cp36m.cp37m.cp38-macosx_10_14_x86_64.whl", markers = "sys_platform == 'darwin'", optional = true},
]
[tool.poetry.extras]
prodigy = ["prodigy"]

@Wirg
Copy link

Wirg commented Apr 29, 2021

Hi,

Bumping this as gently as possible :)

I am still blocked by this : I have the lines commented in my pyproject.toml and have to explicitely ask people to uncomment, update, and run the install in the docs.

Is this something I could help poetry on or would the fix be too complex ?

@Wirg
Copy link

Wirg commented Sep 20, 2021

Hi !

Any updates on this ? :)

@AntiCompositeNumber
Copy link

Sounds like a duplicate of #2091

@finswimmer
Copy link
Member

Duplicate of #668

@finswimmer finswimmer marked this as a duplicate of #668 Oct 7, 2022
@finswimmer finswimmer closed this as not planned Won't fix, can't repro, duplicate, stale Oct 7, 2022
Copy link

github-actions bot commented Mar 1, 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 1, 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 status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

4 participants