Skip to content

Commit

Permalink
bazel: Update rules_python (#2382)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Northey <ryan@synca.io>
  • Loading branch information
phlax authored Oct 29, 2024
1 parent 408a6d2 commit a0ce9b8
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 15 deletions.
3 changes: 3 additions & 0 deletions bazel/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ workspace(name = "envoy_toolshed")
load(":archives.bzl", "load_archives")
load_archives()

load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()

load(":toolchains.bzl", "load_toolchains")
load_toolchains()

Expand Down
2 changes: 1 addition & 1 deletion bazel/packages.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ load("//:versions.bzl", "VERSIONS")
def load_packages():
# This is empty - it should be overridden in your repo
pip_parse(
name = "pip3",
name = "toolshed_pip3",
requirements_lock = "@envoy_toolshed//:requirements.txt",
python_interpreter_target = interpreter,
)
Expand Down
4 changes: 2 additions & 2 deletions bazel/toolchains.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ load("//:versions.bzl", "VERSIONS")

def load_toolchains():
python_register_toolchains(
name = "python3",
python_version = VERSIONS["python"],
name = "python%s" % VERSIONS["python"].replace(".", "_"),
python_version = VERSIONS["python"].replace("-", "_"),
)
11 changes: 5 additions & 6 deletions bazel/versions.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@ VERSIONS = {

"bazel_skylib": {
"type": "github_archive",
"repo": "bazelbuild/rules_python",
"repo": "bazelbuild/bazel-skylib",
"version": "1.4.2",
"sha256": "66ffd9315665bfaafc96b52278f57c7e2dd09f5ede279ea6d39b2be471e7e3aa",
"url": "https://github.com/{repo}/releases/download/bazel-skylib-{version}.tar.gz",
"strip_prefix": "{name}-{version}",
"url": "https://github.com/{repo}/releases/download/{version}/bazel-skylib-{version}.tar.gz",
},

"rules_python": {
"type": "github_archive",
"repo": "bazelbuild/rules_python",
"version": "ae9f24ff7cd208af1b895c7509762caaf3b651e0",
"sha256": "2a5cf996de8d5f6b736005b09a31f774242dd7506bcc1a5ec256946a825d175c",
"url": "https://github.com/{repo}/archive/{version}.tar.gz",
"version": "0.37.2",
"sha256": "c6fb25d0ba0246f6d5bd820dd0b2e66b339ccc510242fd4956b9a639b548d113",
"url": "https://github.com/{repo}/releases/download/{version}/{name}-{version}.tar.gz",
"strip_prefix": "{name}-{version}",
},
}
12 changes: 6 additions & 6 deletions bazel/website/tools/pelican/BUILD
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("@envoy_toolshed//py:macros.bzl", "entry_point")
load("@website_pip3//:requirements.bzl", "requirement", pip_entry_point = "entry_point")
load("@rules_python//python/entry_points:py_console_script_binary.bzl", "py_console_script_binary")

entry_point(
py_console_script_binary(
name = "pelican",
pkg = "pelican",
pkg = "@website_pip3//pelican",
script = "pelican",
deps = [
requirement("cssmin"),
requirement("libsass"),
Expand All @@ -27,8 +27,8 @@ alias(

alias(
name = "pelican-themes",
actual = pip_entry_point(
pkg = "pelican",
actual = py_console_script_binary(
pkg = "@website_pip3//pelican",
script = "pelican-themes",
),
)

0 comments on commit a0ce9b8

Please sign in to comment.