Skip to content
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
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ jobs:
- '3.14t'
- 'pypy3.10'
- 'pypy3.11'
- 'graalpy-3.11'

runs-on: ubuntu-latest

Expand Down Expand Up @@ -424,6 +425,10 @@ jobs:
manylinux: auto
target: x86_64
interpreter: pypy3.10 pypy3.11
- os: linux
manylinux: auto
target: x86_64
interpreter: graalpy3.11

# musllinux
- os: linux
Expand Down Expand Up @@ -485,6 +490,7 @@ jobs:
args: --release --out dist --interpreter ${{ matrix.interpreter || '3.9 3.10 3.11 3.12 3.13 3.14 pypy3.10 pypy3.11' }}
rust-toolchain: stable
docker-options: -e CI
before-script-linux: ${{ contains(matrix.interpreter, 'graalpy') && 'manylinux-interpreters ensure-all' || '' }}

- run: ${{ (matrix.os == 'windows' && 'dir') || 'ls -lh' }} dist/

Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ classifiers = [
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: 3.14',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Programming Language :: Python :: Implementation :: GraalPy',
'Programming Language :: Rust',
'Framework :: Pydantic',
'Intended Audience :: Developers',
Expand Down
4 changes: 2 additions & 2 deletions tests/serializers/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,8 +661,8 @@ def f(value, handler, _info):


@pytest.mark.skipif(
platform.python_implementation() == 'PyPy' or sys.platform in {'emscripten', 'win32'},
reason='fails on pypy, emscripten and windows',
platform.python_implementation() in ('PyPy', 'GraalVM') or sys.platform in {'emscripten', 'win32'},
reason='fails on pypy, graalpy, emscripten and windows',
)
def test_recursive_call():
def bad_recursive(value):
Expand Down
3 changes: 1 addition & 2 deletions tests/test_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1155,9 +1155,8 @@ def test_errors_include_url_envvar(env_var, env_var_value, expected_to_have_url)
env.pop('PYDANTIC_ERRORS_OMIT_URL', None) # in case the ambient environment has it set
if env_var_value is not None:
env[env_var] = env_var_value
env['PYTHONDEVMODE'] = '1' # required to surface the deprecation warning
result = subprocess.run(
[sys.executable, '-c', code],
[sys.executable, '-W', 'default', '-c', code],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
encoding='utf-8',
Expand Down
3 changes: 3 additions & 0 deletions tests/test_garbage_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
@pytest.mark.xfail(
condition=platform.python_implementation() == 'PyPy', reason='https://foss.heptapod.net/pypy/pypy/-/issues/3899'
)
@pytest.mark.skipif(platform.python_implementation() == 'GraalVM', reason='Cannot reliably trigger GC on GraalPy')
def test_gc_schema_serializer() -> None:
# test for https://github.com/pydantic/pydantic/issues/5136
class BaseModel:
Expand Down Expand Up @@ -53,6 +54,7 @@ class MyModel(BaseModel):
@pytest.mark.xfail(
condition=platform.python_implementation() == 'PyPy', reason='https://foss.heptapod.net/pypy/pypy/-/issues/3899'
)
@pytest.mark.skipif(platform.python_implementation() == 'GraalVM', reason='Cannot reliably trigger GC on GraalPy')
def test_gc_schema_validator() -> None:
# test for https://github.com/pydantic/pydantic/issues/5136
class BaseModel:
Expand Down Expand Up @@ -81,6 +83,7 @@ class MyModel(BaseModel):
@pytest.mark.xfail(
condition=platform.python_implementation() == 'PyPy', reason='https://foss.heptapod.net/pypy/pypy/-/issues/3899'
)
@pytest.mark.skipif(platform.python_implementation() == 'GraalVM', reason='Cannot reliably trigger GC on GraalPy')
def test_gc_validator_iterator() -> None:
# test for https://github.com/pydantic/pydantic/issues/9243
class MyModel:
Expand Down
1 change: 1 addition & 0 deletions tests/validators/test_dataclasses.py
Original file line number Diff line number Diff line change
Expand Up @@ -1519,6 +1519,7 @@ def test_dataclass_wrap_json():
@pytest.mark.xfail(
condition=platform.python_implementation() == 'PyPy', reason='https://foss.heptapod.net/pypy/pypy/-/issues/3899'
)
@pytest.mark.skipif(platform.python_implementation() == 'GraalVM', reason='Cannot reliably trigger GC on GraalPy')
@pytest.mark.parametrize('validator', [None, 'field', 'dataclass'])
def test_leak_dataclass(validator):
def fn():
Expand Down
4 changes: 2 additions & 2 deletions tests/validators/test_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def tzname(self, _dt):
schema.validate_python(dt)

# exception messages differ between python and pypy
if platform.python_implementation() == 'PyPy':
if platform.python_implementation() in ('PyPy', 'GraalVM'):
error_message = 'NotImplementedError: tzinfo subclass must override utcoffset()'
else:
error_message = 'NotImplementedError: a tzinfo subclass must implement utcoffset()'
Expand Down Expand Up @@ -489,7 +489,7 @@ def test_neg_7200():


def test_tz_constraint_too_high():
with pytest.raises(SchemaError, match='OverflowError: Python int too large to convert to C long'):
with pytest.raises(SchemaError, match='OverflowError: Python int too large.*'):
SchemaValidator(core_schema.datetime_schema(tz_constraint=2**64))


Expand Down
1 change: 1 addition & 0 deletions tests/validators/test_model_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ def __init__(self, **kwargs):
@pytest.mark.xfail(
condition=platform.python_implementation() == 'PyPy', reason='https://foss.heptapod.net/pypy/pypy/-/issues/3899'
)
@pytest.mark.skipif(platform.python_implementation() == 'GraalVM', reason='Cannot reliably trigger GC on GraalPy')
@pytest.mark.parametrize('validator', [None, 'field', 'model'])
def test_leak_model(validator):
def fn():
Expand Down
1 change: 1 addition & 0 deletions tests/validators/test_nullable.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def test_union_nullable_bool_int():
@pytest.mark.xfail(
condition=platform.python_implementation() == 'PyPy', reason='https://foss.heptapod.net/pypy/pypy/-/issues/3899'
)
@pytest.mark.skipif(platform.python_implementation() == 'GraalVM', reason='Cannot reliably trigger GC on GraalPy')
def test_leak_nullable():
def fn():
def validate(v, info):
Expand Down
2 changes: 1 addition & 1 deletion tests/validators/test_time.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,5 +293,5 @@ def test_neg_7200():


def test_tz_constraint_too_high():
with pytest.raises(SchemaError, match='OverflowError: Python int too large to convert to C long'):
with pytest.raises(SchemaError, match='OverflowError: Python int too large.*'):
SchemaValidator(core_schema.time_schema(tz_constraint=2**64))
1 change: 1 addition & 0 deletions tests/validators/test_typed_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,7 @@ def test_extra_behavior_ignore(config: Union[core_schema.CoreConfig, None], sche
@pytest.mark.xfail(
condition=platform.python_implementation() == 'PyPy', reason='https://foss.heptapod.net/pypy/pypy/-/issues/3899'
)
@pytest.mark.skipif(platform.python_implementation() == 'GraalVM', reason='Cannot reliably trigger GC on GraalPy')
def test_leak_typed_dict():
def fn():
def validate(v, info):
Expand Down
1 change: 1 addition & 0 deletions tests/validators/test_with_default.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@ def val_func(v: Any, handler: core_schema.ValidatorFunctionWrapHandler) -> Any:
@pytest.mark.xfail(
condition=platform.python_implementation() == 'PyPy', reason='https://foss.heptapod.net/pypy/pypy/-/issues/3899'
)
@pytest.mark.skipif(platform.python_implementation() == 'GraalVM', reason='Cannot reliably trigger GC on GraalPy')
def test_leak_with_default():
def fn():
class Defaulted(int):
Expand Down
Loading