Add option for include directories#5
Conversation
amerry
left a comment
There was a problem hiding this comment.
Sorry it's taken me a while to get to this - it turns out I didn't have notifications enabled for this repo.
| args.append(f"--{generator.name}_out={generator.output_path}") | ||
|
|
||
| for include in self._includes: | ||
| args.append(f"-I{include}") |
There was a problem hiding this comment.
i'd rather use --proto_path like with self._proto_paths above (and also either merge it with that loop or put it immediately next to that loop) - -I and --proto_path do the same thing, but i'd like to be consistent about which we use
| | `generate_pyi` | `true` | Whether to generate .pyi output files. Note that these are not generated for the gRPC output. You may want to use mypy-protobuf instead. | | ||
| | `proto_paths` | `["."]` or `["src"]` | An array of paths to search for `.proto` files. Also passed as `--proto_path` arguments to `protoc`. | | ||
| | `output_path` | `"."` or `"src"` | The default output directory. This can be overridden on a per-generator basis for custom generators. | | ||
| | `includes` | `[]` | Additional include directories to pass to `protoc` via `-I` flag. | |
There was a problem hiding this comment.
As with my other comment, I'd like to be consistent about using -I vs --proto_path. I think it would also be worth explicitly stating (either in the table or below it) that proto_paths and includes both add to the list of places that protoc searches for includes, but only files in proto_paths will be generated into code
|
this functionality has been covered by #14 |
This PR adds an option for passing additional include directories to
protoc.I only tested it for my usecase.
This should probably be thought together with #4
The naming is confusing because it is
proto_pathbut without adding the sources.