Something went wrong. Try again.
Nix Packages collection & NixOS github.com/NixOS/nixpkgs
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140{ lib, buildPythonPackage, fetchFromGitHub,
# build-system hatch-vcs, hatchling,
# dependencies argcomplete, black, genson, inflect, isort, jinja2, packaging, pydantic, pyyaml,
# optional-dependencies # debug: pysnooper, # graphql: graphql-core, # http: httpx, # protobuf: grpcio-tools, # ruff: ruff, # validation: openapi-spec-validator, prance, # watch: watchfiles,
# tests email-validator, hypothesis, hypothesis-jsonschema, inline-snapshot, jsonschema, msgspec, pytest-mock, pytest-timeout, pytest-xdist, pytestCheckHook, time-machine,}:
buildPythonPackage (finalAttrs: { pname = "datamodel-code-generator"; version = "0.71.0"; pyproject = true; __structuredAttrs = true;
src = fetchFromGitHub { owner = "koxudaxi"; repo = "datamodel-code-generator"; tag = finalAttrs.version; hash = "sha256-0vh/iynZzmMzvdUXNScb+JWANdSrzPLT1qt+jyKleg4="; };
build-system = [ hatch-vcs hatchling ];
dependencies = [ argcomplete black genson inflect isort jinja2 packaging pydantic pyyaml ];
optional-dependencies = lib.fix (self: { debug = [ pysnooper ]; graphql = [ graphql-core ]; http = [ httpx ]; protobuf = [ grpcio-tools ]; ruff = [ ruff ]; validation = [ openapi-spec-validator prance ]; watch = [ watchfiles ]; });
nativeCheckInputs = [ email-validator hypothesis hypothesis-jsonschema inline-snapshot jsonschema msgspec pytest-mock pytest-timeout pytest-xdist pytestCheckHook time-machine ] ++ lib.concatAttrValues finalAttrs.passthru.optional-dependencies;
disabledTests = [ # remote testing, name resolution failure. "test_openapi_parser_parse_remote_ref"
# ruff formatting changed, causing errors such as # Failed: Output mismatch # AssertionError: Content mismatch for ... "test_no_use_type_checking_imports" "test_ruff_batch_formatting_directory" "test_ruff_check_and_format_combined" "test_ruff_check_only" "test_type_checking_imports_default_to_runtime_imports_for_modular_pydantic_ruff" ];
# Some of the tests use localhost networking. __darwinAllowLocalNetworking = true;
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"; changelog = "https://github.com/koxudaxi/datamodel-code-generator/releases/tag/${finalAttrs.src.tag}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ tochiaha ]; mainProgram = "datamodel-codegen"; };})