forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add support for pip3_import from rules_python.
Provide an Envoy build system styled way of loading arbitrary pip3 packages as py_{library,binary} dependencies. Part of envoyproxy#11085 (to fetch PyYAML). Risk level: Low (build system) Testing: Manual validation that the test utility loads PyYAML at the correct version (different to my system version). Signed-off-by: Harvey Tuch <[email protected]>
- Loading branch information
Showing
8 changed files
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
load("@rules_python//python:repositories.bzl", "py_repositories") | ||
load("@rules_python//python:pip.bzl", "pip3_import", "pip_repositories") | ||
|
||
# Python dependencies. | ||
def _python_deps(): | ||
py_repositories() | ||
pip_repositories() | ||
|
||
pip3_import( | ||
name = "config_validation", | ||
requirements = "//tools/config_validation:requirements.txt", | ||
) | ||
|
||
# Envoy deps that rely on a first stage of dependency loading in envoy_dependencies(). | ||
def envoy_dependencies_extra(): | ||
_python_deps() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
licenses(["notice"]) # Apache 2 | ||
|
||
load("@config_validation//:requirements.bzl", "requirement") | ||
|
||
py_binary( | ||
name = "validate_yaml_fragment", | ||
srcs = ["validate_yaml_fragment.py"], | ||
visibility = ["//visibility:public"], | ||
deps = [requirement("PyYAML")], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
PyYAML==5.3.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import yaml | ||
|
||
print('YAML version is %s' % yaml.__version__) |