Skip to content

Commit 1a65bad

Browse files
authored
More imports and setup ruff check (#29)
1 parent 9ad0f7f commit 1a65bad

File tree

6 files changed

+16
-7
lines changed

6 files changed

+16
-7
lines changed

.github/workflows/python.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ jobs:
4343
working-directory: ./${{ matrix.crate }}
4444

4545
- name: Type check
46-
run: |
47-
pyright
46+
run: pyright
47+
working-directory: ./${{ matrix.crate }}
48+
49+
- name: Lint
50+
run: ruff check
4851
working-directory: ./${{ matrix.crate }}

pyo3-stub-gen-testing-mixed/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "pyo3_stub_gen_testing_mixed"
77
requires-python = ">=3.9"
88

99
[project.optional-dependencies]
10-
test = ["pytest", "pyright"]
10+
test = ["pytest", "pyright", "ruff"]
1111

1212
[tool.maturin]
1313
python-source = "python"

pyo3-stub-gen-testing-mixed/python/pyo3_stub_gen_testing_mixed/my_rust_pkg.pyi

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# This file is automatically generated by pyo3_stub_gen
2+
# ruff: noqa: E501, F401
23

3-
from typing import final, Any, List, Dict
4+
from typing import final, Any, List, Dict, Sequence, Mapping
45
from enum import Enum, auto
56

67
def sum_as_string(a:int,b:int) -> str:

pyo3-stub-gen-testing-pure/pyo3_stub_gen_testing_pure.pyi

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# This file is automatically generated by pyo3_stub_gen
2+
# ruff: noqa: E501, F401
23

3-
from typing import final, Any, List, Dict
4+
from typing import final, Any, List, Dict, Sequence, Mapping
45
from enum import Enum, auto
56

67
def sum_as_string(a:int,b:int) -> str:

pyo3-stub-gen-testing-pure/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ name = "pyo3_stub_gen_testing_pure"
77
requires-python = ">=3.9"
88

99
[project.optional-dependencies]
10-
test = ["pytest", "pyright"]
10+
test = ["pytest", "pyright", "ruff"]

pyo3-stub-gen/src/generate.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,12 @@ pub struct Module {
346346
impl fmt::Display for Module {
347347
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
348348
writeln!(f, "# This file is automatically generated by pyo3_stub_gen")?;
349+
writeln!(f, "# ruff: noqa: E501, F401")?;
349350
writeln!(f)?;
350-
writeln!(f, "from typing import final, Any, List, Dict")?;
351+
writeln!(
352+
f,
353+
"from typing import final, Any, List, Dict, Sequence, Mapping"
354+
)?;
351355
writeln!(f, "from enum import Enum, auto")?;
352356
writeln!(f)?;
353357

0 commit comments

Comments
 (0)