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

Unconditional reinstallation of packages #7106

Closed
OceanManOne opened this issue Nov 27, 2022 · 7 comments
Closed

Unconditional reinstallation of packages #7106

OceanManOne opened this issue Nov 27, 2022 · 7 comments
Labels
kind/feature Feature requests/implementations

Comments

@OceanManOne
Copy link

  • [ x ] I have searched the issues of this repo and believe that this is not a duplicate.
  • [ x ] I have searched the FAQ and general documentation and believe that my question is not already covered.

Feature Request

I'm using poetry to install my package which is built on pypi packages and local packages (using {path = '../../lib'}) where the local packages versions aren't updating.

If I change some local package code and run poetry install for the 2nd time, poetry doesn't detect a change and says: "No dependencies to install or update"

I would like to be able to specify which packages to re-install (through groups or any other method) even if exist to allow both using the existing pypi cache but also to update my local packages code.

@OceanManOne OceanManOne added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Nov 27, 2022
@dimbleby
Copy link
Contributor

sounds like you maybe wanted to install your local path packages in editable mode?

nb per #7088 you'll have to recreate your virtual environment when you make that change.

@OceanManOne
Copy link
Author

OceanManOne commented Nov 27, 2022

sounds like you maybe wanted to install your local path packages in editable mode?

nb per #7088 you'll have to recreate your virtual environment when you make that change.

The problem is that I can't use develop = true as I'm using the following flag:
poetry config virtualenvs.in-project true

to output a "build" directory to be used as a full code app in a docker container.
If I use develop = true it won't copy the actual local package code but just reference to it (and I can't copy the local package itself as it is mixed with other non related local packages).

I saw there is a content-hash value in the poetry.lock file but it only shows on the pypi packages and not local ones so I'm assuming it doesn't update them on code change because it doesn't re-calculate the content-hash of that package to see if update is needed.

@neersighted
Copy link
Member

I think we've got some X-Y problem here: what you want to achieve for Docker image building (side-note: you should build in a Dockerfile and not bind-mount in a virtual environment from the host -- unless you ensure symmetric glibc/Python/distro versions, things will break) is possible once python-poetry/poetry-plugin-bundle#37 is fixed.

Regarding your other ask, it should be addressed by #6843 but is not in a released version yet.

@OceanManOne
Copy link
Author

OceanManOne commented Nov 27, 2022

I think we've got some X-Y problem here: what you want to achieve for Docker image building (side-note: you should build in a Dockerfile and not bind-mount in a virtual environment from the host -- unless you ensure symmetric glibc/Python/distro versions, things will break) is possible once python-poetry/poetry-plugin-bundle#37 is fixed.

Regarding your other ask, it should be addressed by #6843 but is not in a released version yet.

Thanks for the reply, I've actually tested the #6843 fix by using the latest master but it doesn't seem to fix my issue,
running poetry install again for the 2nd time and changing some of the local packages doesn't re-trigger a re-installation / update of the package code.
And there is still no hash value in the poetry.lock file for local packages so I'm not sure if it intended for my use.

I've also tried the poetry plugin bundle yesterday and it looks great but I had an issue where it doesn't work with local package referencing other local package, I've actually opened a issue regarding that:
Issue #40

@neersighted
Copy link
Member

Right, that doesn't refresh code, but it refreshes metadata. Combined with develop = true, it does what you want.

The solution I am suggesting is to make develop = true work for your use case, by making bundle work as intended (create a 'portable as possible' venv).

I don't think this ask makes much sense, instead solving the deficiencies in tools intended to serve this use case makes more sense.

@neersighted
Copy link
Member

Looks like this user also created a discussion post with the same content; given that detecting code-only changes is fraught and always reinstalling (requiring a potentially expensive build) is also fraught, I'm going to close this and suggest discussion can continue there: https://github.com/orgs/python-poetry/discussions/7105.

@neersighted neersighted removed the status/triage This issue needs to be triaged label Nov 27, 2022
@neersighted neersighted changed the title Allow poetry to re-install certain packages Unconditional reinstallation of packages Nov 27, 2022
@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2022
Copy link

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 Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Feature requests/implementations
Projects
None yet
Development

No branches or pull requests

3 participants