Project TOML Configuration
Relevant source files
The following files were used as context for generating this wiki page:
The pyproject.toml file serves as the foundational configuration for the flext-target-ldap project, a FLEXT Target designed for loading data into LDAP directories. It follows a managed standardization pattern where sections are enforced by infrastructure tools while allowing for project-specific extensions.
This configuration defines the build system, project metadata, runtime dependencies, and extensive development tool settings. It ensures consistency across the FLEXT ecosystem by integrating with flext-core, flext-ldap, and flext-meltano libraries.
Sources: pyproject.toml:1-35, README.md:1-10
Project Metadata and Dependencies
The project uses hatchling as the build backend and defines metadata including the version, license, and intended audience. The dependencies are structured to inherit from the broader FLEXT framework.
Core Dependencies
The runtime environment relies on four primary packages:
flext-cli: Provides command-line interface utilities.flext-core: Contains the base architectural patterns and settings logic.flext-ldap: Handles low-level LDAP protocol interactions.flext-meltano: Provides integration with the Meltano/Singer ecosystem.
Sources: pyproject.toml:10-35
Dependency Relationship Diagram
The following diagram illustrates how the target project relates to its core FLEXT dependencies and the external environment.
The project acts as a bridge between Singer-formatted data (via flext-meltano) and LDAP servers (via flext-ldap).
Sources: pyproject.toml:31, src/flext_target_ldap/api.py:34-45
Development and Quality Gates
The configuration specifies an extensive list of optional development dependencies and tool settings to maintain high code quality.
Tool Categories
| Category | Tools Included |
|---|---|
| Linting & Formatting | ruff, black, isort, autoflake, codespell |
| Type Checking | mypy, pyright, pyrefly, django-stubs |
| Testing | pytest, pytest-cov, pytest-mock, hypothesis |
| Documentation | mkdocs, mkdocs-material, mkdocstrings, mermaid2 |
| Security | bandit, pip-audit |
Sources: pyproject.toml:40-109
Quality Gate Configuration
The project enforces strict quality gates through specific tool configurations:
- Coverage: Minimum failure threshold set to 20% with precision of 2.
- Mypy: Strict type checking enabled, including
warn_unreachableandstrict_equality. - Ruff: Configured with a
line-lengthof 88 and a wide range of linting rules, including bans on specific libraries likeargparseorrichin favor offlext-clialternatives.
Sources: pyproject.toml:127-133, pyproject.toml:147-169, pyproject.toml:418-435
Settings and Environment Integration
The pyproject.toml interacts with the FlextTargetLdapSettings class to define how the application is configured at runtime. The configuration system uses Pydantic-based models to normalize and validate settings.
Configuration Structure
The project configuration (managed via FlextSettingsBase) supports an environment prefix and automatically handles the normalization of flat Singer settings into a canonical nested shape.
The normalization logic extracts connection-related keys (like host, port, bind_dn) and moves them into a nested connection object.
Sources: src/flext_target_ldap/settings.py:27-45, src/flext_target_ldap/settings.py:84-100
Key Configuration Parameters
| Setting | Type | Default | Description |
|---|---|---|---|
base_dn | NonEmptyStr | Required | The Base Distinguished Name for LDAP operations. |
search_scope | Ldap3SearchScope | SUBTREE | LDAP search scope (BASE, ONELEVEL, SUBTREE). |
batch_size | BatchSize | 1000 | Max entries per batch operation. |
attribute_mapping | StrMapping | {} | Mapping of source fields to LDAP attributes. |
object_classes | StrSequence | ['top'] | Classes assigned to created entries. |
Sources: src/flext_target_ldap/settings.py:101-180, src/flext_target_ldap/models.py:136-150
Conclusion
The pyproject.toml file is the central orchestrator for flext-target-ldap, defining a strict, managed environment. By leveraging the FLEXT ecosystem's core libraries and enforcing rigorous linting, type-checking, and testing standards, the configuration ensures that the LDAP target remains robust, maintainable, and compliant with the Singer protocol and modern Python development practices.