load("@rules_python_pytest//python_pytest:defs.bzl", "py_pytest_test") py_pytest_test( name = "test_w_pytest", size = "small", srcs = ["test.py"], deps = [ # TODO Add this for the user requirement("pytest"), ], ) To use test sharding, also add requirement("pytest-shard"...