Skip to content

Editable Installer: Handle changes cleanly #2855

@abn

Description

@abn

Today, the editable installer (poetry>1.0.10), does not handle removals of files (includes, console scripts etc.) cleanly. This needs to be improved.

There are two potential approaches,

  1. Handle the delta manually by using the *.dist-info/RECORD csv file. We could load the list prior to new install and then identify the delta after installation.
  2. Uninstall editable package explicitly (this today might need to use pip until poetry has an internal mechanism) prior to installation again. This might be cleaner as this should separate the concerns cleanly.

Reproduction

This issue can be reproduced as follows.

poetry new foo
pushd foo
sed -i /pytest/d pyproject.toml
echo 'def main(): print("hello world")' >> foo/__init__.py
printf '\n\n[tool.poetry.scripts]\nhello = "foo:main"' >> pyproject.toml
poetry install
sed -i s/hello/world/g pyproject.toml
poetry install

Today, once this is done, the following happens.

$ poetry run type hello
hello is /tmp/foo/.venv/bin/hello

We expect this to happen.

$ poetry run type hello
/usr/bin/type: line 2: type: hello: not found

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/installerRelated to the dependency installerkind/enhancementNot a bug or feature, but improves usability or performance

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions