File tree Expand file tree Collapse file tree 10 files changed +26
-70
lines changed
testdata/resolve_deps_relative_imports Expand file tree Collapse file tree 10 files changed +26
-70
lines changed Original file line number Diff line number Diff line change @@ -132,12 +132,6 @@ func TestParseImportStatements(t *testing.T) {
132132 LineNumber : 2 ,
133133 From : "foo" ,
134134 },
135- {
136- Name : ".abc" ,
137- LineNumber : 3 ,
138- Filepath : "" ,
139- From : "" ,
140- },
141135 },
142136 },
143137 }
Original file line number Diff line number Diff line change 1+ # gazelle:python_generation_mode package
Original file line number Diff line number Diff line change 11load("@rules_python//python:defs.bzl", "py_binary")
22
3+ # gazelle:python_generation_mode package
4+
35py_binary(
46 name = "resolve_deps_relative_imports_bin",
57 srcs = ["__main__.py"],
Original file line number Diff line number Diff line change 1- # Copyright 2023 The Bazel Authors. All rights reserved.
2- #
3- # Licensed under the Apache License, Version 2.0 (the "License");
4- # you may not use this file except in compliance with the License.
5- # You may obtain a copy of the License at
6- #
7- # http://www.apache.org/licenses/LICENSE-2.0
8- #
9- # Unless required by applicable law or agreed to in writing, software
10- # distributed under the License is distributed on an "AS IS" BASIS,
11- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12- # See the License for the specific language governing permissions and
13- # limitations under the License.
14-
151from package1 .module1 import function1
162from package2 .module3 import function3
173
Original file line number Diff line number Diff line change @@ -8,5 +8,5 @@ py_library(
88 "module4.py",
99 ],
1010 visibility = ["//:__subpackages__"],
11- deps = ["//package2/subpackage1 "],
11+ deps = ["//package2/library "],
1212)
Original file line number Diff line number Diff line change 1- # Copyright 2023 The Bazel Authors. All rights reserved.
2- #
3- # Licensed under the Apache License, Version 2.0 (the "License");
4- # you may not use this file except in compliance with the License.
5- # You may obtain a copy of the License at
6- #
7- # http://www.apache.org/licenses/LICENSE-2.0
8- #
9- # Unless required by applicable law or agreed to in writing, software
10- # distributed under the License is distributed on an "AS IS" BASIS,
11- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12- # See the License for the specific language governing permissions and
13- # limitations under the License.
14-
15-
16- class Class1 :
17- def method1 (self ):
18- return "method1"
1+ from .library import add as _add
2+ from .library import divide as _divide
3+ from .library import multiply as _multiply
4+ from .library import subtract as _subtract
5+
6+
7+ def add (a , b ):
8+ return _add (a , b )
9+
10+
11+ def divide (a , b ):
12+ return _divide (a , b )
13+
14+
15+ def multiply (a , b ):
16+ return _multiply (a , b )
17+
18+
19+ def subtract (a , b ):
20+ return _subtract (a , b )
Original file line number Diff line number Diff line change 1313# limitations under the License.
1414
1515
16- from . import Class1
17- from .subpackage1 .module5 import function5
16+ from .library import function5
1817
1918
2019def function3 ():
21- c1 = Class1 ()
22- return "function3 " + c1 .method1 () + " " + function5 ()
20+ return "function3 " + function5 ()
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments