Skip to content

Commit 2e7717e

Browse files
committed
adjustments, allow failure for now
1 parent 3e28022 commit 2e7717e

File tree

6 files changed

+27
-6
lines changed

6 files changed

+27
-6
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ jobs:
7474

7575
runs-on: ubuntu-latest
7676

77+
# TODO: get test suite stable with free-threaded python
78+
continue-on-error: ${{ endsWith(matrix.python-version, 't') }}
79+
7780
steps:
7881
- uses: actions/checkout@v4
7982

@@ -97,15 +100,14 @@ jobs:
97100
env:
98101
RUST_BACKTRACE: 1
99102

100-
- if: endsWith(matrix.python-version, 't')
101-
run: uv pip install pytest-run-parallel
102-
103103
- run: uv pip freeze
104104

105105
- run: uv run pytest
106106
env:
107107
HYPOTHESIS_PROFILE: slow
108108
PYTEST_ADDOPTS: ${{ endsWith(matrix.python-version, 't') && '--parallel-threads=2' || '' }}
109+
# TODO: add `gil_used = false` to the PyO3 `#[pymodule]` when test suite is ok
110+
PYTHON_GIL: ${{ endsWith(matrix.python-version, 't') && '0' || '1' }}
109111

110112
test-os:
111113
name: test on ${{ matrix.os }}

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ testing = [
5252
'pytest-speed',
5353
'pytest-mock',
5454
'pytest-pretty',
55+
'pytest-run-parallel',
5556
'pytest-timeout',
5657
'python-dateutil',
5758
# numpy doesn't offer prebuilt wheels for all versions and platforms we test in CI e.g. aarch64 musllinux
@@ -108,8 +109,8 @@ filterwarnings = [
108109
# cases, by not making this an error we can test for this behaviour
109110
'ignore:(.+)Implicit conversion to integers using __int__ is deprecated',
110111
# free-threading seems to upset Hypothesis
111-
'ignore:The recursion limit will not be reset, since it was changed from another thread or during execution of a test.',
112-
'ignore:Do not use the `random` module inside strategies; instead consider `st.randoms()`, `st.sampled_from()`, etc. from data=datetimes()',
112+
'ignore:(.*)The recursion limit will not be reset, since it was changed from another thread or during execution of a test.(.*)',
113+
'ignore:(.*)Do not use the `random` module inside strategies(.*)',
113114
]
114115
timeout = 30
115116
xfail_strict = true

src/argument_markers.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ use pyo3::types::{PyDict, PyTuple};
55

66
use crate::tools::safe_repr;
77

8+
// see https://github.com/PyO3/pyo3/issues/4894 - freelist is currently unsound with GIL disabled
89
#[cfg_attr(
910
not(Py_GIL_DISABLED),
1011
pyclass(module = "pydantic_core._pydantic_core", get_all, frozen, freelist = 100)

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ pub fn build_info() -> String {
106106
)
107107
}
108108

109-
#[pymodule(gil_used = false)]
109+
#[pymodule]
110110
fn _pydantic_core(py: Python, m: &Bound<'_, PyModule>) -> PyResult<()> {
111111
m.add("__version__", get_pydantic_core_version())?;
112112
m.add("build_profile", env!("PROFILE"))?;

tests/validators/test_set.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def test_frozenset_no_validators_both(py_and_json: PyAndJson, input_value, expec
7373
('abc', Err('Input should be a valid set')),
7474
],
7575
)
76+
@pytest.mark.thread_unsafe # generators in parameters not compatible with pytest-run-parallel, https://github.com/Quansight-Labs/pytest-run-parallel/issues/14
7677
def test_set_ints_python(input_value, expected):
7778
v = SchemaValidator({'type': 'set', 'items_schema': {'type': 'int'}})
7879
if isinstance(expected, Err):

uv.lock

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)