diff --git a/databases/main.py b/databases/main.py index 2d6e82a23..9040bb2e3 100644 --- a/databases/main.py +++ b/databases/main.py @@ -62,7 +62,9 @@ @cli.command() def test( *, - databases: list[str] = SUPPORTED_DATABASES, + databases: list[str] = cast( + 'list[str]', SUPPORTED_DATABASES + ), # pyright: ignore[reportCallInDefaultInitializer] exclude_databases: list[ str ] = [], # pyright: ignore[reportCallInDefaultInitializer] @@ -118,7 +120,9 @@ def serve(database: str, *, version: Optional[str] = None) -> None: @cli.command(name='test-inverse') def test_inverse( *, - databases: list[str] = SUPPORTED_DATABASES, + databases: list[str] = cast( + 'list[str]', SUPPORTED_DATABASES + ), # pyright: ignore[reportCallInDefaultInitializer] coverage: bool = False, inplace: bool = False, pytest_args: Optional[str] = None, @@ -132,12 +136,12 @@ def test_inverse( - Our unit tests & linters fail """ session = session_ctx.get() - databases = validate_databases(databases) + validated_databases = validate_databases(databases) with session.chdir(DATABASES_DIR): _setup_test_env(session, inplace=inplace) - for database in databases: + for database in validated_databases: config = CONFIG_MAPPING[database] print(title(config.name)) @@ -433,7 +437,7 @@ def validate_database(database: str) -> SupportedDatabase: if database not in SUPPORTED_DATABASES: # pragma: no cover raise ValueError(f'Unknown database: {database}') - return cast(SupportedDatabase, database) + return database def tests_reldir(*, for_async: bool) -> str: diff --git a/databases/requirements.txt b/databases/requirements.txt index 546b9cef3..300f5ecbe 100644 --- a/databases/requirements.txt +++ b/databases/requirements.txt @@ -1,5 +1,5 @@ # TODO: merge with other dev requirements -coverage==7.2.5 +coverage==7.2.7 dirty-equals==0.6.0 distro diff --git a/pipelines/requirements/coverage.txt b/pipelines/requirements/coverage.txt index f43474a8e..31897f0e8 100644 --- a/pipelines/requirements/coverage.txt +++ b/pipelines/requirements/coverage.txt @@ -1 +1 @@ -coverage==7.2.5 +coverage==7.2.7 diff --git a/pipelines/requirements/deps/pyright.txt b/pipelines/requirements/deps/pyright.txt index e84b01d3e..9bbcd6a1c 100644 --- a/pipelines/requirements/deps/pyright.txt +++ b/pipelines/requirements/deps/pyright.txt @@ -1 +1 @@ -pyright==1.1.306 +pyright==1.1.317 diff --git a/pipelines/requirements/deps/pytest-asyncio.txt b/pipelines/requirements/deps/pytest-asyncio.txt index 07b65c02b..978d89f87 100644 --- a/pipelines/requirements/deps/pytest-asyncio.txt +++ b/pipelines/requirements/deps/pytest-asyncio.txt @@ -1 +1 @@ -pytest-asyncio==0.21.0 +pytest-asyncio==0.21.1 diff --git a/pipelines/requirements/deps/pytest-mock.txt b/pipelines/requirements/deps/pytest-mock.txt index eafced0c0..5f4a4cce1 100644 --- a/pipelines/requirements/deps/pytest-mock.txt +++ b/pipelines/requirements/deps/pytest-mock.txt @@ -1 +1 @@ -pytest-mock==3.10.0 +pytest-mock==3.11.1 diff --git a/pipelines/requirements/deps/pytest.txt b/pipelines/requirements/deps/pytest.txt index c4d04a08d..70613be0c 100644 --- a/pipelines/requirements/deps/pytest.txt +++ b/pipelines/requirements/deps/pytest.txt @@ -1 +1 @@ -pytest==7.3.1 +pytest==7.4.0 diff --git a/pipelines/requirements/docs.txt b/pipelines/requirements/docs.txt index dacaaa5a1..4bfff4466 100644 --- a/pipelines/requirements/docs.txt +++ b/pipelines/requirements/docs.txt @@ -1,2 +1,2 @@ mkdocs==1.4.3 -mkdocs-material==9.1.9 +mkdocs-material==9.1.19 diff --git a/pipelines/requirements/test.txt b/pipelines/requirements/test.txt index 1c0a47e9c..2182aba07 100644 --- a/pipelines/requirements/test.txt +++ b/pipelines/requirements/test.txt @@ -4,6 +4,6 @@ -r deps/pytest-mock.txt -r deps/syrupy.txt pytest-sugar -mock==5.0.2 -pytest-mock==3.10.0 +mock==5.1.0 +pytest-mock==3.11.1 pytest-subprocess==1.5.0 diff --git a/src/prisma/cli/commands/generate.py b/src/prisma/cli/commands/generate.py index 7bf6c0c4c..39cdb1eef 100644 --- a/src/prisma/cli/commands/generate.py +++ b/src/prisma/cli/commands/generate.py @@ -19,7 +19,8 @@ log: logging.Logger = logging.getLogger(__name__) -@click.command('generate') +# not sure why this type ignore is needed +@click.command('generate') # type: ignore @options.schema @options.watch @click.option( diff --git a/src/prisma/cli/utils.py b/src/prisma/cli/utils.py index e2bcbd5b2..6cdf01490 100644 --- a/src/prisma/cli/utils.py +++ b/src/prisma/cli/utils.py @@ -1,3 +1,6 @@ +from __future__ import annotations + +import os import sys import logging from enum import Enum @@ -71,9 +74,9 @@ class PathlibPath(click.Path): def convert( self, - value: str, - param: Optional[click.Parameter], - ctx: Optional[click.Context], + value: str | os.PathLike[str], + param: click.Parameter | None, + ctx: click.Context | None, ) -> Path: return Path(str(super().convert(value, param, ctx))) diff --git a/typesafety/pyright/types/json_obj.py b/typesafety/pyright/types/json_obj.py index 691956f82..c5c0304db 100644 --- a/typesafety/pyright/types/json_obj.py +++ b/typesafety/pyright/types/json_obj.py @@ -16,12 +16,19 @@ def raw() -> None: Json({'foo': {'bar': {'baz': 1}}}) # case: no other arguments - Json('bar', 'foo') # E: Expected 1 positional argument - Json('foo', item=1) # E: No parameter named "item" + # TODO: these error messages are weird... + Json( + 'bar', # E: Argument of type "Literal['bar']" cannot be assigned to parameter "object" of type "ReadableBuffer" in function "__new__" + 'foo', + ) + Json( # E: No overloads for "__new__" match the provided arguments + 'foo', + item=1, + ) # case: invalid recursive type Json( - { # E: Argument of type "dict[str, dict[str, dict[str, Type[Json]]]]" cannot be assigned to parameter "data" of type "Serializable" in function "__init__" + { # E: Argument of type "dict[str, dict[str, dict[str, type[Json]]]]" cannot be assigned to parameter "data" of type "Serializable" in function "__init__" 'foo': { 'bar': { 'baz': Json, @@ -54,7 +61,7 @@ def keys() -> None: # case: invalid recursive type Json.keys( - item={ # E: Argument of type "dict[str, dict[str, dict[str, Type[Json]]]]" cannot be assigned to parameter "item" of type "Serializable" in function "keys" + item={ # E: Argument of type "dict[str, dict[str, dict[str, type[Json]]]]" cannot be assigned to parameter "item" of type "Serializable" in function "keys" 'foo': { 'bar': { 'baz': Json,