Migration Guide to Version 0.2.0

This guide helps you migrate your code from True-Core < 0.2.0 to the new package structure.

Component Migration Map

Enumeration Components

Update enumeration imports
# Old imports
from true.enum_registry import EnumRegistry
from true.enum_toolkits import EnumToolkit

# New imports
from true_enumeration.registry import EnumRegistry
from true_enumeration.toolkits import EnumToolkit

Type System

Update type system imports
# Old imports
from true.types import CustomType, TypeValidator

# New imports
from true_types import CustomType, TypeValidator

File Handling

Update DummyFile imports
# Old imports
from true.utils import DummyFile

# New imports
from true_blobs import DummyFile

Removed Components

Pointer Class

The Pointer class has been removed. Use Python’s built-in reference system instead:

Replace Pointer usage
# Old code (no longer available)
from true.utils import Pointer

obj = SomeObject()
ptr = Pointer(obj)

# New code
obj = SomeObject()  # Direct reference
weak_ref = weakref.ref(obj)  # If weak reference is needed

Recyclebin

The Recyclebin functionality has been temporarily removed. Implement a basic alternative if needed:

Temporary Recyclebin alternative
# Old code (no longer available)
from true.utils import Recyclebin

recycler = Recyclebin()

# Temporary solution
class SimpleRecycleBin:
    def __init__(self):
        self._items = []

    def add(self, item):
        self._items.append(item)

    def restore(self, item):
        if item in self._items:
            self._items.remove(item)
            return item
        return None

Installation Updates

Update your dependencies to include the new packages:

# Remove old version
pip uninstall true-core

# Install new version and required packages
pip install true-core>=0.2.0
pip install true-enumeration true-types true-blobs

Common Issues

  1. Import Errors

    • Update all imports to use the new package names

    • Check for any missed imports in your codebase

    • Update your test imports as well

  2. Missing Components

    • If you were using Pointer, switch to Python’s reference system

    • If you were using Recyclebin, implement a temporary solution

  3. Version Conflicts

    • Ensure all new packages are installed

    • Check version compatibility

    • Update all packages together

Need Help?