Home / File/ test_pydantic_imports.py — langchain Source File

test_pydantic_imports.py — langchain Source File

Architecture documentation for test_pydantic_imports.py, a python file in the langchain codebase. 3 imports, 0 dependents.

File python CoreAbstractions Serialization 3 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  cb5b5ca9_ab80_ac5e_0a5d_085cecdc15b7["test_pydantic_imports.py"]
  3888b2bf_bffe_7c16_770f_a406d400119c["importlib"]
  cb5b5ca9_ab80_ac5e_0a5d_085cecdc15b7 --> 3888b2bf_bffe_7c16_770f_a406d400119c
  b6ee5de5_719a_eeb5_1e11_e9c63bc22ef8["pathlib"]
  cb5b5ca9_ab80_ac5e_0a5d_085cecdc15b7 --> b6ee5de5_719a_eeb5_1e11_e9c63bc22ef8
  6e58aaea_f08e_c099_3cc7_f9567bfb1ae7["pydantic"]
  cb5b5ca9_ab80_ac5e_0a5d_085cecdc15b7 --> 6e58aaea_f08e_c099_3cc7_f9567bfb1ae7
  style cb5b5ca9_ab80_ac5e_0a5d_085cecdc15b7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import importlib
from pathlib import Path

from pydantic import BaseModel


def test_all_models_built() -> None:
    for path in Path("../core/langchain_core/").glob("*"):
        module_name = path.stem
        if (
            not module_name.startswith(".")
            and path.suffix != ".typed"
            and module_name != "pydantic_v1"
        ):
            module = importlib.import_module("langchain_core." + module_name)
            all_ = getattr(module, "__all__", [])
            for attr_name in all_:
                attr = getattr(module, attr_name)
                try:
                    if issubclass(attr, BaseModel):
                        assert attr.__pydantic_complete__ is True
                except TypeError:
                    # This is expected for non-class attributes
                    pass

Subdomains

Dependencies

  • importlib
  • pathlib
  • pydantic

Frequently Asked Questions

What does test_pydantic_imports.py do?
test_pydantic_imports.py is a source file in the langchain codebase, written in python. It belongs to the CoreAbstractions domain, Serialization subdomain.
What functions are defined in test_pydantic_imports.py?
test_pydantic_imports.py defines 1 function(s): test_all_models_built.
What does test_pydantic_imports.py depend on?
test_pydantic_imports.py imports 3 module(s): importlib, pathlib, pydantic.
Where is test_pydantic_imports.py in the architecture?
test_pydantic_imports.py is located at libs/core/tests/unit_tests/test_pydantic_imports.py (domain: CoreAbstractions, subdomain: Serialization, directory: libs/core/tests/unit_tests).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free