Poetry: editable mode installation with poetry v1.1.4 leads to raise of incompatibility assertion

Created on 28 Oct 2020  ยท  6Comments  ยท  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.
  • [x] If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

Issue

I tried to create a venv with the project installed in editable mode by adding

[tool.poetry.dependencies]
mvp-end-device-agent = { "path" = ".", develop = true }

to my pyproject.toml.

My poetry.toml looks like this (creates the venv in the project directory mvp-end-device-agent/.venv):

[virtualenvs]
in-project = true

If I try to create the venv I get this:

D:\mvp-end-device-agent>poetry install
Updating dependencies
Resolving dependencies...

  AssertionError



  at d:\python\python386\lib\site-packages\poetry\mixology\incompatibility.py:60 in __init__
       56โ”‚                     # intersection, they're mutually exclusive, making this incompatibility
       57โ”‚                     # irrelevant, since we already know that mutually exclusive version
       58โ”‚                     # ranges are incompatible. We should never derive an irrelevant
       59โ”‚                     # incompatibility.
    โ†’  60โ”‚                     assert by_ref[ref] is not None
       61โ”‚                 else:
       62โ”‚                     by_ref[ref] = term
       63โ”‚
       64โ”‚             new_terms = []

The -vvv output version can be found here: https://gist.github.com/fkromer/8503fa348631c02ec8748e819938c8ad .

It seems like there is a conflict between the implicit installation of the project/root package as stated in the the command line help (--no-root option)

D:\mvp-end-device-agent>poetry install -h
USAGE
  poetry install [--no-dev] [--no-root] [--dry-run] [--remove-untracked] [-Eย <...>]

OPTIONS
  --no-dev               Do not install the development dependencies.
  --no-root              Do not install the root package (the current project).
  --dry-run              Output the operations but do not execute anything (implicitly enables --verbose).
  --remove-untracked     Removes packages not present in the lock file.
  -E (--extras)          Extra sets of dependencies to install. (multiple values allowed)

GLOBAL OPTIONS
  -h (--help)            Display this help message
  -q (--quiet)           Do not output any message
  -v (--verbose)         Increase the verbosity of messages: "-v" for normal output, "-vv" for more verbose output and "-vvv" for debug
  -V (--version)         Display this application version
  --ansi                 Force ANSI output
  --no-ansi              Disable ANSI output
  -n (--no-interaction)  Do not ask any interactive question

DESCRIPTION
  The install command reads the poetry.lock file from
  the current directory, processes it, and downloads and installs all the
  libraries and dependencies outlined in that file. If the file does not
  exist it will look for pyproject.toml and do the same.

  poetry install

  By default, the above command will also install the current project. To install only the
  dependencies and not including the current project, run the command with the
  --no-root option like below:

   poetry install --no-root

and the explicit installation via the pyproject.toml.

Bug Triage

All 6 comments

By default poetry installs your project (poetry calls it the root project) as editable.

There should be no need for such a dependency:

[tool.poetry.dependencies]
mvp-end-device-agent = { "path" = ".", develop = true }

I would recommend to remove that line entirely.

@sinoroc That's what I thought too. If you browse through the poetry issues you'll find out that there is a lot of ambiguity w.r.t. the topic "editable mode". And the ambiguity relates to different versions of poetry and other configurations (like the OS) as well.

@fkromer I am not following what you are implying. Where do you see ambiguity?

Is your issue solved, when you remove the following line?

mvp-end-device-agent = { "path" = ".", develop = true }

A project can not be a dependency of itself. This does not make sense to me. So I think that line should be removed. What lead you to add it? Did you encounter a situation that pushed you towards this?

@sinoroc

[tool.poetry.dependencies]
mvp-end-device-agent = { "path" = ".", develop = true }

Of course this does not make sense. However given my Windows 10 + VSCode + vscode-python extension + poetry setup I was not able to get debugging of a console script based CLA working yet. Until now I was happy with debugging poetry managed CLAs with debuggers like pdbpp. However given the fact that I depend on being able to watch a lot of data in parallel and over time now there is no way around a IDE based debugger. If one is desperate one tries everything possible. ๐Ÿ˜„ In this case questionable hint from stackoverflow. However you are right that it is an integration issue, probably no poetry specific one.

However given my Windows 10 + VSCode + vscode-python extension + poetry setup I was not able to get debugging of a console script based CLA working yet. Until now I was happy with debugging poetry managed CLAs with debuggers like pdbpp. However given the fact that I depend on being able to watch a lot of data in parallel and over time now there is no way around a IDE based debugger. If one is desperate one tries everything possible. smile In this case questionable hint from stackoverflow. However you are right that it is an integration issue, probably no poetry specific one.

I see :/
Seems complicated. Good luck :D

@sinoroc It probably is ๐Ÿ˜„. Thanks a lot.

Was this page helpful?
0 / 5 - 0 ratings