Mechanism to reinstall (editable) dependencies to trigger metadata re-build
See original GitHub issue- Poetry version: 1.2.1
- Python version: 3.8.10
- OS version and name: Ubuntu 21.04
- I am on the latest stable Poetry version, installed using a recommended method.
- I have searched the issues of this repo and believe that this is not a duplicate.
- I have consulted the FAQ and blog for any relevant entries or release notes.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option) and have included the output below.
Issue
When developing a project distributed over many repos that is connected by entrypoint plugins, consider that repo B depends on repo A, and thus contains:
repo-a = { path = "../repo-a/", develop = true }
Sometimes I need to change some entrypoints in repo-a
.
For poetry to pick up the changes, I run poetry update repo-a
(of course it can’t otherwise know).
Unfortunately, it won’t update entrypoints, so repo-b
still sees the old ones (according to importlib_metadata
, which I use to collect them).
The only workaround I know of is to:
- comment out the dependency
- run
poetry update
- comment in the dependency
- run
poetry update
Which causes a lot of useless package removal and re-installations, but in the end repo-a
is registered correctly.
I am not sure whether this should be a feature request or a bug, but chose bug because to me this is “unexpected behavior”.
I expect poetry to pick up these changes for local dependencies when I ask to update
, even if nothing else about the dependency changed. The fact that it is “blind” to them violates the purpose of having a local dependency (with develop = True
) - making it as painless as possible to simultaneously work on multiple related repositories.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (2 by maintainers)
Thanks for the quick response!
Yes, I totally agree and this is what I meant. I do not expect that poetry checks the metadata when calling
poetry install / update
without listing packages or providing any flags. I was just thinking about it purely from the “local dependency angle”, which was maybe not the best way, because it would need to treat different dependency “types” differently.I totally agree with your reformulation of the issue as a request for a
--reinstall
flag.--only
pyproject.toml
of the projectGiven that, I could simply use
poetry install --reinstall
and it would reinstall all immediate dependencies, or if they are too many, I could separate the ones where this is needed into a group and single them out with--only
, if needed - as you suggested.Or it could be added as a flag to
poetry update
, which does already accept package names as arguments, so that I could usepoetry update --reinstall PACKAGENAME(S)
, but maybe that is a bit “strange”. In this case it would mean “update my dependencies, and even if they are up to date, reinstall the packages”. I would actually prefer this over needing the--only
group becauseinstall
does not take packages as arguments.Unfortunately I don’t think that I can properly add that feature myself, at least not in the spare time that I could invest into it 😦
Looks like we’ve actually got a FR for this already at https://github.com/python-poetry/poetry/issues/5183.