use runfiles from rules_python (#768)

This commit is contained in:
aiuto 2023-10-28 11:14:40 -04:00 committed by GitHub
parent 2b391f233c
commit 1b033ddaee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 26 additions and 28 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
.bazeliskrc
.ijwb
bazel-*
MODULE.bazel.lock

View File

@ -98,7 +98,7 @@ py_test(
],
deps = [
"//pkg/releasing:release_utils",
"@bazel_tools//tools/python/runfiles",
"@rules_python//python/runfiles",
],
)

View File

@ -19,7 +19,7 @@ import re
import subprocess
import unittest
from bazel_tools.tools.python.runfiles import runfiles
from python.runfiles import runfiles
from pkg.releasing import release_tools
from distro import release_version

View File

@ -89,7 +89,7 @@ py_test(
srcs_version = "PY3",
deps = [
"//pkg/private:archive",
"@bazel_tools//tools/python/runfiles",
"@rules_python//python/runfiles",
],
)
@ -208,7 +208,7 @@ py_test(
],
python_version = "PY3",
deps = [
"@bazel_tools//tools/python/runfiles",
"@rules_python//python/runfiles",
],
)

View File

@ -15,7 +15,7 @@
import unittest
from bazel_tools.tools.python.runfiles import runfiles
from python.runfiles import runfiles
from pkg.private import archive

View File

@ -104,7 +104,7 @@ py_test(
python_version = "PY3",
deps = [
"//pkg/private:archive",
"@bazel_tools//tools/python/runfiles",
"@rules_python//python/runfiles",
],
)

View File

@ -22,7 +22,7 @@ import sys
import tarfile
import unittest
from bazel_tools.tools.python.runfiles import runfiles
from python.runfiles import runfiles
from pkg.private import archive

View File

@ -38,7 +38,7 @@ py_library(
imports = ["../.."],
srcs_version = "PY3",
deps = [
"@bazel_tools//tools/python/runfiles",
"@rules_python//python/runfiles",
],
)

View File

@ -16,7 +16,7 @@
import json
import unittest
from bazel_tools.tools.python.runfiles import runfiles
from python.runfiles import runfiles
class ContentManifestTest(unittest.TestCase):
"""Test harness to see if we wrote the content manifest correctly."""

View File

@ -19,7 +19,7 @@ import time
import unittest
import zipfile
from bazel_tools.tools.python.runfiles import runfiles
from python.runfiles import runfiles
# keep in sync with archive.py
PORTABLE_MTIME = 946684800 # 2000-01-01 00:00:00.000 UTC

View File

@ -50,7 +50,7 @@ py_test(
srcs_version = "PY3",
deps = [
"//pkg/private/tar:tar_writer",
"@bazel_tools//tools/python/runfiles",
"@rules_python//python/runfiles",
],
)
@ -208,7 +208,7 @@ pkg_tar(
name = "test-tar-strip_prefix-dot",
srcs = [
":etc/nsswitch.conf",
"@bazel_tools//tools/python/runfiles",
"@rules_python//python/runfiles",
],
strip_prefix = ".",
)
@ -385,7 +385,7 @@ py_test(
python_version = "PY3",
deps = [
"//pkg/private/tar:tar_writer",
"@bazel_tools//tools/python/runfiles",
"@rules_python//python/runfiles",
],
)
@ -468,7 +468,7 @@ py_test(
python_version = "PY3",
srcs_version = "PY3",
deps = [
"@bazel_tools//tools/python/runfiles",
"@rules_python//python/runfiles",
],
)

View File

@ -15,7 +15,7 @@
import unittest
from bazel_tools.tools.python.runfiles import runfiles
from python.runfiles import runfiles
class IsCompressedTest(unittest.TestCase):

View File

@ -16,7 +16,7 @@
import tarfile
import unittest
from bazel_tools.tools.python.runfiles import runfiles
from python.runfiles import runfiles
from pkg.private.tar import tar_writer
PORTABLE_MTIME = 946684800 # 2000-01-01 00:00:00.000 UTC
@ -109,12 +109,11 @@ class PkgTarTest(unittest.TestCase):
{'name': 'etc'},
{'name': 'etc/nsswitch.conf'},
{'name': 'external'},
{'name': 'external/bazel_tools'},
{'name': 'external/bazel_tools/tools'},
{'name': 'external/bazel_tools/tools/python'},
{'name': 'external/bazel_tools/tools/python/runfiles'},
{'name': 'external/rules_python'},
{'name': 'external/rules_python/python'},
{'name': 'external/rules_python/python/runfiles'},
# This is brittle. In old bazel the next file would be
# external/bazel_tools/tools/python/runfiles/runfiles.py, but there
# external/rules_python/python/runfiles/runfiles.py, but there
# is now _runfiles_constants.py, first. So this is too brittle.
{'halt': None},
]

View File

@ -17,7 +17,7 @@ import os
import tarfile
import unittest
from bazel_tools.tools.python.runfiles import runfiles
from python.runfiles import runfiles
from pkg.private.tar import tar_writer
from tests.tar import compressor

View File

@ -32,7 +32,7 @@ py_library(
imports = ["../.."],
srcs_version = "PY3",
deps = [
"@bazel_tools//tools/python/runfiles",
"@rules_python//python/runfiles",
],
)

View File

@ -19,7 +19,7 @@ import sys
import unittest
import zipfile
from bazel_tools.tools.python.runfiles import runfiles
from python.runfiles import runfiles
from tests.zip import zip_test_lib
HELLO_CRC = 2069210904

View File

@ -17,7 +17,7 @@ import filecmp
import unittest
import zipfile
from bazel_tools.tools.python.runfiles import runfiles
from python.runfiles import runfiles
# Unix dir bit and Windows dir bit. Magic from zip spec
@ -44,9 +44,7 @@ class ZipTest(unittest.TestCase):
def get_test_zip(self, zip_file):
"""Get the file path to a generated zip in the runfiles."""
return self.data_files.Rlocation(
"rules_pkg/tests/zip/" + zip_file
)
return self.data_files.Rlocation("rules_pkg/tests/zip/" + zip_file)
class ZipContentsTestBase(ZipTest):