Home / File/ test_version.py — langchain Source File

test_version.py — langchain Source File

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

File python LangChainCore ApiManagement 3 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  94361b7a_a428_148c_600d_a3472eaaaf2a["test_version.py"]
  927570d8_11a6_5c17_0f0d_80baae0c733e["pathlib"]
  94361b7a_a428_148c_600d_a3472eaaaf2a --> 927570d8_11a6_5c17_0f0d_80baae0c733e
  3633a462_cfb4_0288_8789_81f7e549c792["toml"]
  94361b7a_a428_148c_600d_a3472eaaaf2a --> 3633a462_cfb4_0288_8789_81f7e549c792
  1c2894ae_4596_c348_e5c7_72816d505e72["langchain"]
  94361b7a_a428_148c_600d_a3472eaaaf2a --> 1c2894ae_4596_c348_e5c7_72816d505e72
  style 94361b7a_a428_148c_600d_a3472eaaaf2a fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

"""Test that package version is consistent across configuration files."""

from pathlib import Path

import toml

import langchain


def test_version_matches_pyproject() -> None:
    """Verify that __version__ in __init__.py matches version in pyproject.toml."""
    # Get the version from the package __init__.py
    init_version = langchain.__version__

    # Read the version from pyproject.toml
    pyproject_path = Path(__file__).parent.parent.parent / "pyproject.toml"
    with pyproject_path.open() as f:
        pyproject_data = toml.load(f)

    pyproject_version = pyproject_data["project"]["version"]

    # Assert they match
    assert init_version == pyproject_version, (
        f"Version mismatch: __init__.py has '{init_version}' but "
        f"pyproject.toml has '{pyproject_version}'. "
        f"Please update langchain/__init__.py to match pyproject.toml."
    )

Domain

Subdomains

Dependencies

  • langchain
  • pathlib
  • toml

Frequently Asked Questions

What does test_version.py do?
test_version.py is a source file in the langchain codebase, written in python. It belongs to the LangChainCore domain, ApiManagement subdomain.
What functions are defined in test_version.py?
test_version.py defines 1 function(s): test_version_matches_pyproject.
What does test_version.py depend on?
test_version.py imports 3 module(s): langchain, pathlib, toml.
Where is test_version.py in the architecture?
test_version.py is located at libs/langchain_v1/tests/unit_tests/test_version.py (domain: LangChainCore, subdomain: ApiManagement, directory: libs/langchain_v1/tests/unit_tests).

Analyze Your Own Codebase

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

Try Supermodel Free