diff --git a/.github/renovate.json b/.github/renovate.json index 860ccab63..47d7a5b56 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -3,6 +3,10 @@ "extends": [ "config:base" ], + "ignoreDeps": [ + "coverage", + "pytest-mock" + ], "ignorePaths": ["databases/docker-compose.yml", "examples/**"], "pip_requirements": { "fileMatch": ["requirements/.*\\.txt", "deps/.*\\.txt"] diff --git a/databases/requirements.txt b/databases/requirements.txt index 300f5ecbe..83261504a 100644 --- a/databases/requirements.txt +++ b/databases/requirements.txt @@ -1,8 +1,8 @@ # TODO: merge with other dev requirements -coverage==7.2.7 -dirty-equals==0.6.0 +dirty-equals==0.7.1.post0 distro +-r ../pipelines/requirements/deps/coverage.txt -r ../pipelines/requirements/deps/pyright.txt -r ../pipelines/requirements/deps/pytest.txt -r ../pipelines/requirements/deps/pytest-mock.txt diff --git a/pipelines/lint.nox.py b/pipelines/lint.nox.py index cfc73241b..63cf6910b 100644 --- a/pipelines/lint.nox.py +++ b/pipelines/lint.nox.py @@ -2,7 +2,7 @@ import nox -from pipelines.utils import get_pkg_location, setup_env +from pipelines.utils import setup_env from pipelines.utils.prisma import generate @@ -10,17 +10,14 @@ def lint(session: nox.Session) -> None: setup_env(session) session.install('-r', 'pipelines/requirements/lint.txt') - session.install('.') + + # TODO: pyright doesn't resolve types correctly if we don't install inplace + session.install('-e', '.') generate(session) session.run('blue', '--check', '.') - session.run( - 'pyright', - get_pkg_location(session, 'prisma'), - 'tests', - 'databases', - ) + session.run('pyright') session.run('pyright', '--ignoreexternal', '--verifytypes', 'prisma') session.run( 'interrogate', diff --git a/pipelines/requirements/coverage.txt b/pipelines/requirements/coverage.txt index 31897f0e8..ee93e79bc 100644 --- a/pipelines/requirements/coverage.txt +++ b/pipelines/requirements/coverage.txt @@ -1 +1 @@ -coverage==7.2.7 +-r deps/coverage.txt diff --git a/pipelines/requirements/deps/coverage.txt b/pipelines/requirements/deps/coverage.txt new file mode 100644 index 000000000..31897f0e8 --- /dev/null +++ b/pipelines/requirements/deps/coverage.txt @@ -0,0 +1 @@ +coverage==7.2.7 diff --git a/pipelines/requirements/deps/pydantic.txt b/pipelines/requirements/deps/pydantic.txt index 963fb14ba..6743d5f79 100644 --- a/pipelines/requirements/deps/pydantic.txt +++ b/pipelines/requirements/deps/pydantic.txt @@ -1 +1 @@ -pydantic==2.3.0 +pydantic==2.5.2 diff --git a/pipelines/requirements/deps/pyright.txt b/pipelines/requirements/deps/pyright.txt index 9bbcd6a1c..8035a001f 100644 --- a/pipelines/requirements/deps/pyright.txt +++ b/pipelines/requirements/deps/pyright.txt @@ -1 +1 @@ -pyright==1.1.317 +pyright==1.1.338 diff --git a/pipelines/requirements/deps/pytest.txt b/pipelines/requirements/deps/pytest.txt index 70613be0c..f9708e4b7 100644 --- a/pipelines/requirements/deps/pytest.txt +++ b/pipelines/requirements/deps/pytest.txt @@ -1 +1 @@ -pytest==7.4.0 +pytest==7.4.3 diff --git a/pipelines/requirements/dev.txt b/pipelines/requirements/dev.txt index 95658f1ce..dc6e52c03 100644 --- a/pipelines/requirements/dev.txt +++ b/pipelines/requirements/dev.txt @@ -1,7 +1,7 @@ -r deps/syrupy.txt nox==2022.11.21 -wheel==0.40.0 +wheel==0.42.0 blue==0.9.1 pre-commit==2.21.0 twine==4.0.2 diff --git a/pipelines/requirements/docs.txt b/pipelines/requirements/docs.txt index 4bfff4466..ee529342d 100644 --- a/pipelines/requirements/docs.txt +++ b/pipelines/requirements/docs.txt @@ -1,2 +1,2 @@ -mkdocs==1.4.3 -mkdocs-material==9.1.19 +mkdocs==1.5.3 +mkdocs-material==9.4.14 diff --git a/pipelines/requirements/lint.txt b/pipelines/requirements/lint.txt index 2fee28b43..003ac2842 100644 --- a/pipelines/requirements/lint.txt +++ b/pipelines/requirements/lint.txt @@ -6,4 +6,4 @@ -r deps/mypy.txt -r ../../databases/requirements.txt interrogate==1.5.0 -slotscheck==0.16.5 +slotscheck==0.17.1 diff --git a/pipelines/requirements/test.txt b/pipelines/requirements/test.txt index 2182aba07..4fac15d7c 100644 --- a/pipelines/requirements/test.txt +++ b/pipelines/requirements/test.txt @@ -5,5 +5,4 @@ -r deps/syrupy.txt pytest-sugar mock==5.1.0 -pytest-mock==3.11.1 pytest-subprocess==1.5.0 diff --git a/pyproject.toml b/pyproject.toml index 92706df69..6437b57d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,9 @@ include = [ "src", "tests", - "scripts" + "scripts", + "databases", + "pipelines", ] ignore = [ # these are type checked separately diff --git a/src/prisma/_config.py b/src/prisma/_config.py index f456add0c..530568c6d 100644 --- a/src/prisma/_config.py +++ b/src/prisma/_config.py @@ -1,3 +1,5 @@ +# (we don't need to care about this check in this file) +# pyright: reportIncompatibleVariableOverride=false from __future__ import annotations from pathlib import Path diff --git a/src/prisma/cli/_node.py b/src/prisma/cli/_node.py index 3965ab99e..8f41980e1 100644 --- a/src/prisma/cli/_node.py +++ b/src/prisma/cli/_node.py @@ -51,8 +51,6 @@ def __init__(self) -> None: class Strategy(ABC): - resolver: Literal['nodejs-bin', 'global', 'nodeenv'] - # TODO: support more options def run( self, diff --git a/src/prisma/cli/commands/generate.py b/src/prisma/cli/commands/generate.py index a88b27e85..b376e3c6e 100644 --- a/src/prisma/cli/commands/generate.py +++ b/src/prisma/cli/commands/generate.py @@ -49,7 +49,8 @@ def cli( schema: Optional[Path], watch: bool, generator: Tuple[str], **kwargs: Any ) -> None: """Generate prisma artifacts with modified config options""" - if pydantic.VERSION.split('.') < ['1', '8']: + # context https://github.com/microsoft/pyright/issues/6099 + if pydantic.VERSION.split('.') < ['1', '8']: # pyright: ignore warning( 'Unsupported version of pydantic installed, this command may not work as intended\n' 'Please update pydantic to 1.8 or greater.\n' diff --git a/src/prisma/generator/templates/bases.py.jinja b/src/prisma/generator/templates/bases.py.jinja index d1dda7526..207f816d6 100644 --- a/src/prisma/generator/templates/bases.py.jinja +++ b/src/prisma/generator/templates/bases.py.jinja @@ -39,7 +39,7 @@ class _PrismaModel(BaseModel): {% for model in dmmf.datamodel.models %} class Base{{ model.name }}(_PrismaModel): - __prisma_model__: ClassVar[Literal['{{ model.name }}']] = '{{ model.name }}' + __prisma_model__: ClassVar[Literal['{{ model.name }}']] = '{{ model.name }}' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.{{ model.name }}Actions[_PrismaModelT]': diff --git a/src/prisma/generator/templates/client.py.jinja b/src/prisma/generator/templates/client.py.jinja index edca0c132..a59a1fafd 100644 --- a/src/prisma/generator/templates/client.py.jinja +++ b/src/prisma/generator/templates/client.py.jinja @@ -277,9 +277,9 @@ class Prisma: if self.__engine is not None: engine = self.__engine self.__engine = None - if isinstance(timeout, float): + if isinstance(timeout, (int, float)): message = ( - 'Passing a float as `timeout` argument is deprecated ' + 'Passing a number as `timeout` argument is deprecated ' 'and will be removed in the next major release. ' 'Use a `datetime.timedelta` instead.' ) diff --git a/src/prisma_cleanup/_cleanup.py b/src/prisma_cleanup/_cleanup.py index 6b8b1ebf7..bcf6f3686 100644 --- a/src/prisma_cleanup/_cleanup.py +++ b/src/prisma_cleanup/_cleanup.py @@ -29,7 +29,7 @@ def cleanup(pkg_name: str = 'prisma') -> None: # the packages source location. We should provide an easy to understand error # for this case even if it is incredibly unlikey (if not impossible) # to happen in our use case - loader = pkgutil.get_loader(pkg_name) + loader = pkgutil.get_loader(pkg_name) # pyright: ignore[reportDeprecated] if loader is None: raise RuntimeError(f'Could not resolve package: {pkg_name}') diff --git a/tests/test_generation/exhaustive/__snapshots__/test_exhaustive/test_async[bases.py].raw b/tests/test_generation/exhaustive/__snapshots__/test_exhaustive/test_async[bases.py].raw index f529b59da..cad6cbe8d 100644 --- a/tests/test_generation/exhaustive/__snapshots__/test_exhaustive/test_async[bases.py].raw +++ b/tests/test_generation/exhaustive/__snapshots__/test_exhaustive/test_async[bases.py].raw @@ -76,7 +76,7 @@ class _PrismaModel(BaseModel): class BasePost(_PrismaModel): - __prisma_model__: ClassVar[Literal['Post']] = 'Post' + __prisma_model__: ClassVar[Literal['Post']] = 'Post' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.PostActions[_PrismaModelT]': @@ -86,7 +86,7 @@ class BasePost(_PrismaModel): class BaseUser(_PrismaModel): - __prisma_model__: ClassVar[Literal['User']] = 'User' + __prisma_model__: ClassVar[Literal['User']] = 'User' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.UserActions[_PrismaModelT]': @@ -96,7 +96,7 @@ class BaseUser(_PrismaModel): class BaseM(_PrismaModel): - __prisma_model__: ClassVar[Literal['M']] = 'M' + __prisma_model__: ClassVar[Literal['M']] = 'M' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.MActions[_PrismaModelT]': @@ -106,7 +106,7 @@ class BaseM(_PrismaModel): class BaseN(_PrismaModel): - __prisma_model__: ClassVar[Literal['N']] = 'N' + __prisma_model__: ClassVar[Literal['N']] = 'N' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.NActions[_PrismaModelT]': @@ -116,7 +116,7 @@ class BaseN(_PrismaModel): class BaseOneOptional(_PrismaModel): - __prisma_model__: ClassVar[Literal['OneOptional']] = 'OneOptional' + __prisma_model__: ClassVar[Literal['OneOptional']] = 'OneOptional' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.OneOptionalActions[_PrismaModelT]': @@ -126,7 +126,7 @@ class BaseOneOptional(_PrismaModel): class BaseManyRequired(_PrismaModel): - __prisma_model__: ClassVar[Literal['ManyRequired']] = 'ManyRequired' + __prisma_model__: ClassVar[Literal['ManyRequired']] = 'ManyRequired' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.ManyRequiredActions[_PrismaModelT]': @@ -136,7 +136,7 @@ class BaseManyRequired(_PrismaModel): class BaseLists(_PrismaModel): - __prisma_model__: ClassVar[Literal['Lists']] = 'Lists' + __prisma_model__: ClassVar[Literal['Lists']] = 'Lists' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.ListsActions[_PrismaModelT]': @@ -146,7 +146,7 @@ class BaseLists(_PrismaModel): class BaseA(_PrismaModel): - __prisma_model__: ClassVar[Literal['A']] = 'A' + __prisma_model__: ClassVar[Literal['A']] = 'A' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.AActions[_PrismaModelT]': @@ -156,7 +156,7 @@ class BaseA(_PrismaModel): class BaseB(_PrismaModel): - __prisma_model__: ClassVar[Literal['B']] = 'B' + __prisma_model__: ClassVar[Literal['B']] = 'B' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.BActions[_PrismaModelT]': @@ -166,7 +166,7 @@ class BaseB(_PrismaModel): class BaseC(_PrismaModel): - __prisma_model__: ClassVar[Literal['C']] = 'C' + __prisma_model__: ClassVar[Literal['C']] = 'C' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.CActions[_PrismaModelT]': @@ -176,7 +176,7 @@ class BaseC(_PrismaModel): class BaseD(_PrismaModel): - __prisma_model__: ClassVar[Literal['D']] = 'D' + __prisma_model__: ClassVar[Literal['D']] = 'D' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.DActions[_PrismaModelT]': @@ -186,7 +186,7 @@ class BaseD(_PrismaModel): class BaseE(_PrismaModel): - __prisma_model__: ClassVar[Literal['E']] = 'E' + __prisma_model__: ClassVar[Literal['E']] = 'E' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.EActions[_PrismaModelT]': diff --git a/tests/test_generation/exhaustive/__snapshots__/test_exhaustive/test_async[client.py].raw b/tests/test_generation/exhaustive/__snapshots__/test_exhaustive/test_async[client.py].raw index 951e4ee72..118e039b8 100644 --- a/tests/test_generation/exhaustive/__snapshots__/test_exhaustive/test_async[client.py].raw +++ b/tests/test_generation/exhaustive/__snapshots__/test_exhaustive/test_async[client.py].raw @@ -321,9 +321,9 @@ class Prisma: if self.__engine is not None: engine = self.__engine self.__engine = None - if isinstance(timeout, float): + if isinstance(timeout, (int, float)): message = ( - 'Passing a float as `timeout` argument is deprecated ' + 'Passing a number as `timeout` argument is deprecated ' 'and will be removed in the next major release. ' 'Use a `datetime.timedelta` instead.' ) diff --git a/tests/test_generation/exhaustive/__snapshots__/test_exhaustive/test_sync[bases.py].raw b/tests/test_generation/exhaustive/__snapshots__/test_exhaustive/test_sync[bases.py].raw index f529b59da..cad6cbe8d 100644 --- a/tests/test_generation/exhaustive/__snapshots__/test_exhaustive/test_sync[bases.py].raw +++ b/tests/test_generation/exhaustive/__snapshots__/test_exhaustive/test_sync[bases.py].raw @@ -76,7 +76,7 @@ class _PrismaModel(BaseModel): class BasePost(_PrismaModel): - __prisma_model__: ClassVar[Literal['Post']] = 'Post' + __prisma_model__: ClassVar[Literal['Post']] = 'Post' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.PostActions[_PrismaModelT]': @@ -86,7 +86,7 @@ class BasePost(_PrismaModel): class BaseUser(_PrismaModel): - __prisma_model__: ClassVar[Literal['User']] = 'User' + __prisma_model__: ClassVar[Literal['User']] = 'User' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.UserActions[_PrismaModelT]': @@ -96,7 +96,7 @@ class BaseUser(_PrismaModel): class BaseM(_PrismaModel): - __prisma_model__: ClassVar[Literal['M']] = 'M' + __prisma_model__: ClassVar[Literal['M']] = 'M' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.MActions[_PrismaModelT]': @@ -106,7 +106,7 @@ class BaseM(_PrismaModel): class BaseN(_PrismaModel): - __prisma_model__: ClassVar[Literal['N']] = 'N' + __prisma_model__: ClassVar[Literal['N']] = 'N' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.NActions[_PrismaModelT]': @@ -116,7 +116,7 @@ class BaseN(_PrismaModel): class BaseOneOptional(_PrismaModel): - __prisma_model__: ClassVar[Literal['OneOptional']] = 'OneOptional' + __prisma_model__: ClassVar[Literal['OneOptional']] = 'OneOptional' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.OneOptionalActions[_PrismaModelT]': @@ -126,7 +126,7 @@ class BaseOneOptional(_PrismaModel): class BaseManyRequired(_PrismaModel): - __prisma_model__: ClassVar[Literal['ManyRequired']] = 'ManyRequired' + __prisma_model__: ClassVar[Literal['ManyRequired']] = 'ManyRequired' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.ManyRequiredActions[_PrismaModelT]': @@ -136,7 +136,7 @@ class BaseManyRequired(_PrismaModel): class BaseLists(_PrismaModel): - __prisma_model__: ClassVar[Literal['Lists']] = 'Lists' + __prisma_model__: ClassVar[Literal['Lists']] = 'Lists' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.ListsActions[_PrismaModelT]': @@ -146,7 +146,7 @@ class BaseLists(_PrismaModel): class BaseA(_PrismaModel): - __prisma_model__: ClassVar[Literal['A']] = 'A' + __prisma_model__: ClassVar[Literal['A']] = 'A' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.AActions[_PrismaModelT]': @@ -156,7 +156,7 @@ class BaseA(_PrismaModel): class BaseB(_PrismaModel): - __prisma_model__: ClassVar[Literal['B']] = 'B' + __prisma_model__: ClassVar[Literal['B']] = 'B' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.BActions[_PrismaModelT]': @@ -166,7 +166,7 @@ class BaseB(_PrismaModel): class BaseC(_PrismaModel): - __prisma_model__: ClassVar[Literal['C']] = 'C' + __prisma_model__: ClassVar[Literal['C']] = 'C' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.CActions[_PrismaModelT]': @@ -176,7 +176,7 @@ class BaseC(_PrismaModel): class BaseD(_PrismaModel): - __prisma_model__: ClassVar[Literal['D']] = 'D' + __prisma_model__: ClassVar[Literal['D']] = 'D' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.DActions[_PrismaModelT]': @@ -186,7 +186,7 @@ class BaseD(_PrismaModel): class BaseE(_PrismaModel): - __prisma_model__: ClassVar[Literal['E']] = 'E' + __prisma_model__: ClassVar[Literal['E']] = 'E' # pyright: ignore[reportIncompatibleVariableOverride] @classmethod def prisma(cls: Type[_PrismaModelT], client: Optional['Prisma'] = None) -> 'actions.EActions[_PrismaModelT]': diff --git a/tests/test_generation/exhaustive/__snapshots__/test_exhaustive/test_sync[client.py].raw b/tests/test_generation/exhaustive/__snapshots__/test_exhaustive/test_sync[client.py].raw index b5dd1182c..eef93c0c4 100644 --- a/tests/test_generation/exhaustive/__snapshots__/test_exhaustive/test_sync[client.py].raw +++ b/tests/test_generation/exhaustive/__snapshots__/test_exhaustive/test_sync[client.py].raw @@ -321,9 +321,9 @@ class Prisma: if self.__engine is not None: engine = self.__engine self.__engine = None - if isinstance(timeout, float): + if isinstance(timeout, (int, float)): message = ( - 'Passing a float as `timeout` argument is deprecated ' + 'Passing a number as `timeout` argument is deprecated ' 'and will be removed in the next major release. ' 'Use a `datetime.timedelta` instead.' ) diff --git a/tests/test_generation/test_partial_types.py b/tests/test_generation/test_partial_types.py index 7a2bdd6e2..e57e5326d 100644 --- a/tests/test_generation/test_partial_types.py +++ b/tests/test_generation/test_partial_types.py @@ -316,9 +316,13 @@ def generator() -> None: # mark: filedef User.create_partial('UserOnlyName', include={'name'}) - Post.create_partial('PostWithoutDesc', exclude=['desc']) + Post.create_partial( + 'PostWithoutDesc', exclude=['desc'] # pyright: ignore + ) # pyright: ignore Post.create_partial('PostOptionalPublished', optional=['published']) - Post.create_partial('PostRequiredDesc', required=['desc']) + Post.create_partial( + 'PostRequiredDesc', required=['desc'] # pyright: ignore + ) # pyright: ignore Post.create_partial('PostOnlyId', include={'id'}) Post.create_partial( 'PostOptionalInclude', include={'title'}, optional={'title'} @@ -339,7 +343,9 @@ def generator() -> None: # mark: filedef exclude={'bytes', 'bytes_list'}, # type: ignore relations={'posts': 'PostOnlyId'}, ) - User.create_partial('UserBytesList', include={'bytes', 'bytes_list'}) # type: ignore + User.create_partial( + 'UserBytesList', include={'bytes', 'bytes_list'} # type: ignore + ) # pyright: ignore testdir.make_from_function(generator, name=location) testdir.generate(SCHEMA, options) @@ -381,9 +387,9 @@ def generator() -> None: # mark: filedef Post.create_partial( 'PostPartial', - required={'desc', 'published', 'title'}, + required={'desc', 'published', 'title'}, # pyright: ignore optional={ - 'desc', + 'desc', # pyright: ignore 'published', }, ) @@ -406,9 +412,9 @@ def generator() -> None: # mark: filedef Post.create_partial( 'PostPartial', - exclude={'desc'}, + exclude={'desc'}, # pyright: ignore required={ - 'desc', + 'desc', # pyright: ignore }, ) @@ -472,7 +478,7 @@ def generator() -> None: # mark: filedef for _ in range(2): Post.create_partial( 'PostPartial', - exclude={'desc'}, + exclude={'desc'}, # pyright: ignore ) testdir.make_from_function(generator, name='prisma/partial_types.py') diff --git a/typesafety/pyright/count.py b/typesafety/pyright/count.py index e1617bf40..531c535f9 100644 --- a/typesafety/pyright/count.py +++ b/typesafety/pyright/count.py @@ -31,14 +31,14 @@ async def select(client: Prisma) -> None: reveal_type(count) # T: PostCountAggregateOutput # case: invalid field - await client.post.count( + await client.post.count( # E: No overloads for "count" match the provided arguments select={ 'foo': True, # E: Argument of type "dict[str, bool]" cannot be assigned to parameter "select" of type "PostCountAggregateInput" in function "count" }, ) # case: invalid type - await client.post.count( + await client.post.count( # E: No overloads for "count" match the provided arguments select={ 'author_id': 1, # E: Argument of type "dict[str, int]" cannot be assigned to parameter "select" of type "PostCountAggregateInput" in function "count" },