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

Have multiple platforms/python versions in the lock file #8233

Closed
2 tasks done
NeilGirdhar opened this issue Jul 24, 2023 · 3 comments
Closed
2 tasks done

Have multiple platforms/python versions in the lock file #8233

NeilGirdhar opened this issue Jul 24, 2023 · 3 comments
Labels
kind/feature Feature requests/implementations status/triage This issue needs to be triaged

Comments

@NeilGirdhar
Copy link
Contributor

NeilGirdhar commented Jul 24, 2023

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

Feature Request

Currently, the multi-platform support in Poetry is very limited, e.g. this bug illustrates how hard it is to develop on Linux and Mac using one poetry lock file: #6956.

It's also very hard to develop on multiple Python versions side-by-side (for example, if you want to test a library on multiple versions). You have switch environment, re-update and re-install.

There are also limitations to the lock file: There isn't a good way to create a lock file for a second platform. There isn't a way to create a lock file for a second Python version.

Instead of wrestling with this, how about having a matrix of builds like Travis, where each build lists a platform and Python version. When someone does poetry update, run over all of the builds and calculate a section of the lock file for that build. poetry install would use the appropriate build for the user's platform and Python version.

This would ensure that the uploaded lock file has all of the information for all of the systems. This would solve the cross-platform/cross-version support problems.

Some optimizations would be to have poetry update only update the current system, and have a poetry update all update them all (if possible).

To specify the matrix, you could have a poetry section like

[tools.poetry.matrix]
builds = [
{"platform" = "linux", "python" = "3.11"}
# ...
]

The lock file would contain one section for each element in the matrix, and nothing else. It would be an error to do poetry update with the current system not in the matrix if there is a matrix.

@NeilGirdhar NeilGirdhar added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Jul 24, 2023
@dimbleby
Copy link
Contributor

The poetry lockfile is already intended to be cross platform, so most of what you are saying is based on a misunderstanding:

  • you don't need to re-update to switch to a new environment (and no solution could remove the "switch environment and re-install" steps)
  • "there isn't a good way to create a lock file for a second platform" doesn't make sense, it's already a cross-platform lockfile
  • Your goal to "ensure that the uploaded lock file has all of the information for all of the systems" is already the goal

that's not to say that there aren't issues, of course there are. But I don't think that a significant rewrite of the sort that you are implying here is likely to help

(I also don't see a line of people queueing up to do it! but feel free to prove me wrong with a merge request...)

@NeilGirdhar
Copy link
Contributor Author

Fair enough. I guess I misunderstood the poetry internals! However, I did notice that when I switch platform and poetry update, it gives me all different hashes for my packages. So it seems like it's replacing its lock file information rather than stashing the new platform's information in a different section of the lock file.

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 status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants