commit | 12bfbdffc57bbaf9a3de31e6a7acdc415eb9de72 | [log] [tgz] |
---|---|---|
author | Dillon Giacoppo <dillon.giacoppo@gmail.com> | Thu Jan 02 09:26:42 2020 +1100 |
committer | Dillon Giacoppo <dillon.giacoppo@gmail.com> | Thu Jan 02 11:34:54 2020 +1100 |
tree | 06b966a451990c8cf125a0a1a8ee57071d51a417 | |
parent | 2b20e0e4f7dc390167b222f36f139984bed60e76 [diff] |
wip: fetch dependencies
Contains Bazel rules to fetch and install Python dependencies from a requirements.txt file.
In requirements.txt
cryptography==2.8 boto3==1.9.253
In WORKSPACE
rules_python_external_version = "{COMMIT_SHA}" http_archive( name = "rules_python_external", sha256 = "", # Fill in with correct sha256 of your COMMIT_SHA version strip_prefix = "rules_python_external-{version}".format(version = rules_python_external_version), url = "https://github.com/dillon-giacoppo/rules_python_external/archive/{version}.zip".format(version = rules_python_external_version), ) load("@rules_python_external//:defs.bzl", "pip_repository") pip_repository( name = "py_deps", requirements = "//:requirements.txt", )
Example BUILD
file.
load("@py_deps//:requirements.bzl", "requirement") py_binary( name = "main", srcs = ["main.py"], deps = [ requirement("boto3"), # or @py_deps//pypi__boto3 ], )
bazel test //...