poetry icon indicating copy to clipboard operation
poetry copied to clipboard

package.to is not respected when adding editable (develop=true) dependency

Open salembream opened this issue 3 months ago • 2 comments

Description

when adding a local dependency as editable the installation is not following the package.to option.

to reproduce the issue, please clone this repo: https://github.com/salembream/editable_bug_poetry_

then test as below

cd check_packages

poetry install
poetry shell

python ./run_check.py

notice the non_editable package works fine, while the editable one fails.

Hello from non_editable_module
Traceback (most recent call last):
  File "D:\temp\testeditable\check_packages\run_check.py", line 5, in <module>
    from dist_name.editable.editable_module import editable_module
ModuleNotFoundError: No module named 'dist_name.editable'

Workarounds

not directly thru poetry, but I think we can have the required behavior by using symlinks when installing editable dependency which defines package.to

Poetry Installation Method

pipx

Operating System

Windows 11

Poetry Version

1.8.3

Poetry Configuration

experimental.system-git-client = false
installer.max-workers = null
installer.modern-installation = true
installer.no-binary = null
installer.parallel = true
keyring.enabled = true
solver.lazy-wheel = true
virtualenvs.create = true
virtualenvs.in-project = null
virtualenvs.options.always-copy = false
virtualenvs.options.no-pip = false
virtualenvs.options.no-setuptools = false
virtualenvs.options.system-site-packages = false
virtualenvs.path = "{cache-dir}\\virtualenvs"  # C:\Users\salem\AppData\Local\pypoetry\Cache\virtualenvs
virtualenvs.prefer-active-python = false
virtualenvs.prompt = "{project_name}-py{python_version}"
warnings.export = true

Python Sysconfig

No response

Example pyproject.toml

[tool.poetry]
packages = [{ include = "./**/*.py" }]
name = "check_packages"
version = "1"
description = "check_packages"
authors = ["author"]

[tool.poetry.dependencies]
python = "^3"
editable = { path = "../editable", develop = true }
non_editable = { path = "../non_editable" }

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

Poetry Runtime Logs

N/A

salembream avatar Nov 22 '24 14:11 salembream