Dependency & Package Management
Relevant source files
The following files were used as context for generating this wiki page:
Dependency and package management in flext-tap-ldif is centralized within the pyproject.toml configuration, following the standards of the FLEXT infrastructure. The project utilizes hatchling as its build backend and implements a strict, managed approach to both core runtime dependencies and extensive development toolsets. This ensures consistency across the FLEXT ecosystem and maintains a high bar for technical quality through automated linting, typing, and testing gates.
Sources: pyproject.toml:1-10, README.md:1-10
Core Build System & Metadata
The project is structured as a standard Python package named flext-tap-ldif. It uses hatchling.build as the build backend, ensuring compatibility with modern PEP 517 build workflows. Package metadata, including versioning and authorship, is managed through both the configuration file and internal version modules to provide a single source of truth (SSOT).
Versioning Architecture
Package versioning follows a structured hierarchy where FlextTapLdifVersion inherits from FlextVersion. Metadata is dynamically retrieved using importlib.metadata to ensure that the runtime version matches the installed package state.
The diagram shows the MRO-derived versioning system used to maintain package metadata.
Sources: src/flext_tap_ldif/version.py:15-30, pyproject.toml:7-11
Dependency Categories
Dependencies are categorized into runtime requirements and optional development groups. The project specifically targets Python 3.13, enforcing a narrow version range to ensure stability and leverage modern language features.
Runtime Dependencies
The core functionality relies on the FLEXT ecosystem components and Pydantic for data validation.
| Dependency | Purpose | Constraint |
|---|---|---|
flext-core | Core framework utilities and lazy loading | Latest |
flext-ldif | LDIF parsing logic | Latest |
flext-meltano | Singer/Meltano integration utilities | Latest |
flext-observability | Logging and metrics | Latest |
pydantic | Data modeling and validation | >=2.13.3 |
Sources: pyproject.toml:25-32, pyproject.toml:40-41
Development Dependencies (dev group)
The project includes an extensive list of development tools for maintenance, documentation, and quality assurance. This group includes:
- Linters/Formatters:
ruff,black,isort,autoflake. - Testing:
pytest,pytest-cov,hypothesis,factory-boy. - Documentation:
mkdocswith various plugins (Material, Mermaid2, Literate Nav). - Security:
bandit,pip-audit. - Typing:
mypy,pyrefly, and numeroustypes-*stubs for libraries likerequestsandyaml.
Sources: pyproject.toml:47-130
Managed Tool Configuration
The pyproject.toml file contains specialized configurations for various tools, many of which are marked as [MANAGED]. This indicates they are enforced by flext_infra to maintain consistency across the organization.
Type Checking & Linting Flow
The project employs a multi-layered validation strategy involving mypy, pyright, and ruff.
This flow illustrates the sequence of quality gates a package must pass during development and CI.
Sources: pyproject.toml:158-185, pyproject.toml:319-385, pyproject.toml:491-527
Key Tool Settings
| Tool | Key Configuration |
|---|---|
| MyPy | strict_equality = true, warn_unreachable = true, plugins = ["pydantic.mypy"] |
| Pyright | typeCheckingMode = "strict", pythonVersion = "3.13", reportUnnecessaryCast = "error" |
| Coverage | fail_under = 20, precision = 2 |
| Ruff | target-version = "py313", select = ["ALL"] |
Sources: pyproject.toml:158-177, pyproject.toml:390-410, pyproject.toml:144-150
Module Exports & Lazy Loading
To optimize startup time and manage internal complexity, flext-tap-ldif uses a lazy loading mechanism provided by flext_core. The package surface is defined in _exports.py and _exports_lazy_part_01.py, which maps public namespaces to their internal implementations.
The diagram shows how the package uses lazy exports to manage internal module access without eager imports.
Sources: src/flext_tap_ldif/init.py:39-65, src/flext_tap_ldif/_exports.py:10-25, src/flext_tap_ldif/_exports_lazy_part_01.py:10-45
Engineering Governance
As defined in AGENTS.md, dependency management follows a "Zero-Tolerance / Strict-Total" policy. This means the project must fix root causes in dependencies rather than using compatibility wrappers or legacy stubs. The pyproject.toml is considered the Single Source of Truth (SSOT) for the project's identity, configuration, and contracts.
Sources: AGENTS.md:20-30, README.md:32-35
Package management in this repository is designed to be highly automated and strictly governed. By leveraging a centralized pyproject.toml and a hierarchy of managed tools, the project ensures that dependencies are predictable, type-safe, and conformant to the broader FLEXT ecosystem standards.