Skip to content

Commit

Permalink
fix: adapt to python2 phasing out
Browse files Browse the repository at this point in the history
  • Loading branch information
chickenandpork authored and nicowilliams committed Nov 2, 2023
1 parent 2de6089 commit 6764b69
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
24 changes: 21 additions & 3 deletions internal_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,29 @@ def rules_jq_internal_deps():
maybe(
http_archive,
name = "rules_pkg",
patch_args = ["-p1"],
patches = [
# https://github.com/bazelbuild/rules_pkg/pull/169
"//:lib/bazel/fix-python-version-PY2-per-rules_pkg-PR169.patch",
],
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz",
"https://github.com/bazelbuild/rules_pkg/releases/download/0.2.4/rules_pkg-0.2.4.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.2.5/rules_pkg-0.2.5.tar.gz",
"https://github.com/bazelbuild/rules_pkg/releases/download/0.2.5/rules_pkg-0.2.5.tar.gz",
],
sha256 = "4ba8f4ab0ff85f2484287ab06c0d871dcb31cc54d439457d28fd4ae14b18450a",
sha256 = "352c090cc3d3f9a6b4e676cf42a6047c16824959b438895a76c2989c6d7c246a",
)

# NOTE: in making minimal changes, the typical load of py_repositories() from
# python:repositories.bzl was not necessary in WORKSPACE
#
# load("@rules_python//python:repositories.bzl", "py_repositories")
# py_repositories()
maybe(
http_archive,
name = "rules_python",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.0.2/rules_python-0.0.2.tar.gz",
strip_prefix = "rules_python-0.0.2",
sha256 = "b5668cde8bb6e3515057ef465a35ad712214962f0b3a314e551204266c7be90c",
)

maybe(
Expand Down
14 changes: 14 additions & 0 deletions lib/bazel/fix-python-version-PY2-per-rules_pkg-PR169.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff -ur rules_pkg/BUILD rules_pkg/BUILD
--- rules_pkg/BUILD 2023-11-02 11:32:55
+++ rules_pkg/BUILD 2023-11-02 11:33:28
@@ -35,8 +35,8 @@
py_binary(
name = "build_tar",
srcs = ["build_tar.py"],
- python_version = "PY2",
- srcs_version = "PY2AND3",
+ python_version = "PY3",
+ srcs_version = "PY3",
visibility = ["//visibility:public"],
deps = [
":archive",

0 comments on commit 6764b69

Please sign in to comment.