Skip to content

Cannot build testonly py_wheelΒ #1057

@faximan

Description

@faximan

🐞 bug report

Affected Rule

The issue is caused by the rule: py_wheel

Is this a regression?

Yes, the previous version in which this bug was not present was: 0.16.2

Description

With the addition of .dist meta targets in #1019, I can no longer build //... when including a py_wheel tagged testonly.

πŸ”¬ Minimal Reproduction

load("@rules_python//python:packaging.bzl", "py_wheel")
py_wheel(
    name = "foo_test_wheel",
    testonly = 1,
    distribution = "foo_test",
    version = "0.0.1",
)

bazel --bazelrc=/dev/null build //...

πŸ”₯ Exception or Error


ERROR: ~/python/BUILD:240:9: in py_wheel_dist rule //foo_test_wheel.dist: non-test target '//:foo_test_wheel.dist' depends on testonly target '//:foo_test_wheel' and doesn't have testonly attribute set

🌍 Your Environment

Operating System:

Debian

Output of bazel version:

  
Build label: 5.4.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Dec 15 16:14:25 2022 (1671120865)
Build timestamp: 1671120865
Build timestamp as int: 1671120865
  

Rules_python version:

  
0.17.3
  

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions