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

Depending on resolved version of another dependency #8499

Open
2 tasks done
Tander opened this issue Oct 3, 2023 · 0 comments
Open
2 tasks done

Depending on resolved version of another dependency #8499

Tander opened this issue Oct 3, 2023 · 0 comments
Labels
kind/feature Feature requests/implementations status/triage This issue needs to be triaged

Comments

@Tander
Copy link

Tander commented Oct 3, 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

I admit my case is very rare, but it would be nice to have a way to resolve it somehow.

I write a package that must support both Pydantic 1.10 and Pydantic 2.x. So I specify my dependency as pydantic = ">1.10". The thing is, in Pydantic 2.x they moved BaseSettings class to separate pydantic-settings package. And this is a problem, because i can't find in Poetry how to specify installing pydantic-settings only if pydantic was resolved to 2.x

The idea is, if user of package depends on Pydantic 1.10 (directly or through another dependency), my package should use 1.10, otherwise it should use 2.x + pydantic-settings

I probably could try to use extras or even split packages completely, if there is a way to avoid it - I'd be glad!

@Tander Tander added kind/feature Feature requests/implementations status/triage This issue needs to be triaged labels Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Feature requests/implementations status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant