Skip to content

Commit a9a0e59

Browse files
authored
chore!: disable pip_install and remove from examples and tests (#1510)
This causes `pip_install` to fail by default. The `allow_pip_install` arg of it can be set to True to temporarily re-enable it. Towards #1498.
1 parent 86d6b0e commit a9a0e59

File tree

20 files changed

+42
-696
lines changed

20 files changed

+42
-696
lines changed

.bazelrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# This lets us glob() up all the files inside the examples to make them inputs to tests
44
# (Note, we cannot use `common --deleted_packages` because the bazel version command doesn't support it)
55
# To update these lines, run tools/bazel_integration_test/update_deleted_packages.sh
6-
build --deleted_packages=examples/build_file_generation,examples/build_file_generation/random_number_generator,examples/bzlmod,examples/bzlmod_build_file_generation,examples/bzlmod_build_file_generation/other_module/other_module/pkg,examples/bzlmod_build_file_generation/runfiles,examples/bzlmod/entry_points,examples/bzlmod/entry_points/tests,examples/bzlmod/libs/my_lib,examples/bzlmod/other_module,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/runfiles,examples/bzlmod/tests,examples/bzlmod/tests/other_module,examples/bzlmod/whl_mods,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_install,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_proto_library,examples/py_proto_library/example.com/proto,tests/compile_pip_requirements,tests/compile_pip_requirements_test_from_external_workspace,tests/ignore_root_user_error,tests/pip_repository_entry_points
7-
query --deleted_packages=examples/build_file_generation,examples/build_file_generation/random_number_generator,examples/bzlmod,examples/bzlmod_build_file_generation,examples/bzlmod_build_file_generation/other_module/other_module/pkg,examples/bzlmod_build_file_generation/runfiles,examples/bzlmod/entry_points,examples/bzlmod/entry_points/tests,examples/bzlmod/libs/my_lib,examples/bzlmod/other_module,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/runfiles,examples/bzlmod/tests,examples/bzlmod/tests/other_module,examples/bzlmod/whl_mods,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_install,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_proto_library,examples/py_proto_library/example.com/proto,tests/compile_pip_requirements,tests/compile_pip_requirements_test_from_external_workspace,tests/ignore_root_user_error,tests/pip_repository_entry_points
6+
build --deleted_packages=examples/build_file_generation,examples/build_file_generation/random_number_generator,examples/bzlmod,examples/bzlmod_build_file_generation,examples/bzlmod_build_file_generation/other_module/other_module/pkg,examples/bzlmod_build_file_generation/runfiles,examples/bzlmod/entry_points,examples/bzlmod/entry_points/tests,examples/bzlmod/libs/my_lib,examples/bzlmod/other_module,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/runfiles,examples/bzlmod/tests,examples/bzlmod/tests/other_module,examples/bzlmod/whl_mods,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_proto_library,examples/py_proto_library/example.com/proto,tests/compile_pip_requirements,tests/compile_pip_requirements_test_from_external_workspace,tests/ignore_root_user_error,tests/pip_repository_entry_points
7+
query --deleted_packages=examples/build_file_generation,examples/build_file_generation/random_number_generator,examples/bzlmod,examples/bzlmod_build_file_generation,examples/bzlmod_build_file_generation/other_module/other_module/pkg,examples/bzlmod_build_file_generation/runfiles,examples/bzlmod/entry_points,examples/bzlmod/entry_points/tests,examples/bzlmod/libs/my_lib,examples/bzlmod/other_module,examples/bzlmod/other_module/other_module/pkg,examples/bzlmod/runfiles,examples/bzlmod/tests,examples/bzlmod/tests/other_module,examples/bzlmod/whl_mods,examples/multi_python_versions/libs/my_lib,examples/multi_python_versions/requirements,examples/multi_python_versions/tests,examples/pip_parse,examples/pip_parse_vendored,examples/pip_repository_annotations,examples/py_proto_library,examples/py_proto_library/example.com/proto,tests/compile_pip_requirements,tests/compile_pip_requirements_test_from_external_workspace,tests/ignore_root_user_error,tests/pip_repository_entry_points
88

99
test --test_output=errors
1010

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,16 @@ A brief description of the categories of changes:
2424
* Make `//python/pip_install:pip_repository_bzl` `bzl_library` target internal
2525
as all of the publicly available symbols (etc. `package_annotation`) are
2626
re-exported via `//python:pip_bzl` `bzl_library`.
27-
* Gazelle Python extension no longer has runtime dependencies. Using `GAZELLE_PYTHON_RUNTIME_DEPS` from `@rules_python_gazelle_plugin//:def.bzl` is no longer necessary.
27+
28+
* Gazelle Python extension no longer has runtime dependencies. Using
29+
`GAZELLE_PYTHON_RUNTIME_DEPS` from `@rules_python_gazelle_plugin//:def.bzl` is
30+
no longer necessary.
31+
32+
Breaking changes:
33+
34+
* (pip) `pip_install` repository rule in this release has been disabled and
35+
will fail by default. The API symbol is going to be removed in the next
36+
version, please migrate to `pip_parse` as a replacement.
2837

2938
### Fixed
3039

docs/pip.md

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -145,24 +145,10 @@ str: A json encoded string of the provided content.
145145
## pip_install
146146

147147
<pre>
148-
pip_install(<a href="#pip_install-requirements">requirements</a>, <a href="#pip_install-name">name</a>, <a href="#pip_install-kwargs">kwargs</a>)
148+
pip_install(<a href="#pip_install-requirements">requirements</a>, <a href="#pip_install-name">name</a>, <a href="#pip_install-allow_pip_install">allow_pip_install</a>, <a href="#pip_install-kwargs">kwargs</a>)
149149
</pre>
150150

151-
Accepts a locked/compiled requirements file and installs the dependencies listed within.
152-
153-
```python
154-
load("@rules_python//python:pip.bzl", "pip_install")
155-
156-
pip_install(
157-
name = "pip_deps",
158-
requirements = ":requirements.txt",
159-
)
160-
161-
load("@pip_deps//:requirements.bzl", "install_deps")
162-
163-
install_deps()
164-
```
165-
151+
Will be removed in 0.28.0
166152

167153
**PARAMETERS**
168154

@@ -171,6 +157,7 @@ install_deps()
171157
| :------------- | :------------- | :------------- |
172158
| <a id="pip_install-requirements"></a>requirements | A 'requirements.txt' pip requirements file. | `None` |
173159
| <a id="pip_install-name"></a>name | A unique name for the created external repository (default 'pip'). | `"pip"` |
160+
| <a id="pip_install-allow_pip_install"></a>allow_pip_install | change this to keep this rule working (default False). | `False` |
174161
| <a id="pip_install-kwargs"></a>kwargs | Additional arguments to the [`pip_repository`](./pip_repository.md) repository rule. | none |
175162

176163

examples/BUILD.bazel

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ bazel_integration_test(
2727
timeout = "long",
2828
)
2929

30-
bazel_integration_test(
31-
name = "pip_install_example",
32-
timeout = "long",
33-
)
34-
3530
bazel_integration_test(
3631
name = "pip_parse_example",
3732
timeout = "long",

examples/pip_install/.bazelrc

Lines changed: 0 additions & 2 deletions
This file was deleted.

examples/pip_install/.gitignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

examples/pip_install/BUILD.bazel

Lines changed: 0 additions & 110 deletions
This file was deleted.

examples/pip_install/README.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

examples/pip_install/WORKSPACE

Lines changed: 0 additions & 96 deletions
This file was deleted.

examples/pip_install/main.py

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)