Build & Dependency Management
Relevant source files
The following files were used as context for generating this wiki page:
Build and dependency management for the flext-plugin project is governed by a strict, automated infrastructure that ensures consistency across the FLEXT platform. The system utilizes hatchling as its build backend and maintains a clear distinction between managed infrastructure sections and custom project metadata within the configuration.
This module acts as a "platform" class project, targeting Python 3.13 and enforcing rigorous quality gates through automated toolchains. It relies on a hierarchical dependency structure where the plugin system inherits and extends the core platform's capabilities.
Sources: pyproject.toml:6-12, README.md:5-10, AGENTS.md:10-25
Build System Architecture
The project employs a standardized build configuration managed by flext_infra.deps.modernizer. This ensures that core build settings are enforced across the ecosystem while allowing for project-specific extensions.
Core Build Backend
The build system is defined in the [build-system] section, utilizing hatchling to manage the package lifecycle.
| Component | Value | Description |
|---|---|---|
| Build Backend | hatchling.build | The primary engine for building the package. |
| Requirements | hatchling | Core requirement for the build process. |
| Python Version | >=3.13, <3.14 | Strict version constraint for the runtime environment. |
Sources: pyproject.toml:7-10, pyproject.toml:44
Dependency Workflow
The following diagram illustrates the relationship between the build backend, core dependencies, and development quality gates.
The build process ensures that runtime dependencies like flext-core are resolved before development tools apply quality gates.
Sources: pyproject.toml:7-44, README.md:27-30
Dependency Management
Dependencies are categorized into runtime requirements and consolidated development dependencies. Runtime dependencies focus on the plugin framework's core needs, such as schema validation and process monitoring.
Runtime Dependencies
These packages are required for the plugin system to function:
- Infrastructure:
flext-core,flext-cli - Data Validation:
pydantic (>=2.13.3),jsonschema (>=4.26.0) - System/Async:
anyio,psutil,watchdog
Sources: pyproject.toml:34-42
Development and Quality Toolchain
The [project.optional-dependencies] section contains an extensive list of tools for linting, testing, and documentation.
| Category | Key Tools |
|---|---|
| Linting/Formatting | ruff, black, isort, autoflake |
| Static Analysis | mypy, pyright, pyrefly, vulture, deptry |
| Testing | pytest, pytest-cov, pytest-xdist, hypothesis |
| Documentation | mkdocs, mkdocstrings, mkdocs-mermaid2-plugin |
Sources: pyproject.toml:53-125
Configuration Enforcement
The project utilizes "Managed" and "Custom" sections within pyproject.toml. Sections marked as [MANAGED] are strictly enforced by flext_infra and should not be manually edited, while [CUSTOM] sections allow for project-specific metadata.
Quality Gate Tools
The build system configures several tools to maintain high code standards:
- Ruff: Configured with
ALLselect rules and specific ignores for example files and tests. - Pyright: Enforces
stricttype checking and defines specific execution environments forsrc,tests, andexamples. - Coverage: Sets a
fail_underthreshold of 25% to ensure minimum test visibility.
Sources: pyproject.toml:144-148, pyproject.toml:311-343, pyproject.toml:410-415
Dependency MRO & Integration
As part of the FLEXT platform, the flext-plugin system follows a Method Resolution Order (MRO) cascade. It inherits from flext-core and is used by higher-level services.
The diagram shows how flext-plugin models extend flext-core and flext-cli patterns to provide a unified platform experience.
Sources: README.md:21-25, src/flext_plugin/models.py:23-28
Conclusion
Build and dependency management in flext-plugin is a highly structured process that prioritizes automated enforcement over manual configuration. By leveraging hatchling and a managed infrastructure approach, the project maintains compatibility with the broader FLEXT ecosystem while ensuring that all plugins meet the platform's strict quality and type-safety requirements.
Sources: AGENTS.md:10-25, pyproject.toml:1-5