Build & Packaging
Relevant source files
The following files were used as context for generating this wiki page:
The flext-dbt-ldif project utilizes a modern Python build system centered around hatchling and standardized through the FLEXT infrastructure. The project is classified as an integration class project, specifically designed to provide dbt models for LDIF (LDAP Data Interchange Format) data transformations. Packaging ensures that the Python CLI, library components, and dbt package resources are correctly bundled for distribution and deployment.
Build and packaging processes are strictly governed by the "Universal Agent Law," which mandates automated validation and zero-tolerance for manual workarounds during the development lifecycle. The system integrates standard Python metadata with dbt project configurations to support both the application layer and the data transformation layer.
Sources: pyproject.toml:7-35, README.md:5-10, AGENTS.md:7-15
Build System Configuration
The project uses hatchling as the build backend, configured within the [build-system] section. This setup follows the FLEXT standardization for modernizing dependencies and build processes.
The build process leverages Hatchling to transform source metadata into distribution-ready packages.
Sources: pyproject.toml:7-10, pyproject.toml:23-28
Key Project Metadata
| Field | Value / Description |
|---|---|
| Name | flext-dbt-ldif |
| Version | 0.12.0-dev |
| License | MIT |
| Python Compatibility | >=3.13, <3.14 |
| Build Backend | hatchling.build |
| Project Class | integration |
Sources: pyproject.toml:7-35, README.md:9
Dependency Management
Dependencies are divided into core runtime requirements and extensive development/quality gate tools. The project enforces strict typing and uses flext-core as a foundational dependency.
Runtime Dependencies
flext-coreflext-ldifflext-meltanopydantic(>=2.13.3)pydantic-core(>=2.46.3)
Sources: pyproject.toml:37-43
Development and Tooling
The dev optional-dependency group includes a wide array of tools for linting, testing, and documentation generation, such as ruff, mypy, pytest, and various mkdocs plugins.
Sources: pyproject.toml:47-113
Workspace and Scripting
The project exposes a command-line interface (CLI) entry point and maintains workspace awareness through uv tool configurations.
Entry Points
A CLI script is registered for global use:
flext-fixed-script: Points toflext_dbt_ldif.cli:main.
Sources: pyproject.toml:116-117
Workspace Sources
For development within the FLEXT ecosystem, the uv tool configuration allows local workspace references for parent components:
flext-coreflext-ldifflext-meltano
Sources: pyproject.toml:688-696
dbt Integration Packaging
As a dbt-centric project, packaging also involves the configuration of dbt_project.yml. This defines how the dbt package identifies itself and how models are structured for the end-user.
The dbt project configuration defines the filesystem layout and transformation logic for packaging as a dbt module.
Sources: dbt_project.yml:1-55
Packaging Paths
| Resource | Directory |
|---|---|
| Models | models |
| Macros | macros |
| Tests | tests |
| Documentation | docs |
| Compiled SQL | target |
Sources: dbt_project.yml:10-20, dbt_project.yml:68
Quality Gates & Automated Packaging
The repository uses make verbs to drive quality gates before packaging occurs. The "Universal Agent Law" ensures that no package is generated from a state with dead code or unvalidated logic.
Standardized Verbs
make mod: Regenerates managedpyproject.tomlsections.make gen: Regenerates auto-generated package files and lazy exports (e.g.,tests/unit/__init__.py).check,test,val,docs: Canonical quality gate steps.
Sources: pyproject.toml:2, tests/unit/init.py:1, README.md:38-40, AGENTS.md:12-20
Lazy Loading and Exports
To optimize runtime and packaging overhead, the project implements lazy loading for exports within the package structure, using flext_core.lazy utilities. This is evidenced in the package __init__.py files which are regenerated during the build cycle.
Sources: tests/unit/init.py:7-11
Conclusion
Build and Packaging in flext-dbt-ldif is a strictly managed process that combines standard Python distribution standards (Hatchling, Pydantic) with dbt-specific resource management. By adhering to the FLEXT infra standards and the Universal Agent Law, the project ensures that every distribution package meets a high baseline of quality, correct typing, and architectural consistency.
Sources: pyproject.toml:1-6, AGENTS.md:7-11, README.md:38-45