bazel-central-registry icon indicating copy to clipboard operation
bazel-central-registry copied to clipboard

[Bug]: [email protected] 'python/extensions' is not a package

Open Clement-Jean opened this issue 2 years ago • 3 comments

What happened?

I ran the following command: bazel run --enable_bzlmod //python:main and got the following error:

Error loading '@rules_python~0.21.0//python/extensions:python.bzl' for module extensions, requested by <root>/MODULE.bazel:6:23: Label '@rules_python~0.21.0//python/extensions:python.bzl' is invalid because 'python/extensions' is not a package; perhaps you meant to put the colon here: '@rules_python~0.21.0//python:extensions/python.bzl'?: Label '@rules_python~0.21.0//python/extensions:python.bzl' is invalid because 'python/extensions' is not a package; perhaps you meant to put the colon here: '@rules_python~0.21.0//python:extensions/python.bzl'?

Version

Development (host) and target OS/architectures:

OSX aarch64

Output of bazel --version:

bazel 6.2.0

Version of relevant rules from the WORKSPACE or MODULE.bazel file:

[email protected]

Language(s) and/or frameworks involved:

Python

How to reproduce

In MODULE.bazel:

bazel_dep(name = "rules_python", version = "0.21.0")

python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
    name = "python3_10",
    configure_coverage_tool = True,
    python_version = "3.10",
)
use_repo(python, "python3_10")
use_repo(python, "python3_10_toolchains")

register_toolchains(
    "@python3_10_toolchains//:all",
)

Clement-Jean avatar May 24 '23 00:05 Clement-Jean

The extension usage changed with https://github.com/bazelbuild/rules_python/commit/46537cf32f8bf722a6be805821cb2ee17d7b936a, but that change hasn't been released yet.

@rickeylev @chrislovecnm

fmeum avatar May 24 '23 10:05 fmeum

anything I can do to help?

Clement-Jean avatar May 24 '23 10:05 Clement-Jean

FYI 0.24.0 of rules_python has been released so bumping to that version should resolve this issue. Note the extension API change though!

jsharpe avatar Jul 14 '23 20:07 jsharpe