Skip to content

Commit d09ad2c

Browse files
committed
linter cleanup
1 parent 638b521 commit d09ad2c

File tree

5 files changed

+18
-7
lines changed

5 files changed

+18
-7
lines changed

python/private/py_executable_bazel.bzl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,17 @@ def _create_zip_main(ctx, *, stage2_bootstrap, runtime_details, venv):
347347
# Return a relative path from one path to another, where both paths are each
348348
# relative paths from a common root.
349349
def relative_path(from_, to):
350+
"""Compute a relative path from one path to another.
351+
352+
Args:
353+
from_: {type}`str` the starting directory. Note that it should be
354+
a directory because relative-symlinks are relative to the
355+
directory the symlink resides in.
356+
to: {type}`str` the path that `from_` wants to point to
357+
358+
Returns:
359+
{type}`str` a relative path
360+
"""
350361
from_parts = from_.split("/")
351362
to_parts = to.split("/")
352363

tests/bootstrap_impls/BUILD.bazel

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
load("//python/private:util.bzl", "IS_BAZEL_7_OR_HIGHER") # buildifier: disable=bzl-visibility
1616
load("//tests/support:sh_py_run_test.bzl", "py_reconfig_test", "sh_py_run_test")
17+
load(":venv_relative_path_tests.bzl", "relative_path_test_suite")
1718

1819
_SUPPORTS_BOOTSTRAP_SCRIPT = select({
1920
"@platforms//os:windows": ["@platforms//:incompatible"],
@@ -88,6 +89,4 @@ sh_py_run_test(
8889
target_compatible_with = _SUPPORTS_BOOTSTRAP_SCRIPT,
8990
)
9091

91-
load(":venv_relative_path_tests.bzl", "relative_path_test_suite")
92-
93-
relative_path_test_suite("relative_path_test")
92+
relative_path_test_suite(name = "relative_path_test")

tests/bootstrap_impls/a/b/c/BUILD.bazel

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
load("@bazel_skylib//rules:copy_file.bzl", "copy_file")
21
load("//python/private:util.bzl", "IS_BAZEL_7_OR_HIGHER") # buildifier: disable=bzl-visibility
3-
load("//tests/support:sh_py_run_test.bzl", "py_reconfig_test", "sh_py_run_test")
2+
load("//tests/support:sh_py_run_test.bzl", "py_reconfig_test")
43

54
_SUPPORTS_BOOTSTRAP_SCRIPT = select({
65
"@platforms//os:windows": ["@platforms//:incompatible"],

tests/bootstrap_impls/a/b/c/nested_dir_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515

1616
import unittest
1717

18+
1819
class RunsTest(unittest.TestCase):
1920
def test_runs(self):
2021
pass
2122

23+
2224
unittest.main()

tests/bootstrap_impls/venv_relative_path_tests.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
"Unit tests for yaml.bzl"
1616

17-
load("@bazel_skylib//lib:unittest.bzl", "analysistest", "asserts", "unittest")
17+
load("@bazel_skylib//lib:unittest.bzl", "asserts", "unittest")
1818
load("//python/private:py_executable_bazel.bzl", "relative_path") # buildifier: disable=bzl-visibility
1919

2020
def _relative_path_test_impl(ctx):
@@ -117,5 +117,5 @@ relative_path_test = unittest.make(
117117
attrs = {},
118118
)
119119

120-
def relative_path_test_suite(name):
120+
def relative_path_test_suite(*, name):
121121
unittest.suite(name, relative_path_test)

0 commit comments

Comments
 (0)