|
48 | 48 | buildFilenames = []string{"BUILD", "BUILD.bazel"}
|
49 | 49 | )
|
50 | 50 |
|
51 |
| -func GetActualKindName(kind string, c *config.Config) string { |
52 |
| - if kindOverride, ok := c.KindMap[kind]; ok { |
| 51 | +func GetActualKindName(kind string, args language.GenerateArgs) string { |
| 52 | + if kindOverride, ok := args.Config.KindMap[kind]; ok { |
53 | 53 | return kindOverride.KindName
|
54 | 54 | }
|
55 | 55 | return kind
|
@@ -90,9 +90,9 @@ func (py *Python) GenerateRules(args language.GenerateArgs) language.GenerateRes
|
90 | 90 | }
|
91 | 91 | }
|
92 | 92 |
|
93 |
| - actualPyBinaryKind := GetActualKindName(pyBinaryKind, args.Config) |
94 |
| - actualPyLibraryKind := GetActualKindName(pyLibraryKind, args.Config) |
95 |
| - actualPyTestKind := GetActualKindName(pyTestKind, args.Config) |
| 93 | + actualPyBinaryKind := GetActualKindName(pyBinaryKind, args) |
| 94 | + actualPyLibraryKind := GetActualKindName(pyLibraryKind, args) |
| 95 | + actualPyTestKind := GetActualKindName(pyTestKind, args) |
96 | 96 |
|
97 | 97 | pythonProjectRoot := cfg.PythonProjectRoot()
|
98 | 98 |
|
@@ -123,7 +123,6 @@ func (py *Python) GenerateRules(args language.GenerateArgs) language.GenerateRes
|
123 | 123 | pyFileNames.Add(f)
|
124 | 124 | if !hasPyBinaryEntryPointFile && f == pyBinaryEntrypointFilename {
|
125 | 125 | hasPyBinaryEntryPointFile = true
|
126 |
| - pyLibraryFilenames.Add(f) |
127 | 126 | } else if !hasPyTestEntryPointFile && f == pyTestEntrypointFilename {
|
128 | 127 | hasPyTestEntryPointFile = true
|
129 | 128 | } else if f == conftestFilename {
|
@@ -248,9 +247,9 @@ func (py *Python) GenerateRules(args language.GenerateArgs) language.GenerateRes
|
248 | 247 |
|
249 | 248 | // Remove the file from srcs if we're doing per-file library generation so
|
250 | 249 | // that we don't also generate a py_library target for it.
|
251 |
| - // if cfg.PerFileGeneration() { |
252 |
| - // srcs.Remove(name) |
253 |
| - // } |
| 250 | + if cfg.PerFileGeneration() { |
| 251 | + srcs.Remove(name) |
| 252 | + } |
254 | 253 | }
|
255 | 254 | sort.Strings(mainFileNames)
|
256 | 255 | for _, filename := range mainFileNames {
|
@@ -353,7 +352,6 @@ func (py *Python) GenerateRules(args language.GenerateArgs) language.GenerateRes
|
353 | 352 | collisionErrors.Add(err)
|
354 | 353 | }
|
355 | 354 |
|
356 |
| - // Create the py_binary target that depends on the py_library |
357 | 355 | pyBinaryTarget := newTargetBuilder(pyBinaryKind, pyBinaryTargetName, pythonProjectRoot, args.Rel, pyFileNames).
|
358 | 356 | setMain(pyBinaryEntrypointFilename).
|
359 | 357 | addVisibility(visibility).
|
|
0 commit comments