pydantic: fix build failure on Python 3.9

Pydantic tests require additional dependency on old versions of Python
to parse new `x | y` syntax. See build logs:
https://gist.github.com/PerchunPak/74aaed48223155f22e43dcef493d7c7b
This commit is contained in:
PerchunPak 2024-03-27 02:00:21 +01:00
parent bf6c95a420
commit 9ba392312c
No known key found for this signature in database
GPG Key ID: 313F67D1EAB770F9
1 changed files with 12 additions and 8 deletions

View File

@ -23,6 +23,7 @@
, faker
, pytestCheckHook
, pytest-mock
, eval-type-backport
}:
buildPythonPackage rec {
@ -45,7 +46,7 @@ buildPythonPackage rec {
name = "fix-pytest8-compatibility.patch";
url = "https://github.com/pydantic/pydantic/commit/825a6920e177a3b65836c13c7f37d82b810ce482.patch";
hash = "sha256-Dap5DtDzHw0jS/QUo5CRI9sLDJ719GRyC4ZNDWEdzus=";
})
})
];
buildInputs = lib.optionals (pythonOlder "3.9") [
@ -69,13 +70,16 @@ buildPythonPackage rec {
];
};
nativeCheckInputs = [
cloudpickle
dirty-equals
faker
pytest-mock
pytestCheckHook
] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
nativeCheckInputs =
[
cloudpickle
dirty-equals
faker
pytest-mock
pytestCheckHook
]
++ lib.flatten (lib.attrValues passthru.optional-dependencies)
++ lib.optionals (pythonOlder "3.10") [ eval-type-backport ];
preCheck = ''
export HOME=$(mktemp -d)