Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dev #793

Merged
merged 9 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
"extends": [
"config:base"
],
"ignoreDeps": [
"coverage",
"pytest-mock"
],
"ignorePaths": ["databases/docker-compose.yml", "examples/**"],
"pip_requirements": {
"fileMatch": ["requirements/.*\\.txt", "deps/.*\\.txt"]
Expand Down
4 changes: 2 additions & 2 deletions databases/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 5 additions & 8 deletions pipelines/lint.nox.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,22 @@

import nox

from pipelines.utils import get_pkg_location, setup_env
from pipelines.utils import setup_env
from pipelines.utils.prisma import generate


@nox.session
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',
Expand Down
2 changes: 1 addition & 1 deletion pipelines/requirements/coverage.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
coverage==7.2.7
-r deps/coverage.txt
1 change: 1 addition & 0 deletions pipelines/requirements/deps/coverage.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
coverage==7.2.7
2 changes: 1 addition & 1 deletion pipelines/requirements/deps/pydantic.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pydantic==2.3.0
pydantic==2.5.2
2 changes: 1 addition & 1 deletion pipelines/requirements/deps/pyright.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pyright==1.1.317
pyright==1.1.338
2 changes: 1 addition & 1 deletion pipelines/requirements/deps/pytest.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pytest==7.4.0
pytest==7.4.3
2 changes: 1 addition & 1 deletion pipelines/requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions pipelines/requirements/docs.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
mkdocs==1.4.3
mkdocs-material==9.1.19
mkdocs==1.5.3
mkdocs-material==9.4.14
2 changes: 1 addition & 1 deletion pipelines/requirements/lint.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
-r deps/mypy.txt
-r ../../databases/requirements.txt
interrogate==1.5.0
slotscheck==0.16.5
slotscheck==0.17.1
1 change: 0 additions & 1 deletion pipelines/requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
-r deps/syrupy.txt
pytest-sugar
mock==5.1.0
pytest-mock==3.11.1
pytest-subprocess==1.5.0
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
include = [
"src",
"tests",
"scripts"
"scripts",
"databases",
"pipelines",
]
ignore = [
# these are type checked separately
Expand Down
2 changes: 2 additions & 0 deletions src/prisma/_config.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/prisma/cli/_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ def __init__(self) -> None:


class Strategy(ABC):
resolver: Literal['nodejs-bin', 'global', 'nodeenv']

# TODO: support more options
def run(
self,
Expand Down
3 changes: 2 additions & 1 deletion src/prisma/cli/commands/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion src/prisma/generator/templates/bases.py.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -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]':
Expand Down
4 changes: 2 additions & 2 deletions src/prisma/generator/templates/client.py.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
)
Expand Down
2 changes: 1 addition & 1 deletion src/prisma_cleanup/_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]':
Expand All @@ -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]':
Expand All @@ -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]':
Expand All @@ -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]':
Expand All @@ -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]':
Expand All @@ -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]':
Expand All @@ -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]':
Expand All @@ -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]':
Expand All @@ -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]':
Expand All @@ -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]':
Expand All @@ -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]':
Expand All @@ -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]':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]':
Expand All @@ -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]':
Expand All @@ -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]':
Expand All @@ -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]':
Expand All @@ -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]':
Expand All @@ -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]':
Expand All @@ -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]':
Expand All @@ -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]':
Expand All @@ -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]':
Expand All @@ -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]':
Expand All @@ -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]':
Expand All @@ -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]':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
)
Expand Down
Loading