pyvider 2025-04-12
Major refactoring of the conversion system: moved conversion logic from `pyvider.conversion`...
34 files · 948+ · 2,133-

New Core Conversion System

5 files changed
  • conversion Created `src/pyvider/core/conversion/` package with unified API for value serialization/deseriali...
  • base.py Added `base.py` with `FormatKind` enum, `Converter` protocol, `ConverterOptions`, and top-level `...
  • context.py Added `context.py` with `OperationContext` enum (READ, PLAN, APPLY, FUNCTION) and context management
  • registry.py Added `registry.py` with converter registration system mapping `FormatKind` to converter implemen...
  • protocols.py Added `protocols.py` defining converter protocol interfaces
  • Created src/pyvider/core/conversion/ package with unified API for value serialization/deserialization decouple behavioral
    1 file
    • conversion
  • Added base.py with FormatKind enum, Converter protocol, ConverterOptions, and top-level serialize/deserialize functions interface internal
    1 file
    • base.py
  • Added context.py with OperationContext enum (READ, PLAN, APPLY, FUNCTION) and context management instantiate internal
    1 file
    • context.py
  • Added registry.py with converter registration system mapping FormatKind to converter implementations instantiate internal
    1 file
    • registry.py
  • Added protocols.py defining converter protocol interfaces interface internal
    1 file
    • protocols.py

Moved and Refactored Converters

10 files changed
  • terraform.py Moved `terraform.py` converter to `core/conversion/converters/terraform.py` with significant refa...
  • terraform.py Moved `terraform.py` converter to `core/conversion/converters/terraform.py` with significant refa...
  • json.py Moved `json.py` converter to `core/conversion/converters/json.py`
  • json.py Moved `json.py` converter to `core/conversion/converters/json.py`
  • conversion Deleted original `pyvider/conversion/` modules: `base.py`, `context.py`, `format.py`, `json.py`, ...
  • base.py Deleted original `pyvider/conversion/` modules: `base.py`, `context.py`, `format.py`, `json.py`, ...
  • context.py Deleted original `pyvider/conversion/` modules: `base.py`, `context.py`, `format.py`, `json.py`, ...
  • format.py Deleted original `pyvider/conversion/` modules: `base.py`, `context.py`, `format.py`, `json.py`, ...
  • schema.py Deleted original `pyvider/conversion/` modules: `base.py`, `context.py`, `format.py`, `json.py`, ...
  • types.py Deleted original `pyvider/conversion/` modules: `base.py`, `context.py`, `format.py`, `json.py`, ...
  • Moved terraform.py converter to core/conversion/converters/terraform.py with significant refactoring (~600 lines of changes) decouple internal
    2 files
    • terraform.py
    • terraform.py
  • Moved json.py converter to core/conversion/converters/json.py decouple internal
    2 files
    • json.py
    • json.py
  • Deleted original pyvider/conversion/ modules: base.py, context.py, format.py, json.py, schema.py, terraform.py, types.py interface errata
    8 files
    • conversion
    • base.py
    • context.py
    • format.py
    • json.py
    • schema.py
    • terraform.py
    • types.py

New Core Exceptions

4 files changed
  • exceptions Created `src/pyvider/core/exceptions/` package with `base.py` (50 lines of base exception classes...
  • base.py Created `src/pyvider/core/exceptions/` package with `base.py` (50 lines of base exception classes...
  • conversion.py Created `src/pyvider/core/exceptions/` package with `base.py` (50 lines of base exception classes...
  • conversion.py Removed old `pyvider/exceptions/conversion.py` and stripped serialization exceptions
  • Created src/pyvider/core/exceptions/ package with base.py (50 lines of base exception classes) and conversion.py (126 lines of conversion-specific exceptions including ConversionError, SchemaConversionError) baseline internal
    3 files
    • exceptions
    • base.py
    • conversion.py
  • Removed old pyvider/exceptions/conversion.py and stripped serialization exceptions decouple internal
    1 file
    • conversion.py

Protocol-Level Converter Adapter

2 files changed
  • converter.py Added `src/pyvider/protocols/tfprotov6/adapters/converter.py` (204 lines) bridging the core conve...
  • conversion Removed the old `tfprotov6/conversion/` package (schema_types, terraform_to_cty, validation modul...
  • Added src/pyvider/protocols/tfprotov6/adapters/converter.py (204 lines) bridging the core conversion system with the Terraform protocol interface internal
    1 file
    • converter.py
  • Removed the old tfprotov6/conversion/ package (schema_types, terraform_to_cty, validation modules totaling ~957 lines) baseline internal
    1 file
    • conversion

Handler Import Updates

1 file changed
  • pyvider.core.conversion Updated pyvider.core.conversion
  • Updated all tfprotov6 handlers (apply_resource_change, call_function, get_provider_schema, plan_resource_change, read_data_source, read_resource, validate_data_resource_config) to use new pyvider.core.conversion imports instantiate internal
    1 file
    • pyvider.core.conversion