Skip to content

Don't require a pip.parse call for the default python version  #1320

@rickeylev

Description

@rickeylev

There's a check in pip.bzl that requires that each pip hub have a call with the default python version. This should be removed because a child doesn't necessarily need anything setup for the default python version. If it uses the version-aware rules, then it won't be affected by what the default is.

While it's likely the child module isn't using the version-aware rules, we don't know one-way or the other during extension execution. So we'll just have to assume the MODULE author knows what they're doing. The failure mode in this case is dependencies will be resolved for e.g. Python 3.9, but at runtime, the targets will use e.g. Python 3.10. 🤷 oh well.

edit: I think there's a second problem, too: a child module doesn't have a way to satisfy both the "one call per python version" check and "default python version must be setup" checks. This is because the default can change arbitrarily, and may change to be the pinned version they specify. e.g. if a module tries to do this:

pip.parse(python_version="3.10", ...)
pip.parse(<python_version unset, so use default>)

Today, that would use 3.10 and 3.11. But a different root module might override to use 3.10 -- now the child will get an error because 3.10 occurs twice. But if it removes it, things fail because the default wasn't specified.

The check is around here: https://github.com/bazelbuild/rules_python/blob/main/python/extensions/pip.bzl#L294

cc @chrislovecnm

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy