From 746598247232cb77150de841f2266b0f66c28cb0 Mon Sep 17 00:00:00 2001 From: Michael Payne Date: Tue, 31 Mar 2020 12:50:50 -0700 Subject: [PATCH 1/3] Dependencies: build updates. Signed-off-by: Michael Payne --- bazel/external/jinja.BUILD | 2 +- bazel/repository_locations.bzl | 6 +++--- configs/requirements.txt | 2 +- docs/requirements.txt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bazel/external/jinja.BUILD b/bazel/external/jinja.BUILD index f7ce6718caeb..044c88d4ad15 100644 --- a/bazel/external/jinja.BUILD +++ b/bazel/external/jinja.BUILD @@ -2,7 +2,7 @@ licenses(["notice"]) # Apache 2 py_library( name = "jinja2", - srcs = glob(["jinja2/**/*.py"]), + srcs = glob(["src/jinja2/*.py"]), visibility = ["//visibility:public"], deps = ["@com_github_pallets_markupsafe//:markupsafe"], ) diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index 17a3eab8cd70..bba4296a8e20 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -251,9 +251,9 @@ DEPENDENCY_REPOSITORIES = dict( use_category = ["dataplane"], ), com_github_pallets_jinja = dict( - sha256 = "db49236731373e4f3118af880eb91bb0aa6978bc0cf8b35760f6a026f1a9ffc4", - strip_prefix = "jinja-2.10.3", - urls = ["https://github.com/pallets/jinja/archive/2.10.3.tar.gz"], + sha256 = "35ccc930685e37c4762258917e822b5db29b60431afb6d6e00e22b4f5287165a", + strip_prefix = "jinja-2.11.1", + urls = ["https://github.com/pallets/jinja/archive/2.11.1.tar.gz"], use_category = ["build"], ), com_github_pallets_markupsafe = dict( diff --git a/configs/requirements.txt b/configs/requirements.txt index 83e5040a3fc9..10625b546fdb 100644 --- a/configs/requirements.txt +++ b/configs/requirements.txt @@ -1 +1 @@ -jinja2==2.10.3 +Jinja2==2.11.1 diff --git a/docs/requirements.txt b/docs/requirements.txt index 683f5c59b938..ab7c76d7ae29 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,5 +1,5 @@ GitPython==3.1.1 -Jinja2==2.10.3 +Jinja2==2.11.1 MarkupSafe==1.1.1 Pygments==2.4.2 alabaster==0.7.12 From 118ab0bfae4992a276019c0bfcd1876e00aa0d03 Mon Sep 17 00:00:00 2001 From: Adam Kotwasinski Date: Thu, 30 Apr 2020 16:45:52 -0700 Subject: [PATCH 2/3] Dependencies: update jinja2 from 2.11.1 to 2.11.2 Signed-off-by: Adam Kotwasinski --- bazel/repository_locations.bzl | 6 +++--- configs/requirements.txt | 2 +- docs/requirements.txt | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index bba4296a8e20..e37e2cbfcb1f 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -251,9 +251,9 @@ DEPENDENCY_REPOSITORIES = dict( use_category = ["dataplane"], ), com_github_pallets_jinja = dict( - sha256 = "35ccc930685e37c4762258917e822b5db29b60431afb6d6e00e22b4f5287165a", - strip_prefix = "jinja-2.11.1", - urls = ["https://github.com/pallets/jinja/archive/2.11.1.tar.gz"], + sha256 = "c5720a681bf1c5b11e184af32e6a8ce28670911787702b20cd0367e3877bbcae", + strip_prefix = "jinja-2.11.2", + urls = ["https://github.com/pallets/jinja/archive/2.11.2.tar.gz"], use_category = ["build"], ), com_github_pallets_markupsafe = dict( diff --git a/configs/requirements.txt b/configs/requirements.txt index 10625b546fdb..60ffe02f13e3 100644 --- a/configs/requirements.txt +++ b/configs/requirements.txt @@ -1 +1 @@ -Jinja2==2.11.1 +jinja2==2.11.2 diff --git a/docs/requirements.txt b/docs/requirements.txt index ab7c76d7ae29..7288336d8844 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,5 +1,5 @@ GitPython==3.1.1 -Jinja2==2.11.1 +Jinja2==2.11.2 MarkupSafe==1.1.1 Pygments==2.4.2 alabaster==0.7.12 From 52e33852b0b28eaf81588d3f784926fe9f6bc02a Mon Sep 17 00:00:00 2001 From: Adam Kotwasinski Date: Fri, 1 May 2020 10:59:26 -0700 Subject: [PATCH 3/3] jinja2 dependency upgrade to 2.11: move the files up one level, so the python package is still 'jinja2' Signed-off-by: Adam Kotwasinski --- bazel/external/jinja.BUILD | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/bazel/external/jinja.BUILD b/bazel/external/jinja.BUILD index 044c88d4ad15..57ca1db52455 100644 --- a/bazel/external/jinja.BUILD +++ b/bazel/external/jinja.BUILD @@ -1,8 +1,28 @@ licenses(["notice"]) # Apache 2 +# Starting with 2.11, the jinja2 distribution does not keep the source files in a directory with +# the expected package name (it uses 'src/jinja2' instead of 'jinja2'), so we provide a genrule to +# copy src/jinja2/*.py to jinja2/*.py. + +src_files = glob(["src/jinja2/*.py"]) + +genrule( + name = "jinja_files", + srcs = src_files, + outs = [f.replace("src/jinja2/", "jinja2/") for f in src_files], + cmd = "\n".join( + ["mkdir -p $$(dirname $(location %s)) && cp $(location %s) $(location :%s)" % ( + f, + f, + f.replace("src/jinja2/", "jinja2/"), + ) for f in src_files], + ), + visibility = ["//visibility:private"], +) + py_library( name = "jinja2", - srcs = glob(["src/jinja2/*.py"]), + srcs = [":jinja_files"], visibility = ["//visibility:public"], deps = ["@com_github_pallets_markupsafe//:markupsafe"], )