chitralverma opened a new pull request, #7877: URL: https://github.com/apache/opendal/pull/7877
# Which issue does this PR close? No tracking issue. Pre-work to make the Python binding's layers extensible. # Rationale for this change The Python binding keeps all layers in a single `src/layers.rs` with a single `layers.pyi` stub. As more layers are added, that file grows unwieldy. This restructures layers into a package so each layer is self-contained, without breaking any existing imports. # What changes are included in this PR? - Split `src/layers.rs` into a `src/layers/` package: `mod.rs` (the `PythonLayer` trait, the base `Layer`, and re-exports) plus one module per layer (`retry.rs`, `concurrent_limit.rs`, `mime_guess.rs`, `capability_override.rs`). - Each layer is exposed under a canonical `opendal.layers.<name>` submodule (e.g. `opendal.layers.retry.RetryLayer`) and re-exported flat on `opendal.layers`, so existing `opendal.layers.<Layer>` imports keep working. - The `.pyi` stubs become an `opendal/layers/` package (`__init__.pyi` plus one stub per layer). `scripts/postprocess_stubs.py` relocates PyO3's nested generated output into that package. Adding a layer later is: drop `src/layers/<name>.rs`, register it in `mod.rs` and `lib.rs`, and run `just stub-gen`. # Are there any user-facing changes? No breaking changes. Existing `opendal.layers.<Layer>` imports are unchanged; layers additionally gain canonical `opendal.layers.<name>` submodule paths. Validated: `cargo build`/`clippy`/`fmt`, `ruff`, `ty`, and `pytest` all pass; stub generation is reproducible from a clean tree. # AI Usage Statement Implemented with an AI coding agent (opencode, Claude Opus). Validated locally with the commands above. -- 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]
