8000 Removes unused "incremental" property (#948) · comius/rules_python@d400f6b · GitHub
[go: up one dir, main page]

Skip to content

Commit d400f6b

Browse files
authored
Removes unused "incremental" property (bazel-contrib#948)
1 parent b3bf124 commit d400f6b

File tree

25 files changed

+36
-111
lines changed

25 files changed

+36
-111
lines changed

docs/pip.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/build_file_generation/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ modules_mapping(
4141
gazelle_python_manifest(
4242
name = "gazelle_python_manifest",
4343
modules_mapping = ":modules_map",
44-
pip_repository_incremental = True,
4544
pip_repository_name = "pip",
4645
requirements = "//:requirements_lock.txt",
4746
)

examples/build_file_generation/gazelle_python.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,5 +114,4 @@ manifest:
114114
zipp.py310compat: zipp
115115
pip_repository:
116116
name: pip
117-
incremental: true
118-
integrity: de2beca77b2b1e9c3ef24b56aab589fc05486abf1e0c08b51ea723621360ec73
117+
integrity: 4153df7683d64d7d6ad56c14ea1c7f7bec84a2ddf9ef8f075d1bb9313b8d11aa

gazelle/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ gazelle_python_manifest(
6363
# This is what we called our `pip_install` rule, where third-party
6464
# python libraries are loaded in BUILD files.
6565
pip_repository_name = "pip",
66-
# When using pip_parse instead of pip_install, set the following.
67-
# pip_repository_incremental = True,
6866
# This should point to wherever we declare our python dependencies
6967
# (the same as what we passed to the modules_mapping rule in WORKSPACE)
7068
requirements = "//:requirements_lock.txt",

gazelle/manifest/defs.bzl

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ def gazelle_python_manifest(
99
requirements,
1010
modules_mapping,
1111
pip_repository_name = "",
12-
pip_repository_incremental = False,
1312
pip_deps_repository_name = "",
1413
manifest = ":gazelle_python.yaml"):
1514
"""A macro for defining the updating and testing targets for the Gazelle manifest file.
@@ -18,7 +17,6 @@ def gazelle_python_manifest(
1817
name: the name used as a base for the targets.
1918
requirements: the target for the requirements.txt file.
2019
pip_repository_name: the name of the pip_install or pip_repository target.
21-
pip_repository_incremental: the incremental property of pip_repository.
2220
pip_deps_repository_name: deprecated - the old pip_install target name.
2321
modules_mapping: the target for the generated modules_mapping.json file.
2422
manifest: the target for the Gazelle manifest file.
@@ -54,8 +52,6 @@ def gazelle_python_manifest(
5452
"--update-target",
5553
update_target_label,
5654
]
57-
if pip_repository_incremental:
58-
update_args.append("--pip-repository-incremental")
5955

6056
go_binary(
6157
name = update_target,

gazelle/manifest/generate/generate.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ func main() {
2727
var manifestGeneratorHashPath string
2828
var requirementsPath string
2929
var pipRepositoryName string
30-
var pipRepositoryIncremental bool
3130
var modulesMappingPath string
3231
var outputPath string
3332
var updateTarget string
@@ -47,11 +46,6 @@ func main() {
4746
"pip-repository-name",
4847
"",
4948
"The name of the pip_install or pip_repository target.")
50-
flag.BoolVar(
51-
&pipRepositoryIncremental,
52-
"pip-repository-incremental",
53-
false,
54-
"The value for the incremental option in pip_repository.")
5549
flag.StringVar(
5650
&modulesMappingPath,
5751
"modules-mapping",
@@ -96,7 +90,6 @@ func main() {
9690
ModulesMapping: modulesMapping,
9791
PipRepository: &manifest.PipRepository{
9892
Name: pipRepositoryName,
99-
Incremental: pipRepositoryIncremental,
10093
},
10194
})
10295
if err := writeOutput(

gazelle/manifest/manifest.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,4 @@ type Manifest struct {
130130
type PipRepository struct {
131131
// The name of the pip_install or pip_repository target.
132132
Name string
133-
// The incremental property of pip_repository.
134-
Incremental bool
135133
}

gazelle/pythonconfig/pythonconfig.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,9 @@ func (c *Config) FindThirdPartyDependency(modName string) (string, bool) {
207207
sanitizedDistribution := strings.ToLower(distributionName)
208208
sanitizedDistribution = strings.ReplaceAll(sanitizedDistribution, "-", "_")
209209
var lbl label.Label
210-
if gazelleManifest.PipRepository != nil && gazelleManifest.PipRepository.Incremental {
211-
// @<repository_name>_<distribution_name>//:pkg
212-
distributionRepositoryName = distributionRepositoryName + "_" + sanitizedDistribution
213-
lbl = label.New(distributionRepositoryName, "", "pkg")
214-
} else {
215-
// @<repository_name>//pypi__<distribution_name>
216-
distributionPackage := "pypi__" + sanitizedDistribution
217-
lbl = label.New(distributionRepositoryName, distributionPackage, distributionPackage)
218-
}
210+
// @<repository_name>_<distribution_name>//:pkg
211+
distributionRepositoryName = distributionRepositoryName + "_" + sanitizedDistribution
212+
lbl = label.New(distributionRepositoryName, "", "pkg")
219213
return lbl.String(), true
220214
}
221215
}

gazelle/testdata/dependency_resolution_order/BUILD.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ py_library(
99
deps = [
1010
"//baz",
1111
"//somewhere/bar",
12-
"@gazelle_python_test//pypi__some_foo",
12+
"@gazelle_python_test_some_foo//:pkg",
1313
],
1414
)

gazelle/testdata/file_name_matches_import_statement/BUILD.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ py_library(
77
"rest_framework.py",
88
],
99
visibility = ["//:__subpackages__"],
10-
deps = ["@gazelle_python_test//pypi__djangorestframework"],
10+
deps = ["@gazelle_python_test_djangorestframework//:pkg"],
1111
)

0 commit comments

Comments
 (0)
0