1{ lib
2, buildPythonPackage
3, fetchPypi
4, pythonOlder
5, pydantic
6, pytestCheckHook
7}:
8
9buildPythonPackage rec {
10 pname = "openapi-schema-pydantic";
11 version = "1.2.4";
12 format = "setuptools";
13
14 disabled = pythonOlder "3.6";
15
16 src = fetchPypi {
17 inherit pname version;
18 hash = "sha256-PiLPWLdKafdSzH5fFTf25EFkKC2ycAy7zTu5nd0GUZY=";
19 };
20
21 propagatedBuildInputs = [
22 pydantic
23 ];
24
25 nativeCheckInputs = [
26 pytestCheckHook
27 ];
28
29 disabledTests = [
30 # these tests are broken with `pydantic >= 1.10`
31 # but this library seems to work fine.
32 # e.g. https://github.com/hwchase17/langchain/blob/d86ed15d8884d5a3f120a433b9dda065647e4534/poetry.lock#L6011-L6012
33 "test_pydantic_discriminator_schema_generation"
34 "test_pydantic_discriminator_openapi_generation"
35 ];
36
37 meta = with lib; {
38 description = "OpenAPI (v3) specification schema as pydantic class";
39 homepage = "https://github.com/kuimono/openapi-schema-pydantic";
40 changelog = "https://github.com/kuimono/openapi-schema-pydantic/releases/tag/v${version}";
41 license = licenses.mit;
42 maintainers = with maintainers; [ natsukium ];
43 };
44}