Skip to content

v1.11.3

Choose a tag to compare

@chrimaho chrimaho released this 24 Jan 06:12
· 80 commits to main since this release

πŸ“ƒ 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 Optional and Union types more effectively, ensuring correct mapping to JSON Schema type arrays and null values.
  • Standardise the detection of Literal types using the get_origin() function.
  • Optimise package information retrieval by replacing the lru_cache() decorator with the cached_property() decorator for better performance.
  • Implement conditional imports for tomllib to maintain compatibility with Python versions below 3.11 using the tomli package.

πŸ› 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.toml configuration validation by @chrimaho in #38

Full Changelog: v1.11.2...v1.11.3