mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Fix ruff linting warnings from generated template files for extension modules (#10371)
## Summary This PR fixes two ruff linting issues in the generated template files when using: `uv init --build-backend` for extension modules. 1. Removes unnecessary `from __future__ import annotations` imports from generated .pyi files ([PYI044](https://docs.astral.sh/ruff/rules/future-annotations-in-stub/)) 2. Adds missing blank line after `hello_from_bin` import to comply with isort formatting ([I001](https://docs.astral.sh/ruff/rules/unsorted-imports/)) ## Test Plan ```bash cargo run -- init --build-backend scikit-build-core example-ext uvx ruff check example-ext --select ALL cargo run -- init --build-backend maturin example-ext uvx ruff check example-ext --select ALL ``` ## Remaining warnings There are still warnings remainings in the generated `__init__.py` files: - [D104](https://docs.astral.sh/ruff/rules/undocumented-public-package/) Missing docstring in public package - [D103](https://docs.astral.sh/ruff/rules/undocumented-public-function/) Missing docstring in public function - [T201](https://docs.astral.sh/ruff/rules/print/) `print` found
This commit is contained in:
parent
c8b3e8523c
commit
a2a2662d43
3 changed files with 7 additions and 10 deletions
|
@ -279,6 +279,7 @@ And the Python module imports it:
|
|||
```python title="src/example_ext/__init__.py"
|
||||
from example_ext._core import hello_from_bin
|
||||
|
||||
|
||||
def main() -> None:
|
||||
print(hello_from_bin())
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue