v1.11.3
π Overview
Introduce a comprehensive JSON Schema generation pipeline to automate the validation of pyproject.toml configurations. This release also enhances the configuration models with rich metadata for improved IDE support and refines the CI workflow to ensure schema integrity across the codebase.
β¨ New Features
ποΈ Implement JSON Schema Generation Pipeline
Introduce the DFCSchemaGenerator() and PyprojectSchemaGenerator() classes to automatically generate JSON schemas from internal Python configuration models. This ensures that the configuration options are always synchronised with the current implementation.
βοΈ Technical Improvements
π Enhance Configuration Metadata
Extend the GlobalConfig() and SectionConfig() dataclasses in config.py with descriptive metadata using the field() function. This enables modern IDEs such as VS Code to provide real-time tooltips and autocomplete for the [tool.dfc] section in pyproject.toml.
π‘οΈ Integrate Schema Integrity Workflow in CI
Update the CI pipeline in ci.yml to automatically generate and verify JSON schemas. The workflow now ensures that any changes to configuration models are reflected in the generated schemas, preventing documentation drift.
βοΈ Refine Schema Generator Robustness
Improve the reliability of the generate_config_schema.py utility with several robust enhancements.
- Handle
OptionalandUniontypes more effectively, ensuring correct mapping to JSON Schema type arrays andnullvalues. - Standardise the detection of
Literaltypes using theget_origin()function. - Optimise package information retrieval by replacing the
lru_cache()decorator with thecached_property()decorator for better performance. - Implement conditional imports for
tomllibto maintain compatibility with Python versions below 3.11 using thetomlipackage.
π Fix Documentation and Formatting
Resolve issues with broken URLs and standardise formatting across documentation files to improve clarity and maintainability.
π Documentation
π Document the JSON Schema System
Initialise a comprehensive README.md in the src/schemas/json/ directory to guide developers on how to enable and maintain JSON Schema validation for their local project configurations.
πͺ Pull Requests
- Introduce automated JSON Schema generation for
pyproject.tomlconfiguration validation by @chrimaho in #38
Full Changelog: v1.11.2...v1.11.3