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 #749

Merged
merged 5 commits into from
Jul 21, 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
14 changes: 9 additions & 5 deletions databases/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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,
Expand All @@ -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))

Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion databases/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# TODO: merge with other dev requirements
coverage==7.2.5
coverage==7.2.7
dirty-equals==0.6.0
distro

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.5
coverage==7.2.7
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.306
pyright==1.1.317
2 changes: 1 addition & 1 deletion pipelines/requirements/deps/pytest-asyncio.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pytest-asyncio==0.21.0
pytest-asyncio==0.21.1
2 changes: 1 addition & 1 deletion pipelines/requirements/deps/pytest-mock.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pytest-mock==3.10.0
pytest-mock==3.11.1
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.3.1
pytest==7.4.0
2 changes: 1 addition & 1 deletion 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.9
mkdocs-material==9.1.19
4 changes: 2 additions & 2 deletions pipelines/requirements/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion src/prisma/cli/commands/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
9 changes: 6 additions & 3 deletions src/prisma/cli/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from __future__ import annotations

import os
import sys
import logging
from enum import Enum
Expand Down Expand Up @@ -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)))

Expand Down
15 changes: 11 additions & 4 deletions typesafety/pyright/types/json_obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down