File tree 10 files changed +26
-70
lines changed
testdata/resolve_deps_relative_imports
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) {
132
132
LineNumber : 2 ,
133
133
From : "foo" ,
134
134
},
135
- {
136
- Name : ".abc" ,
137
- LineNumber : 3 ,
138
- Filepath : "" ,
139
- From : "" ,
140
- },
141
135
},
142
136
},
143
137
}
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 1
1
load("@rules_python//python:defs.bzl", "py_binary")
2
2
3
+ # gazelle:python_generation_mode package
4
+
3
5
py_binary(
4
6
name = "resolve_deps_relative_imports_bin",
5
7
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
-
15
1
from package1 .module1 import function1
16
2
from package2 .module3 import function3
17
3
Original file line number Diff line number Diff line change @@ -8,5 +8,5 @@ py_library(
8
8
"module4.py",
9
9
],
10
10
visibility = ["//:__subpackages__"],
11
- deps = ["//package2/subpackage1 "],
11
+ deps = ["//package2/library "],
12
12
)
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 13
13
# limitations under the License.
14
14
15
15
16
- from . import Class1
17
- from .subpackage1 .module5 import function5
16
+ from .library import function5
18
17
19
18
20
19
def 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