aboutsummaryrefslogtreecommitdiff
path: root/gazelle
diff options
context:
space:
mode:
authorGreg Roodt <groodt@gmail.com>2022-12-27 11:34:30 +1100
committerGitHub <noreply@github.com>2022-12-27 11:34:30 +1100
commitd400f6bf37aacbc9ceb04f7395cc048a1f811611 (patch)
treef0294b789f03732ca6e305447ee4e91b14b3ec5a /gazelle
parentb3bf1243926b674d7041fd49da4865c658b4bddb (diff)
downloadbazelbuild-rules_python-d400f6bf37aacbc9ceb04f7395cc048a1f811611.tar.gz
Removes unused "incremental" property (#948)
Diffstat (limited to 'gazelle')
-rw-r--r--gazelle/README.md2
-rw-r--r--gazelle/manifest/defs.bzl4
-rw-r--r--gazelle/manifest/generate/generate.go7
-rw-r--r--gazelle/manifest/manifest.go2
-rw-r--r--gazelle/pythonconfig/pythonconfig.go12
-rw-r--r--gazelle/testdata/dependency_resolution_order/BUILD.out2
-rw-r--r--gazelle/testdata/file_name_matches_import_statement/BUILD.out2
-rw-r--r--gazelle/testdata/ignored_invalid_imported_module/BUILD.out2
-rw-r--r--gazelle/testdata/monorepo/coarse_grained/BUILD.out2
-rw-r--r--gazelle/testdata/monorepo/one/BUILD.out2
-rw-r--r--gazelle/testdata/monorepo/one/bar/BUILD.out2
-rw-r--r--gazelle/testdata/monorepo/three/BUILD.out2
-rw-r--r--gazelle/testdata/monorepo/three/gazelle_python.yaml1
-rw-r--r--gazelle/testdata/monorepo/two/BUILD.out2
-rw-r--r--gazelle/testdata/python_ignore_dependencies_directive/BUILD.out2
-rw-r--r--gazelle/testdata/python_target_with_test_in_name/BUILD.out2
-rw-r--r--gazelle/testdata/with_nested_import_statements/BUILD.out2
-rw-r--r--gazelle/testdata/with_third_party_requirements/BUILD.out8
-rw-r--r--gazelle/testdata/with_third_party_requirements_from_imports/gazelle_python.yaml1
19 files changed, 18 insertions, 41 deletions
diff --git a/gazelle/README.md b/gazelle/README.md
index e622db9..a54db64 100644
--- a/gazelle/README.md
+++ b/gazelle/README.md
@@ -63,8 +63,6 @@ gazelle_python_manifest(
# This is what we called our `pip_install` rule, where third-party
# python libraries are loaded in BUILD files.
pip_repository_name = "pip",
- # When using pip_parse instead of pip_install, set the following.
- # pip_repository_incremental = True,
# This should point to wherever we declare our python dependencies
# (the same as what we passed to the modules_mapping rule in WORKSPACE)
requirements = "//:requirements_lock.txt",
diff --git a/gazelle/manifest/defs.bzl b/gazelle/manifest/defs.bzl
index a5bbe56..57f52f9 100644
--- a/gazelle/manifest/defs.bzl
+++ b/gazelle/manifest/defs.bzl
@@ -9,7 +9,6 @@ def gazelle_python_manifest(
requirements,
modules_mapping,
pip_repository_name = "",
- pip_repository_incremental = False,
pip_deps_repository_name = "",
manifest = ":gazelle_python.yaml"):
"""A macro for defining the updating and testing targets for the Gazelle manifest file.
@@ -18,7 +17,6 @@ def gazelle_python_manifest(
name: the name used as a base for the targets.
requirements: the target for the requirements.txt file.
pip_repository_name: the name of the pip_install or pip_repository target.
- pip_repository_incremental: the incremental property of pip_repository.
pip_deps_repository_name: deprecated - the old pip_install target name.
modules_mapping: the target for the generated modules_mapping.json file.
manifest: the target for the Gazelle manifest file.
@@ -54,8 +52,6 @@ def gazelle_python_manifest(
"--update-target",
update_target_label,
]
- if pip_repository_incremental:
- update_args.append("--pip-repository-incremental")
go_binary(
name = update_target,
diff --git a/gazelle/manifest/generate/generate.go b/gazelle/manifest/generate/generate.go
index 54e8813..7c2e064 100644
--- a/gazelle/manifest/generate/generate.go
+++ b/gazelle/manifest/generate/generate.go
@@ -27,7 +27,6 @@ func main() {
var manifestGeneratorHashPath string
var requirementsPath string
var pipRepositoryName string
- var pipRepositoryIncremental bool
var modulesMappingPath string
var outputPath string
var updateTarget string
@@ -47,11 +46,6 @@ func main() {
"pip-repository-name",
"",
"The name of the pip_install or pip_repository target.")
- flag.BoolVar(
- &pipRepositoryIncremental,
- "pip-repository-incremental",
- false,
- "The value for the incremental option in pip_repository.")
flag.StringVar(
&modulesMappingPath,
"modules-mapping",
@@ -96,7 +90,6 @@ func main() {
ModulesMapping: modulesMapping,
PipRepository: &manifest.PipRepository{
Name: pipRepositoryName,
- Incremental: pipRepositoryIncremental,
},
})
if err := writeOutput(
diff --git a/gazelle/manifest/manifest.go b/gazelle/manifest/manifest.go
index 640effc..5668d9c 100644
--- a/gazelle/manifest/manifest.go
+++ b/gazelle/manifest/manifest.go
@@ -130,6 +130,4 @@ type Manifest struct {
type PipRepository struct {
// The name of the pip_install or pip_repository target.
Name string
- // The incremental property of pip_repository.
- Incremental bool
}
diff --git a/gazelle/pythonconfig/pythonconfig.go b/gazelle/pythonconfig/pythonconfig.go
index 7e65fd9..64f6264 100644
--- a/gazelle/pythonconfig/pythonconfig.go
+++ b/gazelle/pythonconfig/pythonconfig.go
@@ -207,15 +207,9 @@ func (c *Config) FindThirdPartyDependency(modName string) (string, bool) {
sanitizedDistribution := strings.ToLower(distributionName)
sanitizedDistribution = strings.ReplaceAll(sanitizedDistribution, "-", "_")
var lbl label.Label
- if gazelleManifest.PipRepository != nil && gazelleManifest.PipRepository.Incremental {
- // @<repository_name>_<distribution_name>//:pkg
- distributionRepositoryName = distributionRepositoryName + "_" + sanitizedDistribution
- lbl = label.New(distributionRepositoryName, "", "pkg")
- } else {
- // @<repository_name>//pypi__<distribution_name>
- distributionPackage := "pypi__" + sanitizedDistribution
- lbl = label.New(distributionRepositoryName, distributionPackage, distributionPackage)
- }
+ // @<repository_name>_<distribution_name>//:pkg
+ distributionRepositoryName = distributionRepositoryName + "_" + sanitizedDistribution
+ lbl = label.New(distributionRepositoryName, "", "pkg")
return lbl.String(), true
}
}
diff --git a/gazelle/testdata/dependency_resolution_order/BUILD.out b/gazelle/testdata/dependency_resolution_order/BUILD.out
index 2ba2c84..3ea83eb 100644
--- a/gazelle/testdata/dependency_resolution_order/BUILD.out
+++ b/gazelle/testdata/dependency_resolution_order/BUILD.out
@@ -9,6 +9,6 @@ py_library(
deps = [
"//baz",
"//somewhere/bar",
- "@gazelle_python_test//pypi__some_foo",
+ "@gazelle_python_test_some_foo//:pkg",
],
)
diff --git a/gazelle/testdata/file_name_matches_import_statement/BUILD.out b/gazelle/testdata/file_name_matches_import_statement/BUILD.out
index fd6c485..0216e4b 100644
--- a/gazelle/testdata/file_name_matches_import_statement/BUILD.out
+++ b/gazelle/testdata/file_name_matches_import_statement/BUILD.out
@@ -7,5 +7,5 @@ py_library(
"rest_framework.py",
],
visibility = ["//:__subpackages__"],
- deps = ["@gazelle_python_test//pypi__djangorestframework"],
+ deps = ["@gazelle_python_test_djangorestframework//:pkg"],
)
diff --git a/gazelle/testdata/ignored_invalid_imported_module/BUILD.out b/gazelle/testdata/ignored_invalid_imported_module/BUILD.out
index 3cd47a6..b8c936a 100644
--- a/gazelle/testdata/ignored_invalid_imported_module/BUILD.out
+++ b/gazelle/testdata/ignored_invalid_imported_module/BUILD.out
@@ -4,5 +4,5 @@ py_library(
name = "ignored_invalid_imported_module",
srcs = ["__init__.py"],
visibility = ["//:__subpackages__"],
- deps = ["@gazelle_python_test//pypi__foo"],
+ deps = ["@gazelle_python_test_foo//:pkg"],
)
diff --git a/gazelle/testdata/monorepo/coarse_grained/BUILD.out b/gazelle/testdata/monorepo/coarse_grained/BUILD.out
index 0fba951..b11cbbd 100644
--- a/gazelle/testdata/monorepo/coarse_grained/BUILD.out
+++ b/gazelle/testdata/monorepo/coarse_grained/BUILD.out
@@ -16,5 +16,5 @@ py_library(
"foo/__init__.py",
],
visibility = ["//:__subpackages__"],
- deps = ["@root_pip_deps//pypi__rootboto3"],
+ deps = ["@root_pip_deps_rootboto3//:pkg"],
)
diff --git a/gazelle/testdata/monorepo/one/BUILD.out b/gazelle/testdata/monorepo/one/BUILD.out
index a957227..5098cc9 100644
--- a/gazelle/testdata/monorepo/one/BUILD.out
+++ b/gazelle/testdata/monorepo/one/BUILD.out
@@ -12,6 +12,6 @@ py_binary(
"//one/bar",
"//one/bar/baz:modified_name_baz",
"//one/foo",
- "@one_pip_deps//pypi__oneboto3",
+ "@one_pip_deps_oneboto3//:pkg",
],
)
diff --git a/gazelle/testdata/monorepo/one/bar/BUILD.out b/gazelle/testdata/monorepo/one/bar/BUILD.out
index 0e85623..6ee6515 100644
--- a/gazelle/testdata/monorepo/one/bar/BUILD.out
+++ b/gazelle/testdata/monorepo/one/bar/BUILD.out
@@ -8,5 +8,5 @@ py_library(
"//one:__subpackages__",
"//three:__subpackages__",
],
- deps = ["@one_pip_deps//pypi__oneboto3"],
+ deps = ["@one_pip_deps_oneboto3//:pkg"],
)
diff --git a/gazelle/testdata/monorepo/three/BUILD.out b/gazelle/testdata/monorepo/three/BUILD.out
index 0da269d..78a3927 100644
--- a/gazelle/testdata/monorepo/three/BUILD.out
+++ b/gazelle/testdata/monorepo/three/BUILD.out
@@ -15,7 +15,7 @@ py_library(
"//one/bar",
"//one/bar/baz:modified_name_baz",
"//one/foo",
- "@root_pip_deps//pypi__rootboto4",
+ "@root_pip_deps_rootboto4//:pkg",
"@three_pip_deps_threeboto3//:pkg",
],
)
diff --git a/gazelle/testdata/monorepo/three/gazelle_python.yaml b/gazelle/testdata/monorepo/three/gazelle_python.yaml
index d46a88f..8604169 100644
--- a/gazelle/testdata/monorepo/three/gazelle_python.yaml
+++ b/gazelle/testdata/monorepo/three/gazelle_python.yaml
@@ -3,4 +3,3 @@ manifest:
boto3: threeboto3
pip_repository:
name: three_pip_deps
- incremental: true
diff --git a/gazelle/testdata/monorepo/two/BUILD.out b/gazelle/testdata/monorepo/two/BUILD.out
index 4b638ed..9cda007 100644
--- a/gazelle/testdata/monorepo/two/BUILD.out
+++ b/gazelle/testdata/monorepo/two/BUILD.out
@@ -10,6 +10,6 @@ py_library(
visibility = ["//two:__subpackages__"],
deps = [
"//one/foo",
- "@two_pip_deps//pypi__twoboto3",
+ "@two_pip_deps_twoboto3//:pkg",
],
)
diff --git a/gazelle/testdata/python_ignore_dependencies_directive/BUILD.out b/gazelle/testdata/python_ignore_dependencies_directive/BUILD.out
index 37ae4f9..3fb91f5 100644
--- a/gazelle/testdata/python_ignore_dependencies_directive/BUILD.out
+++ b/gazelle/testdata/python_ignore_dependencies_directive/BUILD.out
@@ -7,5 +7,5 @@ py_library(
name = "python_ignore_dependencies_directive",
srcs = ["__init__.py"],
visibility = ["//:__subpackages__"],
- deps = ["@gazelle_python_test//pypi__boto3"],
+ deps = ["@gazelle_python_test_boto3//:pkg"],
)
diff --git a/gazelle/testdata/python_target_with_test_in_name/BUILD.out b/gazelle/testdata/python_target_with_test_in_name/BUILD.out
index bdde605..72a648f 100644
--- a/gazelle/testdata/python_target_with_test_in_name/BUILD.out
+++ b/gazelle/testdata/python_target_with_test_in_name/BUILD.out
@@ -8,5 +8,5 @@ py_library(
"test_not_a_real.py",
],
visibility = ["//:__subpackages__"],
- deps = ["@gazelle_python_test//pypi__boto3"],
+ deps = ["@gazelle_python_test_boto3//:pkg"],
)
diff --git a/gazelle/testdata/with_nested_import_statements/BUILD.out b/gazelle/testdata/with_nested_import_statements/BUILD.out
index bb2f34d..45bf265 100644
--- a/gazelle/testdata/with_nested_import_statements/BUILD.out
+++ b/gazelle/testdata/with_nested_import_statements/BUILD.out
@@ -4,5 +4,5 @@ py_library(
name = "with_nested_import_statements",
srcs = ["__init__.py"],
visibility = ["//:__subpackages__"],
- deps = ["@gazelle_python_test//pypi__boto3"],
+ deps = ["@gazelle_python_test_boto3//:pkg"],
)
diff --git a/gazelle/testdata/with_third_party_requirements/BUILD.out b/gazelle/testdata/with_third_party_requirements/BUILD.out
index 9854730..a8261a9 100644
--- a/gazelle/testdata/with_third_party_requirements/BUILD.out
+++ b/gazelle/testdata/with_third_party_requirements/BUILD.out
@@ -9,9 +9,9 @@ py_library(
],
visibility = ["//:__subpackages__"],
deps = [
- "@gazelle_python_test//pypi__baz",
- "@gazelle_python_test//pypi__boto3",
- "@gazelle_python_test//pypi__djangorestframework",
+ "@gazelle_python_test_baz//:pkg",
+ "@gazelle_python_test_boto3//:pkg",
+ "@gazelle_python_test_djangorestframework//:pkg",
],
)
@@ -22,6 +22,6 @@ py_binary(
visibility = ["//:__subpackages__"],
deps = [
":with_third_party_requirements",
- "@gazelle_python_test//pypi__baz",
+ "@gazelle_python_test_baz//:pkg",
],
)
diff --git a/gazelle/testdata/with_third_party_requirements_from_imports/gazelle_python.yaml b/gazelle/testdata/with_third_party_requirements_from_imports/gazelle_python.yaml
index 21edbc0..0e4a6d2 100644
--- a/gazelle/testdata/with_third_party_requirements_from_imports/gazelle_python.yaml
+++ b/gazelle/testdata/with_third_party_requirements_from_imports/gazelle_python.yaml
@@ -1661,5 +1661,4 @@ manifest:
urllib3.util.wait: urllib3
pip_repository:
name: gazelle_python_test
- incremental: true
integrity: 32e38932043eca090a64ca741758d8e4a5817c2cd7dc821fc927914c32fb3114