3

I am trying to create a wheel package from bazel using py_wheel. py_wheel has an option to provide the required python dependencies using the requires param. However, I don't want to provide the list of dependencies manually. Is there a way that I can read my dependencies from the requirements.txt file and provide it in the list in bazel?

py_wheel(
    name = "dummy",
    distribution = "dummy",
    python_tag = "py3",
    version = "latest",
    entry_points={"console_scripts": ["dummy = dummy.app:main"]},
    requires = [?],
    deps = [":dummy-dependencies"],
)
Ruli
  • 2,592
  • 12
  • 30
  • 40
  • 1
    You can deploy the requirements in this way `load("@deps_1//:requirements.bzl", deps_1_requirement = "requirement")`. The attribute option requires is for **"List of requirements for this package "** find it [here](https://github.com/bazelbuild/rules_python/blob/main/docs/packaging.md) – SG_Bazel Jun 20 '22 at 09:35

1 Answers1

1

You can deploy the requirements in this way

load("@deps_1//:requirements.bzl", deps_1_requirement = "requirement") 

The attribute option requires is for "List of requirements for this package ". find it here

SG_Bazel
  • 343
  • 2
  • 7