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
# 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
# Old imports
from true.types import CustomType, TypeValidator
# New imports
from true_types import CustomType, TypeValidator
File Handling
# 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:
# 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:
# 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
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
Missing Components
If you were using
Pointer, switch to Python’s reference systemIf you were using
Recyclebin, implement a temporary solution
Version Conflicts
Ensure all new packages are installed
Check version compatibility
Update all packages together
Need Help?
Check the full Release Notes for Version 0.2.0 and Changelog for Version 0.2.0 notes
- Visit the new package documentation sites:
Report issues on the respective GitHub repositories
Join our community discussions