Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use bazel-runfiles instead of accessing runfiles from rules_python #86

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion appimage/private/tool/BUILD
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
load("@rules_appimage_py_deps//:requirements.bzl", "requirement")
load("@rules_python//python:defs.bzl", "py_binary", "py_library")

py_library(
name = "mkappimage",
srcs = ["mkappimage.py"],
data = ["@squashfs-tools//:mksquashfs"],
visibility = ["//visibility:public"],
deps = ["@rules_python//python/runfiles"],
deps = [requirement("bazel-runfiles")],
)

py_binary(
Expand Down
4 changes: 2 additions & 2 deletions appimage/private/tool/mkappimage.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
from pathlib import Path
from typing import Dict, Iterable, List, NamedTuple, Optional, Tuple

import rules_python.python.runfiles.runfiles
import runfiles as bazel_runfiles


def _get_path_or_raise(path: str) -> Path:
"""Return a Path to a file in the runfiles, or raise FileNotFoundError."""
runfiles = rules_python.python.runfiles.runfiles.Create()
runfiles = bazel_runfiles.Create()
if not runfiles:
raise FileNotFoundError("Could not find runfiles")
runfile = runfiles.Rlocation(path)
Expand Down
1 change: 1 addition & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
bazel-runfiles==0.27.0
pytest==7.4.3
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#
# bazel run //:requirements.update
#
bazel-runfiles==0.27.0 \
--hash=sha256:ff2081001e27085a4c57bb828202603d3f3c349d3e9683c44aedf02836e8deab
# via -r requirements.in
iniconfig==2.0.0 \
--hash=sha256:2d91e135bf72d31a410b17c16da610a82cb55f6b0477d1a902134b24a455b8b3 \
--hash=sha256:b6a85871a79d2e3b22d2d1b94ac2824226a63c6b741c88f7ae975f18b6778374
Expand Down