Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ END_UNRELEASED_TEMPLATE
* (rules) On Windows, {obj}`--bootstrap_impl=system_python` is forced. This
allows setting `--bootstrap_impl=script` in bazelrc for mixed-platform
environments.
* (rules) {obj}`pip_compile` now generates a `.test` target. The `_test` target is deprecated
and will be removed in the next major release.
([#2794](https://github.com/bazel-contrib/rules_python/issues/2794)

{#v0-0-0-fixed}
### Fixed
Expand Down
10 changes: 8 additions & 2 deletions python/private/pypi/pip_compile.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def pip_compile(

It also generates two targets for running pip-compile:

- validate with `bazel test [name]_test`
- validate with `bazel test [name].test`
- update with `bazel run [name].update`

If you are using a version control system, the requirements.txt generated by this rule should
Expand Down Expand Up @@ -166,7 +166,7 @@ def pip_compile(
timeout = kwargs.pop("timeout", "short")

py_test(
name = name + "_test",
name = name + ".test",
timeout = timeout,
# setuptools (the default python build tool) attempts to find user
# configuration in the user's home direcotory. This seems to work fine on
Expand All @@ -180,3 +180,9 @@ def pip_compile(
# kwargs could contain test-specific attributes like size
**dict(attrs, **kwargs)
)

native.alias(
name = "{}_test".format(name),
actual = ":{}.test".format(name),
deprecation = "Use '{}.test' instead. The '*_test' target will be removed in the next major release.".format(name),
)