From 4503d47a56950a21aeae9a3e648d6862682756ae Mon Sep 17 00:00:00 2001 From: natsukium Date: Fri, 5 May 2023 01:29:10 +0900 Subject: [PATCH] python3Packages.openapi-schema-pydantic: init at 1.2.4 --- .../openapi-schema-pydantic/default.nix | 44 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 46 insertions(+) create mode 100644 pkgs/development/python-modules/openapi-schema-pydantic/default.nix diff --git a/pkgs/development/python-modules/openapi-schema-pydantic/default.nix b/pkgs/development/python-modules/openapi-schema-pydantic/default.nix new file mode 100644 index 000000000000..1930dc237f05 --- /dev/null +++ b/pkgs/development/python-modules/openapi-schema-pydantic/default.nix @@ -0,0 +1,44 @@ +{ lib +, buildPythonPackage +, fetchPypi +, pythonOlder +, pydantic +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "openapi-schema-pydantic"; + version = "1.2.4"; + format = "setuptools"; + + disabled = pythonOlder "3.6"; + + src = fetchPypi { + inherit pname version; + hash = "sha256-PiLPWLdKafdSzH5fFTf25EFkKC2ycAy7zTu5nd0GUZY="; + }; + + propagatedBuildInputs = [ + pydantic + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + disabledTests = [ + # these tests are broken with `pydantic >= 1.10` + # but this library seems to work fine. + # e.g. https://github.com/hwchase17/langchain/blob/d86ed15d8884d5a3f120a433b9dda065647e4534/poetry.lock#L6011-L6012 + "test_pydantic_discriminator_schema_generation" + "test_pydantic_discriminator_openapi_generation" + ]; + + meta = with lib; { + description = "OpenAPI (v3) specification schema as pydantic class"; + homepage = "https://github.com/kuimono/openapi-schema-pydantic"; + changelog = "https://github.com/kuimono/openapi-schema-pydantic/releases/tag/v${version}"; + license = licenses.mit; + maintainers = with maintainers; [ natsukium ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 73b8679c0561..93913fecde01 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -6910,6 +6910,8 @@ self: super: with self; { openant = callPackage ../development/python-modules/openant { }; + openapi-schema-pydantic = callPackage ../development/python-modules/openapi-schema-pydantic { }; + openapi-schema-validator = callPackage ../development/python-modules/openapi-schema-validator { }; openapi-spec-validator = callPackage ../development/python-modules/openapi-spec-validator { };