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

Deterministic installations from packages #5449

Closed
2 tasks done
0x64746b opened this issue Apr 14, 2022 · 8 comments
Closed
2 tasks done

Deterministic installations from packages #5449

0x64746b opened this issue Apr 14, 2022 · 8 comments
Labels
kind/feature Feature requests/implementations

Comments

@0x64746b
Copy link

0x64746b commented Apr 14, 2022

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the documentation and believe that my question is not covered.

Feature Request

Hi y'all,

I built a simple application that I would like to package, so that when deployed (in my case installed into a Docker image) I don't have to manually copy source files into the file system, but can rely on the package manager to handle standard compliant placement (scripts in $PATH, importable modules in $PYTHONPATH).

However, when packaging my code, the .lock file seems to be ignored (the same way setuptools would do), and the METADATA in the *.dist-info/ dir only list the direct dependencies specified in the project toml. This means that any installation not happening from the source, but from a derived wheel, will be non-deterministic, losing all associated benefits.

Since poetry already resolved and pinned the transitive dependencies of the project, I think it would be great if the build command could be instructed to replace the direct dependencies (which usually contain ranges of accepted versions) listed in the project toml with all the materialized pinned versions from the .lock file.

This way, easily distributable packages could still produce deterministic installations (obviously that would put the burden of avoiding version conflicts in the target environment through some means of isolation onto the consumer).

Thanks for considering and the sleek tool
dtk

@0x64746b 0x64746b added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Apr 14, 2022
@MokarromHossainTR
Copy link

+1
I'm having the same issue. It would be a great feature if poetry build command respects .lock file while writing dependency in the METADATA.

@gsemet
Copy link

gsemet commented Jul 1, 2022

I propose this as an option —frozen-wheel

@gsemet
Copy link

gsemet commented Jul 1, 2022

I would still recommend to put it as option, and potentially give a different package name, since the generated package is not pip installable in an existing environment. Basically two different « frozen » app cannot live in the same environment since there are good chances that one at least of their deps will be pinned differently.

coupled with pipx however this would be perfect !

@0x64746b
Copy link
Author

the generated package is not pip installable in an existing environment. Basically two different « frozen » app cannot live in the same environment

Just to be nitpicky here: the generated packages conceptually are installable into an existing environment (e. g. an empty one ;)), and two different frozen apps can be installed into the same environment (iff they don't contain different versions of the same dependency). Practically, that may or may not be an issue, which is why I argue for providing such an option 👍

@gsemet
Copy link

gsemet commented Jul 11, 2022

We are talking about the following problems:

  • even if a correct version of a given shared dependencies CAN be found if both application are installed in the same “pip install”, people usually do not do that and install app when they need it. So your new application can install a version of a dependencies the other apps tells it does not want, and pip won’t notice.
  • When the second “pip install” occurs, a new version of a dependency can be installed and broke the other app that was perfectly working so far.
  • Package maintainer MAY not follow semver or pep440, so even the version range of each lib SHOULD NOT be trusted.

trust me. Everything is simpler when each app is it its own venv. And since it is optional, you do not have to use it if you feel everything I have told does not apply to you.

@BrandonLWhite
Copy link

Same as #2331

@finswimmer
Copy link
Member

Duplicate of #2778

@finswimmer finswimmer marked this as a duplicate of #2778 Sep 5, 2022
@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Sep 5, 2022
@mkniewallner mkniewallner removed the status/triage This issue needs to be triaged label Sep 18, 2022
Copy link

github-actions bot commented Mar 1, 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 1, 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

7 participants