aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgnas Anikevicius <240938+aignas@users.noreply.github.com>2023-12-21 16:04:59 +0900
committerGitHub <noreply@github.com>2023-12-21 07:04:59 +0000
commit2cbdc1b57bb7591577fbf406d499ce403af067a6 (patch)
tree50accf873b2ef4270c53318f0e57a9d4df409bc6
parent68835244241c88bd54fd13ff5a94d78ca4fdb2bf (diff)
downloadbazelbuild-rules_python-2cbdc1b57bb7591577fbf406d499ce403af067a6.tar.gz
chore!: remove pip_install macro and cleanup docs (#1570)
-rw-r--r--CHANGELOG.md3
-rw-r--r--docs/sphinx/pypi-dependencies.md12
-rw-r--r--gazelle/README.md2
-rw-r--r--gazelle/manifest/manifest.go6
-rw-r--r--python/pip.bzl15
-rw-r--r--python/pip_install/repositories.bzl4
6 files changed, 8 insertions, 34 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index ee5421f..31e8d25 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -31,6 +31,9 @@ A brief description of the categories of changes:
is also available under bzlmod as
`pip.parse(experimental_requirement_cycles={})`.
+* (pip_install) the deprecated `pip_install` macro and related items have been
+ removed.
+
### Fixed
* (gazelle) The gazelle plugin helper was not working with Python toolchains 3.11
diff --git a/docs/sphinx/pypi-dependencies.md b/docs/sphinx/pypi-dependencies.md
index 598aade..880945f 100644
--- a/docs/sphinx/pypi-dependencies.md
+++ b/docs/sphinx/pypi-dependencies.md
@@ -66,18 +66,6 @@ re-executed to pick up a non-hermetic change to your environment (e.g., updating
your system `python` interpreter), you can force it to re-execute by running
`bazel sync --only [pip_parse name]`.
-:::{note}
-The `pip_install` rule is deprecated. `pip_parse` offers identical
-functionality, and both `pip_install` and `pip_parse` now have the same
-implementation. The name `pip_install` may be removed in a future version of the
-rules.
-:::
-
-The maintainers have made all reasonable efforts to facilitate a smooth
-transition. Still, some users of `pip_install` will need to replace their
-existing `requirements.txt` with a fully resolved set of dependencies using a
-tool such as `pip-tools` or the `compile_pip_requirements` repository rule.
-
{#using-third-party-packages}
## Using third party packages as dependencies
diff --git a/gazelle/README.md b/gazelle/README.md
index 567d290..a9a69cc 100644
--- a/gazelle/README.md
+++ b/gazelle/README.md
@@ -109,7 +109,7 @@ modules_mapping(
gazelle_python_manifest(
name = "gazelle_python_manifest",
modules_mapping = ":modules_map",
- # This is what we called our `pip_install` rule, where third-party
+ # This is what we called our `pip_parse` rule, where third-party
# python libraries are loaded in BUILD files.
pip_repository_name = "pip",
# This should point to wherever we declare our python dependencies
diff --git a/gazelle/manifest/manifest.go b/gazelle/manifest/manifest.go
index e95ef06..55adef0 100644
--- a/gazelle/manifest/manifest.go
+++ b/gazelle/manifest/manifest.go
@@ -133,16 +133,16 @@ type Manifest struct {
// ModulesMapping is the mapping from importable modules to which Python
// wheel name provides these modules.
ModulesMapping ModulesMapping `yaml:"modules_mapping"`
- // PipDepsRepositoryName is the name of the pip_install repository target.
+ // PipDepsRepositoryName is the name of the pip_parse repository target.
// DEPRECATED
PipDepsRepositoryName string `yaml:"pip_deps_repository_name,omitempty"`
- // PipRepository contains the information for pip_install or pip_repository
+ // PipRepository contains the information for pip_parse or pip_repository
// target.
PipRepository *PipRepository `yaml:"pip_repository,omitempty"`
}
type PipRepository struct {
- // The name of the pip_install or pip_repository target.
+ // The name of the pip_parse or pip_repository target.
Name string
// UsePipRepositoryAliases allows to use aliases generated pip_repository
// when passing incompatible_generate_aliases = True.
diff --git a/python/pip.bzl b/python/pip.bzl
index b6b8801..aeedf57 100644
--- a/python/pip.bzl
+++ b/python/pip.bzl
@@ -30,21 +30,6 @@ compile_pip_requirements = _compile_pip_requirements
package_annotation = _package_annotation
pip_parse = pip_repository
-def pip_install(requirements = None, name = "pip", allow_pip_install = False, **kwargs):
- """Will be removed in 0.28.0
-
- Args:
- requirements (Label): A 'requirements.txt' pip requirements file.
- name (str, optional): A unique name for the created external repository (default 'pip').
- allow_pip_install (bool, optional): change this to keep this rule working (default False).
- **kwargs (dict): Additional arguments to the [`pip_parse`](#pip_parse) repository rule.
- """
-
- if allow_pip_install:
- pip_parse(requirements = requirements, name = name, **kwargs)
- else:
- fail("pip_install support has been disabled, please use pip_parse as a replacement.")
-
def _multi_pip_parse_impl(rctx):
rules_python = rctx.attr._rules_python_workspace.workspace_name
load_statements = []
diff --git a/python/pip_install/repositories.bzl b/python/pip_install/repositories.bzl
index 37500a6..91bdd4b 100644
--- a/python/pip_install/repositories.bzl
+++ b/python/pip_install/repositories.bzl
@@ -131,9 +131,7 @@ def requirement(pkg):
def pip_install_dependencies():
"""
- Fetch dependencies these rules depend on. Workspaces that use the pip_install rule can call this.
-
- (However we call it from pip_install, making it optional for users to do so.)
+ Fetch dependencies these rules depend on. Workspaces that use the pip_parse rule can call this.
"""
for (name, url, sha256) in _RULE_DEPS:
maybe(