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 path dependency does not work with pip install -e #6751

Closed
wieczyk opened this issue Oct 9, 2022 · 9 comments
Closed

Poetry path dependency does not work with pip install -e #6751

wieczyk opened this issue Oct 9, 2022 · 9 comments
Labels
status/duplicate Duplicate issues

Comments

@wieczyk
Copy link

wieczyk commented Oct 9, 2022

I am not sure if I understand purpose of directory/path dependencies in poetry. They seems great to structurize application, but it seems they do not work with anything. (To make correct wheels I wrote my own plugin for poetry).

Today I encountered yet another issue related to path dependencies. They disallow project to be installed in editable mode via pip.

Output from poetry debug

wieczyk@tortilla:/tmp/z/b$ poetry debug info

Poetry
Version: 1.2.1
Python:  3.10.6

Virtualenv
Python:         3.10.6
Implementation: CPython
Path:           /home/wieczyk/.cache/pypoetry/virtualenvs/b-JuwRG7ex-py3.10
Executable:     /home/wieczyk/.cache/pypoetry/virtualenvs/b-JuwRG7ex-py3.10/bin/python
Valid:          True

System
Platform:   linux
OS:         posix
Python:     3.10.6
Path:       /home/wieczyk/.pyenv/versions/3.10.6
Executable: /home/wieczyk/.pyenv/versions/3.10.6/bin/python3.10

Steps to reproduce:

$ poetry new a
$ poetry new b
$ cd b
$ poetry add ../a
$ pip install -e .

pip._vendor.pkg_resources.RequirementParseError: Invalid URL: ../a

If this is invalid usage of path dependencies, then could we extend documentation what is purpose of them? They do not work correctly with building wheel, do not work with pip install -e. With what they work normally?

@wieczyk wieczyk added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 9, 2022
@wieczyk
Copy link
Author

wieczyk commented Oct 9, 2022

I found workaround that is fine for me: pip install -e . --no-deps

@dimbleby
Copy link
Contributor

dimbleby commented Oct 9, 2022

unclear what you're tring to do - why are you pip install-ing your poetry project and not poetry install-ing it?

If you want an editable path dependency, configure it that way - https://python-poetry.org/docs/dependency-specification/#path-dependencies

@wieczyk
Copy link
Author

wieczyk commented Oct 9, 2022

I am not installing dependency to project, but installing the project itself using feature named editable-install.

According to: #34 (comment) poetry supports PEP660 editable installs.

@dimbleby
Copy link
Contributor

dimbleby commented Oct 9, 2022

I am not installing dependency to project

this is not consistent with either your issue title or the repro that you give. You are adding the path dependency a to the project b

but installing the project itself using feature named editable-install.

The question I asked was: why? Just poetry install instead?

@wieczyk
Copy link
Author

wieczyk commented Oct 9, 2022

I have feeling you are trying to enforce some workflow you have in your head instead of focusing on bug.
I am not interested in installing package itself in venv used by poetry to build package. I am interested in installing the package I am developing in my environment using PEP660 editable install. Thus pip install -e ., not poetry install.

The description is consistent, package b has path dependency and cannot be installed.

@dimbleby
Copy link
Contributor

dimbleby commented Oct 9, 2022

I am trying to solve whatever problem it is that you have. If you want an editable install of your poetry project, the expected way to do that is poetry install. So the suggestion is that you do that.

If poetry install doesn't work, then that's likely to attract attention and be something that maintainers will want to address.

If poetry install does work, then I doubt you will find much interest in "make pip install -e . work when there's a path dependency"

@dimbleby
Copy link
Contributor

dimbleby commented Oct 9, 2022

Anyway, duplicate #5273 - which makes it clear that the problem is relative paths

@wieczyk
Copy link
Author

wieczyk commented Oct 9, 2022

I will not repeat myself that poetry install is not equivalent.

Closing ticket since you have found duplicate.

@wieczyk wieczyk closed this as completed Oct 9, 2022
@neersighted neersighted added status/duplicate Duplicate issues and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 9, 2022
@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Oct 9, 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
status/duplicate Duplicate issues
Projects
None yet
Development

No branches or pull requests

3 participants