python-poetry / python-poetry/poetry

Depending on resolved version of another dependency

Open
#8,499 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/feature status/triage
Dominant language
Python
Stars
34.3k
Forks
2.5k
Avg merge
2d 19h
Merged PRs (30d)
30

Description

  • 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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by reviewing Poetry's dependency resolution behavior and dependency specification documentation, then model the Pydantic 1.10 versus 2.x cases; done means a tested resolution mechanism or a clearly accepted alternative.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.