diff --git a/pkgs/development/python-modules/datamodel-code-generator/default.nix b/pkgs/development/python-modules/datamodel-code-generator/default.nix index 03a7611f9453..e542fbc0acbb 100644 --- a/pkgs/development/python-modules/datamodel-code-generator/default.nix +++ b/pkgs/development/python-modules/datamodel-code-generator/default.nix @@ -3,15 +3,21 @@ argcomplete, black, buildPythonPackage, + email-validator, fetchFromGitHub, genson, graphql-core, + grpcio-tools, hatch-vcs, hatchling, httpx, + hypothesis, + hypothesis-jsonschema, inflect, inline-snapshot, isort, + jsonschema, + msgspec, jinja2, openapi-spec-validator, packaging, @@ -20,6 +26,8 @@ pydantic, pysnooper, pytest-mock, + pytest-timeout, + pytest-xdist, pytestCheckHook, pyyaml, time-machine, @@ -28,14 +36,14 @@ buildPythonPackage rec { pname = "datamodel-code-generator"; - version = "0.55.0"; + version = "0.71.0"; pyproject = true; src = fetchFromGitHub { owner = "koxudaxi"; repo = "datamodel-code-generator"; tag = version; - hash = "sha256-zsLJv7gKhmnEIS/AUvnBzm+07QFQoMdiFo/PkfRyHek="; + hash = "sha256-0vh/iynZzmMzvdUXNScb+JWANdSrzPLT1qt+jyKleg4="; }; pythonRelaxDeps = [ @@ -65,6 +73,7 @@ buildPythonPackage rec { debug = [ pysnooper ]; graphql = [ graphql-core ]; http = [ httpx ]; + protobuf = [ grpcio-tools ]; ruff = [ ruff ]; validation = [ openapi-spec-validator @@ -76,20 +85,31 @@ buildPythonPackage rec { }; nativeCheckInputs = [ + email-validator inline-snapshot + hypothesis + hypothesis-jsonschema + jsonschema + msgspec pytest-mock + pytest-timeout + pytest-xdist pytestCheckHook time-machine ] ++ optional-dependencies.all; - pythonImportsCheck = [ "datamodel_code_generator" ]; + pytestFlags = [ + "--maxfail=2" + ]; disabledTests = [ # remote testing, name resolution failure. "test_openapi_parser_parse_remote_ref" ]; + pythonImportsCheck = [ "datamodel_code_generator" ]; + meta = { description = "Pydantic model and dataclasses.dataclass generator for easy conversion of JSON, OpenAPI, JSON Schema, and YAML data sources"; homepage = "https://github.com/koxudaxi/datamodel-code-generator"; diff --git a/pkgs/development/python-modules/hypothesis-jsonschema/default.nix b/pkgs/development/python-modules/hypothesis-jsonschema/default.nix new file mode 100644 index 000000000000..e57b566a2874 --- /dev/null +++ b/pkgs/development/python-modules/hypothesis-jsonschema/default.nix @@ -0,0 +1,50 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + setuptools, + hypothesis, + jsonschema, + pytest-cov-stub, + pytestCheckHook, +}: + +buildPythonPackage (finalAttrs: { + pname = "hypothesis-jsonschema"; + version = "0.23.1"; + pyproject = true; + + __structuredAttrs = true; + + # no git tags + src = fetchPypi { + inherit (finalAttrs) pname version; + hash = "sha256-9KwDICQ0KkFJoQJTmE9aVza4Kz/ir7CIjzg0oxFT8hU="; + }; + + build-system = [ + setuptools + ]; + + dependencies = [ + hypothesis + jsonschema + ]; + + doCheck = false; # sdist does not include everything to run the tests + + nativeCheckInputs = [ + pytest-cov-stub + pytestCheckHook + ]; + + pythonImportsCheck = [ + "hypothesis_jsonschema" + ]; + + meta = { + description = "Generate test data from JSON schemata with Hypothesis"; + homepage = "https://github.com/Zac-HD/hypothesis-jsonschema"; + license = lib.licenses.mpl20; + }; +}) diff --git a/pkgs/development/python-modules/inline-snapshot/default.nix b/pkgs/development/python-modules/inline-snapshot/default.nix index 56968ab958bb..fd694d13f53d 100644 --- a/pkgs/development/python-modules/inline-snapshot/default.nix +++ b/pkgs/development/python-modules/inline-snapshot/default.nix @@ -21,14 +21,14 @@ buildPythonPackage rec { pname = "inline-snapshot"; - version = "0.32.5"; + version = "0.34.2"; pyproject = true; src = fetchFromGitHub { owner = "15r10nk"; repo = "inline-snapshot"; tag = version; - hash = "sha256-xnooMIm0UiNOWrZ4JZwbpFzliGsTF7b1DAXi1fxMb30="; + hash = "sha256-4Uvc925/6RxJRHjP3SZaB7T+gqky5KlL9agHy/14Jd0="; }; build-system = [ hatchling ]; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d9c591a5212e..9d6de4f04834 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7415,6 +7415,8 @@ self: super: with self; { hypothesis-auto = callPackage ../development/python-modules/hypothesis-auto { }; + hypothesis-jsonschema = callPackage ../development/python-modules/hypothesis-jsonschema { }; + hypothesis_6_136 = callPackage ../development/python-modules/hypothesis/hypothesis_6_136.nix { }; hypothesmith = callPackage ../development/python-modules/hypothesmith { };