Skip to content

Commit

Permalink
Change the source of rules_python.python.runfiles to PyPI. (#205)
Browse files Browse the repository at this point in the history
* `runfiles` is provided both as part of the Bazel `rules_python`
   repository as `@rules_python//python:runfiles` and on PyPI as
   the `bazel-runfiles` pip package.
 * It could be imported from the Bazel repository as
   `rules_python.python.runfiles` when using WORKSPACE, but needed
   to be imported as `python.runfiles` when using Bzlmod.
 * However, the pip package is independent of whether WORKSPACE or
   Bzlmod is being used.
 * See bazelbuild/rules_python#1679 for
   details.
  • Loading branch information
virajbshah authored Sep 11, 2024
1 parent f4bb207 commit 604e45b
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 31 deletions.
1 change: 0 additions & 1 deletion gematria/datasets/pipelines/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ gematria_py_library(
deps = [
"//gematria/datasets/python:extract_bbs_from_obj",
"//gematria/datasets/python:process_and_filter_bbs",
"@rules_python//python/runfiles",
],
)

Expand Down
2 changes: 1 addition & 1 deletion gematria/datasets/pipelines/compile_modules_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from absl import logging
import apache_beam as beam
from rules_python.python.runfiles import runfiles
from runfiles import runfiles

from gematria.datasets.python import extract_bbs_from_obj
from gematria.datasets.python import process_and_filter_bbs
Expand Down
1 change: 0 additions & 1 deletion gematria/datasets/python/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ gematria_py_test(
],
deps = [
":extract_bbs_from_obj",
"@rules_python//python/runfiles",
],
)

Expand Down
Empty file.
2 changes: 1 addition & 1 deletion gematria/datasets/python/extract_bbs_from_obj_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

from absl.testing import absltest
from rules_python.python.runfiles import runfiles
from runfiles import runfiles
import os
from gematria.datasets.python import extract_bbs_from_obj

Expand Down
4 changes: 0 additions & 4 deletions gematria/testing/python/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ gematria_py_library(
"//gematria/basic_block/python:throughput_protos",
"//gematria/basic_block/python:tokens",
"//gematria/proto:throughput_py_pb2",
"@rules_python//python/runfiles",
],
)

Expand Down Expand Up @@ -66,9 +65,6 @@ gematria_py_library(
"@llvm-project//llvm:llvm-dis",
],
visibility = ["//:internal_users"],
deps = [
"@rules_python//python/runfiles",
],
)

gematria_py_test(
Expand Down
2 changes: 1 addition & 1 deletion gematria/testing/python/basic_blocks_with_throughput.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from gematria.basic_block.python import tokens
from gematria.proto import throughput_pb2
from google.protobuf import text_format
from rules_python.python.runfiles import runfiles
from runfiles import runfiles

# The path to the basic blocks in text format in the resources of the test.
_ROOT_PATH = 'com_google_gematria'
Expand Down
2 changes: 1 addition & 1 deletion gematria/testing/python/ir_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import pandas
import pyarrow
from pyarrow import parquet
from rules_python.python.runfiles import runfiles
from runfiles import runfiles


def _get_llvm_binary_path(tool_name: str) -> str:
Expand Down
1 change: 1 addition & 0 deletions requirements.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
absl-py>=1.4.0
bazel-runfiles>=0.35.0
contextlib2>=21.6.0
networkx>=2.8.8
numpy>=1.23.2
Expand Down
33 changes: 12 additions & 21 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# pip-compile requirements.in
Expand All @@ -16,13 +16,13 @@ apache-beam==2.58.1
# via -r requirements.in
astunparse==1.6.3
# via tensorflow
async-timeout==4.0.3
# via redis
attrs==23.2.0
attrs==24.2.0
# via
# jsonschema
# referencing
certifi==2024.7.4
bazel-runfiles==0.35.0
# via -r requirements.in
certifi==2024.8.30
# via requests
charset-normalizer==3.3.2
# via requests
Expand All @@ -44,7 +44,7 @@ dnspython==2.6.1
# via pymongo
docopt==0.6.2
# via hdfs
fastavro==1.9.5
fastavro==1.9.7
# via apache-beam
fasteners==0.19
# via apache-beam
Expand All @@ -56,7 +56,7 @@ gast==0.6.0
# tensorflow-probability
google-pasta==0.2.0
# via tensorflow
grpcio==1.66.0
grpcio==1.66.1
# via
# apache-beam
# tensorboard
Expand All @@ -71,8 +71,6 @@ httplib2==0.22.0
# via apache-beam
idna==3.8
# via requests
js2py==0.74
# via apache-beam
jsonpickle==3.3.0
# via apache-beam
jsonschema==4.23.0
Expand Down Expand Up @@ -121,7 +119,7 @@ opt-einsum==3.3.0
# via tensorflow
optree==0.12.1
# via keras
orjson==3.10.6
orjson==3.10.7
# via apache-beam
packaging==24.1
# via
Expand Down Expand Up @@ -149,19 +147,17 @@ pydot==1.4.2
# via apache-beam
pygments==2.18.0
# via rich
pyjsparser==2.7.1
# via js2py
pymongo==4.8.0
# via apache-beam
pyparsing==3.1.2
pyparsing==3.1.4
# via
# httplib2
# pydot
python-dateutil==2.9.0.post0
# via
# apache-beam
# pandas
pytz==2024.1
pytz==2024.2
# via
# apache-beam
# pandas
Expand All @@ -171,14 +167,14 @@ referencing==0.35.1
# via
# jsonschema
# jsonschema-specifications
regex==2024.7.24
regex==2024.9.11
# via apache-beam
requests==2.31.0
# via
# apache-beam
# hdfs
# tensorflow
rich==13.8.0
rich==13.8.1
# via keras
rpds-py==0.20.0
# via
Expand All @@ -193,7 +189,6 @@ six==1.16.0
# astunparse
# google-pasta
# hdfs
# js2py
# python-dateutil
# tensorboard
# tensorflow
Expand All @@ -206,8 +201,6 @@ tensorflow==2.17.0 ; sys_platform == "linux"
# via
# -r requirements.in
# tf-keras
tensorflow-io-gcs-filesystem==0.37.1
# via tensorflow
tensorflow-probability==0.24.0
# via -r requirements.in
termcolor==2.4.0
Expand All @@ -223,8 +216,6 @@ typing-extensions==4.12.2
# tensorflow
tzdata==2024.1
# via pandas
tzlocal==5.2
# via js2py
urllib3==2.2.2
# via requests
werkzeug==3.0.4
Expand Down

0 comments on commit 604e45b

Please sign in to comment.