Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 gazelle/python/kinds.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ var pyKinds = map[string]rule.KindInfo{
},
ResolveAttrs: map[string]bool{
"deps": true,
"pyi_deps": true,
},
},
pyLibraryKind: {
Expand All @@ -62,6 +63,7 @@ var pyKinds = map[string]rule.KindInfo{
},
ResolveAttrs: map[string]bool{
"deps": true,
"pyi_deps": true,
},
},
pyTestKind: {
Expand All @@ -78,6 +80,7 @@ var pyKinds = map[string]rule.KindInfo{
},
ResolveAttrs: map[string]bool{
"deps": true,
"pyi_deps": true,
},
},
}
Expand Down
9 changes: 9 additions & 0 deletions gazelle/python/testdata/clear_out_deps/BUILD.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
load("@rules_python//python:defs.bzl", "py_library")

py_library(
name = "clear_out_deps",
srcs = ["__init__.py"],
deps = [":removed_a"],
visibility = ["//:__subpackages__"],
pyi_deps = [":removed_b"],
)
7 changes: 7 additions & 0 deletions gazelle/python/testdata/clear_out_deps/BUILD.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
load("@rules_python//python:defs.bzl", "py_library")

py_library(
name = "clear_out_deps",
srcs = ["__init__.py"],
visibility = ["//:__subpackages__"],
)
5 changes: 5 additions & 0 deletions gazelle/python/testdata/clear_out_deps/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Clearing deps / pyi_deps

This test case asserts that an existing `py_library` specifying `deps` and
`pyi_deps` have these attributes removed if the corresponding imports are
removed.
1 change: 1 addition & 0 deletions gazelle/python/testdata/clear_out_deps/WORKSPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# This is a Bazel workspace for the Gazelle test data.
13 changes: 13 additions & 0 deletions gazelle/python/testdata/clear_out_deps/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2023 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
15 changes: 15 additions & 0 deletions gazelle/python/testdata/clear_out_deps/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2023 The Bazel Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---