Skip to content

Commit 89bf697

Browse files
committed
Small fixes to re-enable a few PYI rules
1 parent 6be1479 commit 89bf697

7 files changed

Lines changed: 14 additions & 10 deletions

File tree

pyproject.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,9 @@ ignore = [
5656

5757
# TODO: Investigate and fix or configure
5858
"PYI001",
59-
"PYI002",
60-
"PYI017",
6159
"PYI019", # Request for more autofixes: https://github.com/astral-sh/ruff/issues/15798
6260
"PYI024",
63-
"PYI048",
6461
"PYI051", # Request for autofix: https://github.com/astral-sh/ruff/issues/14185
65-
"PYI052",
6662
]
6763
[tool.ruff.lint.per-file-ignores]
6864
"*.pyi" = [

stubs/sklearn/utils/sparsefuncs_fast.pyi

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,3 +113,7 @@ def assign_rows_csr(
113113
out : array, shape=(arbitrary, n_features)
114114
"""
115115
...
116+
117+
def foo() -> None:
118+
pass
119+
...

stubs/sympy-stubs/codegen/ast.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,9 @@ class FloatBaseType(Type):
147147
class FloatType(FloatBaseType):
148148
__slots__ = ...
149149
_fields = ...
150-
_construct_nexp = _construct_nmant = _construct_nbits = Integer
150+
_construct_nexp = Integer
151+
_construct_nmant = Integer
152+
_construct_nbits = Integer
151153
@property
152154
def max_exponent(self) -> Expr: ...
153155
@property

stubs/sympy-stubs/matrices/dense.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ class DenseMatrix(RepMatrix):
2121
class MutableDenseMatrix(DenseMatrix, MutableRepMatrix):
2222
def simplify(self, **kwargs) -> None: ...
2323

24-
Matrix = MutableMatrix = MutableDenseMatrix
24+
Matrix = MutableDenseMatrix
25+
MutableMatrix = MutableDenseMatrix
2526

2627
def list2numpy(l, dtype=...) -> NDArray[Any, Any]: ...
2728
def matrix2numpy(m, dtype=...) -> NDArray[Any, Any]: ...

stubs/sympy-stubs/polys/domains/simpledomain.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ from typing_extensions import Self
33
from sympy.polys.domains.domain import Domain
44

55
class SimpleDomain(Domain):
6-
is_Simple = True
6+
is_Simple: bool = True
77
def inject(self, *gens) -> Self: ...

stubs/sympy-stubs/polys/polymatrix.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,5 @@ class MutablePolyDenseMatrix:
3939
def nullspace(self) -> list[Self]: ...
4040
def rank(self): ...
4141

42-
PolyMatrix = MutablePolyMatrix = MutablePolyDenseMatrix
42+
PolyMatrix = MutablePolyDenseMatrix
43+
MutablePolyMatrix = MutablePolyDenseMatrix

tests/run_tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ def install_requirements(test_folder: Path):
1414
def run_pyright():
1515
print("\nRunning Pyright...")
1616
# https://github.com/RobertCraigie/pyright-python#keeping-pyright-and-pylance-in-sync
17-
del os.environ["PYRIGHT_PYTHON_FORCE_VERSION"]
17+
os.environ.pop("PYRIGHT_PYTHON_FORCE_VERSION", None)
1818
os.environ["PYRIGHT_PYTHON_PYLANCE_VERSION"] = "latest-prerelease"
1919
return subprocess.run((sys.executable, "-m", "pyright"))
2020

2121

2222
def run_mypy():
2323
print("\nRunning mypy...")
24-
return subprocess.run((sys.executable, "-m", "mypy"))
24+
return subprocess.run((sys.executable, "-m", "mypy", "."))
2525

2626

2727
def main():

0 commit comments

Comments
 (0)