8000 Make bzlmod pip.parse use `python_version` to drive interpreter selection, dependency resolution, et al · Issue #1268 · bazel-contrib/rules_python · GitHub
[go: up one dir, main page]

Skip to content
Make bzlmod pip.parse use python_version to drive interpreter selection, dependency resolution, et al #1268
Closed
@rickeylev

Description

@rickeylev

Right now, pip.parse uses a combination of the provided interpreter and python_version to figure out all the things it needs to do.

  • The interpreter is used for running pip. This is unfortunately required until we can decouple dependency resolution from the interpreter being used.
  • The python version is used to generate aliases, select expressions, and version-specific repo names. This is all mostly working as desired.

In PR #1254, some additional logic was added to infer python_version from the interpreter label (based upon our internal naming conventions). This makes configuring pip.parse a bit easier, as the python_version arg doesn't need to be provided (so 1 less line), however, it still requires the users to use the interpreter extension (adds ~8-10 lines).

If we changed the logic to infer the interpreter from the python version, this would eliminate the need for the interpreter extension. (Note: this was originally proposed by Ignas elsewhere)

This also better represents the user's intent. They want to resolve dependencies for e.g. Python 3.10; the exact mechanism (e.g. interpreter) isn't relevant. This is relevant to Phil's work to decouple dependency resolution from the interpreter being used.

This would probably also enable multi-version requirements files using env markers, so now users don't have to have a separate requirements file for every version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0