Skip to content

Allow setting Python resolve interpreter_constraints as defaults for targets #22574

@ndellosa95

Description

@ndellosa95

Is your feature request related to a problem? Please describe.
Most Python targets have separate interpreter_constraints and resolve fields. Resolves themselves also have interpreter constraints set in pants.toml. By default, the interpreter_constraints on Python targets defaults to the [python].interpreter_constraints field in pants.toml. However, if you have multiple resolves with different interpreter constraints, you now have to set the interpreter constraints on each Python source file to be a subset of the constraints of its resolve.

Describe the solution you'd like
There should be an option in the Python subsystem to allow Python targets with a resolves field to fall back to the interpreter constraints of their resolve instead of the global constraints.

Describe alternatives you've considered
I use a macro to make the resolve constraints and source file constraints match today, but this means constraints must be updated and match in multiple spots instead of just having pants.toml as the single source of truth.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions