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 install not removing previous version of package under development #3741

Closed
2 tasks done
ghost opened this issue Mar 1, 2021 · 3 comments
Closed
2 tasks done
Labels
kind/bug Something isn't working as expected

Comments

@ghost
Copy link

ghost commented Mar 1, 2021

Issue

When I bump the version of the package I'm developing (e.g. with python version minor), and run poetry install, then I end up with multiple versions of it in $(poetry env info -p)/lib/python3.7/site-packages, e.g.

mypackage.pth
mypackage-0.1.0a1.dist-info
mypackage-0.1.0a2.dist-info
mypackage-0.1.0.dist-info
mypackage-0.2.0.dist-info

My expectation is that poetry install would declaratively install the version that is currently defined in pyproject.toml, and remove other versions.

Is this expectation incorrect? I don't see a poetry clean type command; maybe there is another intended way to bump versions.

Here's a setup that reproduces (not quite portable): https://github.com/ns-admetrics/poetry-version-bumping/blob/main/playbook.sh

For prereleases at least (0.1.0-alpha.N), it seems a bit undeterministic what is seen as "the installed package version" then, e.g. what `pip uninstall mypackage` removes, but also the [recommended approach](https://github.com//pull/2366#issuecomment-652418094) to deal with `__version__` redundancy breaks. This latter might be an upstream bug in `importlib_metadata`; when there's 0.1.0a1, 0.1.0a2 and 0.1.0, then 0.1.0a1 is picked -- mentioning only for context.
@ghost ghost added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Mar 1, 2021
@finswimmer
Copy link
Member

I guess this a duplicate of #2855, is it?

@ghost
Copy link
Author

ghost commented Mar 1, 2021

Right, my issue search foo failed me spectacularly, apologies. Time to fix this (linked draft PR) :)

@ghost ghost closed this as completed Mar 1, 2021
@abn abn removed the status/triage This issue needs to be triaged label Mar 3, 2022
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
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

2 participants