Skip to content

Commit 4db046a

Browse files
committed
Buildifier
1 parent 0ae5942 commit 4db046a

4 files changed

Lines changed: 66 additions & 66 deletions

File tree

examples/build_file_generation/WORKSPACE

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,6 @@ load("@rules_python//python:pip.bzl", "pip_parse")
9494
# You can instead check this `requirements.bzl` file into your repo.
9595
pip_parse(
9696
name = "pip",
97-
# (Optional) You can provide a python_interpreter (path) or a python_interpreter_target (a Bazel target, that
98-
# acts as an executable). The latter can be anything that could be used as Python interpreter. E.g.:
99-
# 1. Python interpreter that you compile in the build file.
100-
# 2. Pre-compiled python interpreter included with http_archive.
101-
# 3. Wrapper script, like in the autodetecting python toolchain.
102-
#
103-
# Here, we use the interpreter constant that resolves to the host interpreter from the default Python toolchain.
104-
python_interpreter_target = interpreter,
10597

10698
# Requirement groups allow Bazel to tolerate PyPi cycles by putting dependencies
10799
# which are known to form cycles into groups together.
@@ -115,6 +107,14 @@ pip_parse(
115107
"sphinxcontrib-serializinghtml",
116108
],
117109
},
110+
# (Optional) You can provide a python_interpreter (path) or a python_interpreter_target (a Bazel target, that
111+
# acts as an executable). The latter can be anything that could be used as Python interpreter. E.g.:
112+
# 1. Python interpreter that you compile in the build file.
113+
# 2. Pre-compiled python interpreter included with http_archive.
114+
# 3. Wrapper script, like in the autodetecting python toolchain.
115+
#
116+
# Here, we use the interpreter constant that resolves to the host interpreter from the default Python toolchain.
117+
python_interpreter_target = interpreter,
118118
# Set the location of the lock file.
119119
requirements_lock = "//:requirements_lock.txt",
120120
requirements_windows = "//:requirements_windows.txt",

examples/bzlmod/MODULE.bazel

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ use_repo(pip, "whl_mods_hub")
8888
# Alternatively, `python_interpreter_target` can be used to directly specify
8989
# the Python interpreter to run to resolve dependencies.
9090
pip.parse(
91-
hub_name = "pip",
92-
python_version = "3.9",
9391
experimental_requirement_cycles = {
9492
"sphinx": [
9593
"sphinx",
@@ -100,6 +98,8 @@ pip.parse(
10098
"sphinxcontrib-serializinghtml",
10199
],
102100
},
101+
hub_name = "pip",
102+
python_version = "3.9",
103103
requirements_lock = "//:requirements_lock_3_9.txt",
104104
requirements_windows = "//:requirements_windows_3_9.txt",
105105
# These modifications were created above and we
@@ -111,8 +111,6 @@ pip.parse(
111111
},
112112
)
113113
pip.parse(
114-
hub_name = "pip",
115-
python_version = "3.10",
116114
experimental_requirement_cycles = {
117115
"sphinx": [
118116
"sphinx",
@@ -123,6 +121,8 @@ pip.parse(
123121
"sphinxcontrib-serializinghtml",
124122
],
125123
},
124+
hub_name = "pip",
125+
python_version = "3.10",
126126
requirements_lock = "//:requirements_lock_3_10.txt",
127127
requirements_windows = "//:requirements_windows_3_10.txt",
128128
# These modifications were created above and we

examples/pip_parse/WORKSPACE

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ pip_parse(
2424
# can be passed
2525
# environment = {"HTTPS_PROXY": "http://my.proxy.fun/"},
2626
name = "pypi",
27+
28+
# Requirement groups allow Bazel to tolerate PyPi cycles by putting dependencies
29+
# which are known to form cycles into groups together.
30+
experimental_requirement_cycles = {
31+
"sphinx": [
32+
"sphinx",
33+
"sphinxcontrib-qthelp",
34+
"sphinxcontrib-htmlhelp",
35+
"sphinxcontrib-devhelp",
36+
"sphinxcontrib-applehelp",
37+
"sphinxcontrib-serializinghtml",
38+
],
39+
},
2740
# (Optional) You can provide extra parameters to pip.
2841
# Here, make pip output verbose (this is usable with `quiet = False`).
2942
# extra_pip_args = ["-v"],
@@ -41,19 +54,6 @@ pip_parse(
4154
# Here, we use the interpreter constant that resolves to the host interpreter from the default Python toolchain.
4255
python_interpreter_target = interpreter,
4356

44-
# Requirement groups allow Bazel to tolerate PyPi cycles by putting dependencies
45-
# which are known to form cycles into groups together.
46-
experimental_requirement_cycles = {
47-
"sphinx": [
48-
"sphinx",
49-
"sphinxcontrib-qthelp",
50-
"sphinxcontrib-htmlhelp",
51-
"sphinxcontrib-devhelp",
52-
"sphinxcontrib-applehelp",
53-
"sphinxcontrib-serializinghtml",
54-
],
55-
},
56-
5757
# (Optional) You can set quiet to False if you want to see pip output.
5858
#quiet = False,
5959
requirements_lock = "//:requirements_lock.txt",

python/pip_install/pip_repository.bzl

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -418,47 +418,6 @@ can be passed.
418418
""",
419419
default = {},
420420
),
421-
"extra_pip_args": attr.string_list(
422-
doc = "Extra arguments to pass on to pip. Must not contain spaces.",
423-
),
424-
"isolated": attr.bool(
425-
doc = """\
426-
Whether or not to pass the [--isolated](https://pip.pypa.io/en/stable/cli/pip/#cmdoption-isolated) flag to
427-
the underlying pip command. Alternatively, the `RULES_PYTHON_PIP_ISOLATED` environment variable can be used
428-
to control this flag.
429-
""",
430-
default = True,
431-
),
432-
"pip_data_exclude": attr.string_list(
433-
doc = "Additional data exclusion parameters to add to the pip packages BUILD file.",
434-
),
435-
"python_interpreter": attr.string(
436-
doc = """\
437-
The python interpreter to use. This can either be an absolute path or the name
438-
of a binary found on the host's `PATH` environment variable. If no value is set
439-
`python3` is defaulted for Unix systems and `python.exe` for Windows.
440-
""",
441-
# NOTE: This attribute should not have a default. See `_get_python_interpreter_attr`
442-
# default = "python3"
443-
),
444-
"python_interpreter_target": attr.label(
445-
allow_single_file = True,
446-
doc = """
447-
If you are using a custom python interpreter built by another repository rule,
448-
use this attribute to specify its BUILD target. This allows pip_repository to invoke
449-
pip using the same interpreter as your toolchain. If set, takes precedence over
450-
python_interpreter. An example value: "@python3_x86_64-unknown-linux-gnu//:python".
451-
""",
452-
),
453-
"quiet": attr.bool(
454-
default = True,
455-
doc = "If True, suppress printing stdout and stderr output to the terminal.",
456-
),
457-
"repo_prefix": attr.string(
458-
doc = """
459-
Prefix for the generated packages will be of the form `@<prefix><sanitized-package-name>//...`
460-
""",
461-
),
462421
"experimental_requirement_cycles": attr.string_list_dict(
463422
default = {},
464423
doc = """\
@@ -513,6 +472,47 @@ Warning:
513472
If a dependency participates in multiple cycles, all of those cycles must be
514473
collapsed down to one. For instance `a <-> b` and `a <-> c` cannot be listed
515474
as two separate cycles.
475+
""",
476+
),
477+
"extra_pip_args": attr.string_list(
478+
doc = "Extra arguments to pass on to pip. Must not contain spaces.",
479+
),
480+
"isolated": attr.bool(
481+
doc = """\
482+
Whether or not to pass the [--isolated](https://pip.pypa.io/en/stable/cli/pip/#cmdoption-isolated) flag to
483+
the underlying pip command. Alternatively, the `RULES_PYTHON_PIP_ISOLATED` environment variable can be used
484+
to control this flag.
485+
""",
486+
default = True,
487+
),
488+
"pip_data_exclude": attr.string_list(
489+
doc = "Additional data exclusion parameters to add to the pip packages BUILD file.",
490+
),
491+
"python_interpreter": attr.string(
492+
doc = """\
493+
The python interpreter to use. This can either be an absolute path or the name
494+
of a binary found on the host's `PATH` environment variable. If no value is set
495+
`python3` is defaulted for Unix systems and `python.exe` for Windows.
496+
""",
497+
# NOTE: This attribute should not have a default. See `_get_python_interpreter_attr`
498+
# default = "python3"
499+
),
500+
"python_interpreter_target": attr.label(
501+
allow_single_file = True,
502+
doc = """
503+
If you are using a custom python interpreter built by another repository rule,
504+
use this attribute to specify its BUILD target. This allows pip_repository to invoke
505+
pip using the same interpreter as your toolchain. If set, takes precedence over
506+
python_interpreter. An example value: "@python3_x86_64-unknown-linux-gnu//:python".
507+
""",
508+
),
509+
"quiet": attr.bool(
510+
default = True,
511+
doc = "If True, suppress printing stdout and stderr output to the terminal.",
512+
),
513+
"repo_prefix": attr.string(
514+
doc = """
515+
Prefix for the generated packages will be of the form `@<prefix><sanitized-package-name>//...`
516516
""",
517517
),
518518
# 600 is documented as default here: https://docs.bazel.build/versions/master/skylark/lib/repository_ctx.html#execute

0 commit comments

Comments
 (0)