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

Editable Installer: Handle changes cleanly #2855

Closed
abn opened this issue Aug 26, 2020 · 5 comments · Fixed by #3900
Closed

Editable Installer: Handle changes cleanly #2855

abn opened this issue Aug 26, 2020 · 5 comments · Fixed by #3900
Labels
area/installer Related to the dependency installer kind/enhancement Not a bug or feature, but improves usability or performance

Comments

@abn
Copy link
Member

abn commented Aug 26, 2020

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
@abn abn added area/installer Related to the dependency installer kind/enhancement Not a bug or feature, but improves usability or performance Good First Issue labels Aug 26, 2020
@bhallaY
Copy link

bhallaY commented Sep 12, 2020

Hi, I would like to attempt to resolve this issue! I can try to follow way 2 you specify.

@finswimmer
Copy link
Member

Hello @bhallaY ,

do you still like to work on this issue?

fin swimmer

@akeeman
Copy link
Contributor

akeeman commented Nov 5, 2020

Just to be complete, as #3289 mentions, a set of related reproduction steps:

# assuming poetry 1.1.4, in-project venv, and python 3.8:
poetry new foo
cd foo
poetry install
poetry version minor
poetry install

then

ls .venv/lib/python3.8/site-packages/foo-*.dist-info

outputs something similar to

.venv/lib/python3.8/site-packages/foo-0.1.0.dist-info:
INSTALLER  METADATA  RECORD

.venv/lib/python3.8/site-packages/foo-0.2.0.dist-info:
INSTALLER  METADATA  RECORD

Therefore

poetry run python -c "from importlib.metadata import version; print(version('foo'))"

outputs

0.1.0

instead of the expected

0.2.0

.venv/lib/python3.8/site-packages/foo-0.1.0.dist-info should have been removed.

@abn
Copy link
Member Author

abn commented Apr 14, 2021

Resolved by: #3900

Copy link

github-actions bot commented Mar 2, 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 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/installer Related to the dependency installer kind/enhancement Not a bug or feature, but improves usability or performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants