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

Add flag to poetry add to allow the installation of the latest compatible version #9462

Closed
nbro opened this issue May 31, 2024 · 5 comments
Closed
Labels
kind/feature Feature requests/implementations status/triage This issue needs to be triaged

Comments

@nbro
Copy link
Contributor

nbro commented May 31, 2024

Issue Kind

Brand new capability

Description

If you do poetry add django, poetry will try to install the latest version of django. However, if the latest version of django is not compatible with other dependencies or the Python version, you will get an error and poetry will not add django to pyproject.toml or install it in the virtual environment.

Often, we don't care about installing the latest version. We just want to install the latest version that is compatible with other libraries and the Python versions.

So, poetry add should have a flag that allows us to do this easily.

I'd be very surprised if this was never requested, so I'd assume that this will be a duplicate of an old issue.

Impact

It will simplify our life.

Workarounds

Right now, the only workaround I know is unnecessarily complicated

  1. poetry add "django@*" --dry-run
  2. Check the output to see what version would be installed (say it's 5.0.6)
  3. Install the version with poetry add "django@^5.0.6"

So, basically, I'm asking that a flag like --latest-compatible or -l (or any other better name) is added to poetry add that would automatically do the 3 steps above.

Clearly, I don't want to do just poetry add "django@*", because I actually care about having a specific version or set of versions - I don't want my pyproject.toml to allow any version.

@nbro nbro added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels May 31, 2024
@dimbleby
Copy link
Contributor

I'd be very surprised if this was never requested, so I'd assume that this will be a duplicate of an old issue.

#707 and many others please close

@nbro
Copy link
Contributor Author

nbro commented May 31, 2024

@dimbleby This is not a duplicate of the linked issue, at least not of the original post, although they are somehow related and the general issue is described in this comment. Maybe you can find a closer issue? Anyway, here basically I am suggesting the addition of a flag not change the default behavior of poetry add, which some people in the comments there seem to be suggesting.

@dimbleby
Copy link
Contributor

dimbleby commented Jun 1, 2024

It's all the same. You are seeing the exact problem described there, your suggestion is at best a minor variation on existing suggestions. No point in opening a new issue for every such idea, just leave a comment in the already open issue.

This is one of the older open issues, clearly no one has yet found it worthwhile to do anything about it. So if you want to see something happen, recommend that doing it yourself and submitting a pull request is the most likely way.

@finswimmer
Copy link
Member

Duplicate of #707

@finswimmer finswimmer marked this as a duplicate of #707 Oct 28, 2024
@finswimmer finswimmer closed this as not planned Won't fix, can't repro, duplicate, stale Oct 28, 2024
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 Nov 28, 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

3 participants