Skip to content

Bump the python-packages group with 7 updates #1213

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

Merged
merged 2 commits into from
Mar 4, 2024
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: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@ build-wasm:

.PHONY: format
format:
ruff --fix $(sources)
ruff check --fix $(sources)
ruff format $(sources)
cargo fmt

.PHONY: lint-python
lint-python:
ruff $(sources)
ruff check $(sources)
ruff format --check $(sources)
$(mypy-stubtest)
griffe dump -f -d google -LWARNING -o/dev/null python/pydantic_core
Expand Down
1 change: 1 addition & 0 deletions generate_self_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

The schema is generated from `python/pydantic_core/core_schema.py`.
"""

from __future__ import annotations as _annotations

import decimal
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ features = ["pyo3/extension-module"]

[tool.ruff]
line-length = 120

[tool.ruff.lint]
extend-select = ['Q', 'RUF100', 'C90', 'I']
extend-ignore = [
'E721', # using type() instead of isinstance() - we use this in tests
Expand Down
39 changes: 13 additions & 26 deletions python/pydantic_core/core_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,51 +117,39 @@ class CoreConfig(TypedDict, total=False):

class SerializationInfo(Protocol):
@property
def include(self) -> IncExCall:
...
def include(self) -> IncExCall: ...

@property
def exclude(self) -> IncExCall:
...
def exclude(self) -> IncExCall: ...

@property
def mode(self) -> str:
...
def mode(self) -> str: ...

@property
def by_alias(self) -> bool:
...
def by_alias(self) -> bool: ...

@property
def exclude_unset(self) -> bool:
...
def exclude_unset(self) -> bool: ...

@property
def exclude_defaults(self) -> bool:
...
def exclude_defaults(self) -> bool: ...

@property
def exclude_none(self) -> bool:
...
def exclude_none(self) -> bool: ...

@property
def round_trip(self) -> bool:
...
def round_trip(self) -> bool: ...

def mode_is_json(self) -> bool:
...
def mode_is_json(self) -> bool: ...

def __str__(self) -> str:
...
def __str__(self) -> str: ...

def __repr__(self) -> str:
...
def __repr__(self) -> str: ...


class FieldSerializationInfo(SerializationInfo, Protocol):
@property
def field_name(self) -> str:
...
def field_name(self) -> str: ...


class ValidationInfo(Protocol):
Expand Down Expand Up @@ -305,8 +293,7 @@ def plain_serializer_function_ser_schema(


class SerializerFunctionWrapHandler(Protocol): # pragma: no cover
def __call__(self, __input_value: Any, __index_key: int | str | None = None) -> Any:
...
def __call__(self, __input_value: Any, __index_key: int | str | None = None) -> Any: ...


# (__input_value: Any, __serializer: SerializerFunctionWrapHandler) -> Any
Expand Down
1 change: 1 addition & 0 deletions tests/benchmarks/test_complete_benchmark.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
General benchmarks that attempt to cover all field types, through by no means all uses of all field types.
"""

import json
from datetime import date, datetime, time
from decimal import Decimal
Expand Down
1 change: 1 addition & 0 deletions tests/benchmarks/test_micro_benchmarks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Numerous benchmarks of specific functionality.
"""

import decimal
import json
import platform
Expand Down
6 changes: 3 additions & 3 deletions tests/requirements-linting.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
griffe==0.40.0
pyright==1.1.349
ruff==0.1.15
griffe==0.41.0
pyright==1.1.352
ruff==0.3.0
mypy==1.8.0
8 changes: 4 additions & 4 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
coverage==7.4.1
coverage==7.4.3
dirty-equals==0.7.1.post0
hypothesis==6.97.4
hypothesis==6.98.15
# TODO: remove manual override for dateutil once a version newer than 2.8.2 is
# released which removes use of deprecated utcfromtimestamp
git+https://github.com/dateutil/dateutil.git@f2293200747fb03d56c6c5997bfebeabe703576f
# pandas doesn't offer prebuilt wheels for all versions and platforms we test in CI e.g. aarch64 musllinux
pandas==2.1.3; python_version >= "3.9" and python_version < "3.13" and implementation_name == "cpython" and platform_machine == 'x86_64'
pytest==8.0.0
pytest==8.0.2
# we run codspeed benchmarks on x86_64 CPython (i.e. native github actions architecture)
pytest-codspeed~=2.2.0; implementation_name == "cpython" and platform_machine == 'x86_64'
# pytest-examples currently depends on aiohttp via black; we don't want to build
Expand All @@ -16,7 +16,7 @@ pytest-speed==0.3.5
pytest-mock==3.11.1
pytest-pretty==1.2.0
pytest-timeout==2.2.0
pytz==2023.4
pytz==2024.1
# numpy doesn't offer prebuilt wheels for all versions and platforms we test in CI e.g. aarch64 musllinux
numpy==1.26.2; python_version >= "3.9" and python_version < "3.13" and implementation_name == "cpython" and platform_machine == 'x86_64'
exceptiongroup==1.1; python_version < "3.11"
12 changes: 4 additions & 8 deletions tests/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,16 @@ class Foo:
bar: str


def foo(bar: str) -> None:
...
def foo(bar: str) -> None: ...


def validator_deprecated(value: Any, info: core_schema.FieldValidationInfo) -> None:
...
def validator_deprecated(value: Any, info: core_schema.FieldValidationInfo) -> None: ...


def validator(value: Any, info: core_schema.ValidationInfo) -> None:
...
def validator(value: Any, info: core_schema.ValidationInfo) -> None: ...


def wrap_validator(value: Any, call_next: Callable[[Any], Any], info: core_schema.ValidationInfo) -> None:
...
def wrap_validator(value: Any, call_next: Callable[[Any], Any], info: core_schema.ValidationInfo) -> None: ...


def test_schema_typing() -> None:
Expand Down