Skip to content

Commit 15e21a8

Browse files
Use pyright 1.1.230 in CI, temporarily pin pyright-action to 1.0.4 (#7495)
* Upgrade pyright to 1.1.230 * Add `type: ignore`s for new pyright checks regarding multiple inheritance * Temporarily pin pyright-action to 1.0.4, as changes made in 1.0.5 break typeshed's CI Co-authored-by: Jelle Zijlstra <[email protected]>
1 parent b78f0c2 commit 15e21a8

File tree

6 files changed

+26
-16
lines changed

6 files changed

+26
-16
lines changed

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,17 +72,17 @@ jobs:
7272
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"]
7373
fail-fast: false
7474
env:
75-
PYRIGHT_VERSION: 1.1.218 # Must match pyright_test.py.
75+
PYRIGHT_VERSION: 1.1.230 # Must match pyright_test.py.
7676
steps:
7777
- uses: actions/checkout@v2
78-
- uses: jakebailey/pyright-action@v1
78+
- uses: jakebailey/pyright-action@v1.0.4
7979
with:
8080
version: ${{ env.PYRIGHT_VERSION }}
8181
python-platform: ${{ matrix.python-platform }}
8282
python-version: ${{ matrix.python-version }}
8383
no-comments: ${{ matrix.python-version != '3.9' || matrix.python-platform != 'Linux' }} # Having each job create the same comment is too noisy.
8484
project: ./pyrightconfig.stricter.json
85-
- uses: jakebailey/pyright-action@v1
85+
- uses: jakebailey/pyright-action@v1.0.4
8686
with:
8787
version: ${{ env.PYRIGHT_VERSION }}
8888
python-platform: ${{ matrix.python-platform }}

stubs/SQLAlchemy/sqlalchemy/dialects/mssql/pyodbc.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ class MSExecutionContext_pyodbc(MSExecutionContext):
2929
def pre_exec(self) -> None: ...
3030
def post_exec(self) -> None: ...
3131

32-
class MSDialect_pyodbc(PyODBCConnector, MSDialect):
32+
# pyright complains about incompatible definitions of "supports_sane_rowcount_returning" in the base classes,
33+
# hence the type: ignore
34+
class MSDialect_pyodbc(PyODBCConnector, MSDialect): # type: ignore
3335
supports_statement_cache: bool
3436
supports_sane_rowcount_returning: bool
3537
colspecs: Any

stubs/SQLAlchemy/sqlalchemy/dialects/mysql/pyodbc.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ class _pyodbcTIME(TIME):
1010
class MySQLExecutionContext_pyodbc(MySQLExecutionContext):
1111
def get_lastrowid(self): ...
1212

13-
class MySQLDialect_pyodbc(PyODBCConnector, MySQLDialect):
13+
# pyright complains about incompatible definitions of "supports_sane_rowcount_returning" variable in the base classes,
14+
# hence the type: ignore
15+
class MySQLDialect_pyodbc(PyODBCConnector, MySQLDialect): # type: ignore
1416
supports_statement_cache: bool
1517
colspecs: Any
1618
supports_unicode_statements: bool

stubs/SQLAlchemy/sqlalchemy/dialects/postgresql/hstore.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import sqlalchemy.types as sqltypes
44

55
from ...sql import functions as sqlfunc
66

7-
class HSTORE(sqltypes.Indexable, sqltypes.Concatenable, sqltypes.TypeEngine):
7+
# pyright complains that "Comparator" is defined incompatibly in the base classes,
8+
# hence the type: ignore
9+
class HSTORE(sqltypes.Indexable, sqltypes.Concatenable, sqltypes.TypeEngine): # type: ignore
810
__visit_name__: str
911
hashable: bool
1012
text_type: Any

stubs/SQLAlchemy/sqlalchemy/sql/sqltypes.pyi

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# pyright complains that several classes in this file
2+
# have incompatible definitions of the "Comparator" variable in their bases,
3+
# meaning there are several type: ignores
4+
15
from typing import Any
26

37
from .base import SchemaEventTarget
@@ -24,7 +28,7 @@ class Indexable:
2428
def __getitem__(self, index): ...
2529
comparator_factory: Any
2630

27-
class String(Concatenable, TypeEngine):
31+
class String(Concatenable, TypeEngine): # type: ignore
2832
__visit_name__: str
2933
RETURNS_UNICODE: Any
3034
RETURNS_BYTES: Any
@@ -59,7 +63,7 @@ class UnicodeText(Text):
5963
__visit_name__: str
6064
def __init__(self, length: Any | None = ..., **kwargs) -> None: ...
6165

62-
class Integer(_LookupExpressionAdapter, TypeEngine):
66+
class Integer(_LookupExpressionAdapter, TypeEngine): # type: ignore
6367
__visit_name__: str
6468
def get_dbapi_type(self, dbapi): ...
6569
@property
@@ -72,7 +76,7 @@ class SmallInteger(Integer):
7276
class BigInteger(Integer):
7377
__visit_name__: str
7478

75-
class Numeric(_LookupExpressionAdapter, TypeEngine):
79+
class Numeric(_LookupExpressionAdapter, TypeEngine): # type: ignore
7680
__visit_name__: str
7781
precision: Any
7882
scale: Any
@@ -97,21 +101,21 @@ class Float(Numeric):
97101
def __init__(self, precision: Any | None = ..., asdecimal: bool = ..., decimal_return_scale: Any | None = ...) -> None: ...
98102
def result_processor(self, dialect, coltype): ...
99103

100-
class DateTime(_LookupExpressionAdapter, TypeEngine):
104+
class DateTime(_LookupExpressionAdapter, TypeEngine): # type: ignore
101105
__visit_name__: str
102106
timezone: Any
103107
def __init__(self, timezone: bool = ...) -> None: ...
104108
def get_dbapi_type(self, dbapi): ...
105109
@property
106110
def python_type(self): ...
107111

108-
class Date(_LookupExpressionAdapter, TypeEngine):
112+
class Date(_LookupExpressionAdapter, TypeEngine): # type: ignore
109113
__visit_name__: str
110114
def get_dbapi_type(self, dbapi): ...
111115
@property
112116
def python_type(self): ...
113117

114-
class Time(_LookupExpressionAdapter, TypeEngine):
118+
class Time(_LookupExpressionAdapter, TypeEngine): # type: ignore
115119
__visit_name__: str
116120
timezone: Any
117121
def __init__(self, timezone: bool = ...) -> None: ...
@@ -199,7 +203,7 @@ class Boolean(Emulated, TypeEngine, SchemaType): # type: ignore[misc]
199203
def bind_processor(self, dialect): ...
200204
def result_processor(self, dialect, coltype): ...
201205

202-
class _AbstractInterval(_LookupExpressionAdapter, TypeEngine):
206+
class _AbstractInterval(_LookupExpressionAdapter, TypeEngine): # type: ignore
203207
def coerce_compared_value(self, op, value): ...
204208

205209
class Interval(Emulated, _AbstractInterval, TypeDecorator): # type: ignore[misc]
@@ -216,7 +220,7 @@ class Interval(Emulated, _AbstractInterval, TypeDecorator): # type: ignore[misc
216220
def bind_processor(self, dialect): ...
217221
def result_processor(self, dialect, coltype): ...
218222

219-
class JSON(Indexable, TypeEngine):
223+
class JSON(Indexable, TypeEngine): # type: ignore
220224
__visit_name__: str
221225
hashable: bool
222226
NULL: Any
@@ -251,7 +255,7 @@ class JSON(Indexable, TypeEngine):
251255
def bind_processor(self, dialect): ...
252256
def result_processor(self, dialect, coltype): ...
253257

254-
class ARRAY(SchemaEventTarget, Indexable, Concatenable, TypeEngine):
258+
class ARRAY(SchemaEventTarget, Indexable, Concatenable, TypeEngine): # type: ignore
255259
__visit_name__: str
256260
zero_indexes: bool
257261

tests/pyright_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import sys
66
from pathlib import Path
77

8-
_PYRIGHT_VERSION = "1.1.218" # Must match .github/workflows/tests.yml.
8+
_PYRIGHT_VERSION = "1.1.230" # Must match .github/workflows/tests.yml.
99
_WELL_KNOWN_FILE = Path("tests", "pyright_test.py")
1010

1111

0 commit comments

Comments
 (0)