ayush00git opened a new pull request, #3361: URL: https://github.com/apache/fory/pull/3361
<!-- **Thanks for contributing to Apache Fory™.** **If this is your first time opening a PR on fory, you can refer to [CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md).** Contribution Checklist - The **Apache Fory™** community has requirements on the naming of pr titles. You can also find instructions in [CONTRIBUTING.md](https://github.com/apache/fory/blob/main/CONTRIBUTING.md). - Apache Fory™ has a strong focus on performance. If the PR you submit will have an impact on performance, please benchmark it first and provide the benchmark result here. --> ## Why? For initializing stub generation for languages compiler flags `--grpc` and `--grpc-backend` are required. ## What does this PR do? ### 1. fory_compiler/base.py Update `GeneratorOptions` to include grpc (bool) and grpc_backend (str). ```python @dataclass class GeneratorOptions: """Options for code generation.""" output_dir: Path package_override: Optional[str] = None go_nested_type_style: Optional[str] = None grpc: bool = False grpc_backend: Optional[str] = None ``` Add generate_services(self) -> List[GeneratedFile] method to `BaseGenerator` (returns empty list by default). ```python def generate_services(self) -> List[GeneratedFile]: """Generate service-related code (e.g. gRPC stubs). Base implementation returns empty list. Subclasses should override if they support service generation. """ return [] ``` ## Related issues Closes #3271 ## Does this PR introduce any user-facing change? <!-- If any user-facing interface changes, please [open an issue](https://github.com/apache/fory/issues/new/choose) describing the need to do so and update the document if necessary. Delete section if not applicable. --> - [ ] Does this PR introduce any public API change? - [ ] Does this PR introduce any binary protocol compatibility change? ## Benchmark N/A -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
