Skip to content

[Bug]: py_test does not accept the same resolutions as py_binary #466

@njlr

Description

@njlr

What happened?

Trying to use virtual_deps works with py_binary but not with py_test.

It complains that the type of resolutions is wrong.

Version

Development (host) and target OS/architectures: Linux

Output of bazel --version:

bazel 6.2.0

Version of the Aspect rules, or other relevant rules from your
WORKSPACE or MODULE.bazel file:

http_archive(
  name = "aspect_rules_py",
  sha256 = "2ce48e0f3eaaf73204b623f99f23d45690b862a994b5b3c2464a2e361b0fc4ae",
  strip_prefix = "rules_py-1.0.0",
  url = "https://github.com/aspect-build/rules_py/releases/download/v1.0.0/rules_py-v1.0.0.tar.gz",
)

Language(s) and/or frameworks involved:
Python

How to reproduce

Create a py_test that uses resolutions like so:

# ...

resolutions = resolutions.from_requirements(all_whl_requirements_by_package, requirement)

py_test(
  name = "py_test_tests",
  srcs = glob([
    "tests/**/*.py",
  ]) + [
    ":__test__.py"
  ],
  main = ":__test__.py",
  package_collisions = "error",
  resolutions = resolutions,
  python_version = "3.9.16",
  size = "small",
)

Any other information?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions