Fix Python Bindings Arc Ownership Issues - Socket-First Approach Recommended #4

Open
opened 2026-05-01 18:51:53 +02:00 by kade · 0 comments
Owner

Fix Python Bindings Arc Ownership Issues

Current Status

  • mappy-python fails to compile (17 type annotation errors)
  • Socket client works perfectly as alternative
  • Forgejo-client integration ready with fallbacks

Root Cause

mappy-core methods consume Arc by value, but Python bindings call on shared references. Applied initial Arc cloning fixes, but type annotation issues remain.

Required Fixes

  1. Type Annotations: Add explicit as Arc for engine methods
  2. Maplet Types: May need explicit type annotations for complex maplet variants
  3. Testing: Verify Python import and forgejo-client integration

Since socket client already works, consider making it the primary interface:

  • No compilation issues
  • Better service architecture
  • Production ready
  • Immediate solution available
  • Requires running mappy service

Files to Fix

  • services/mappy/mappy-python/src/lib.rs - Type annotation fixes

Success Criteria

  1. cargo build --package mappy-python succeeds
  2. from mappy_core import MappyCache works in Python
  3. Forgejo-client shows mappy_available: True

Strategic Recommendation

Primary: Deploy mappy service + use socket client (2-3 hours, working today)
Secondary: Fix Python bindings (3-6 hours, development enhancement)

## Fix Python Bindings Arc Ownership Issues ### Current Status - ❌ **mappy-python** fails to compile (17 type annotation errors) - ✅ **Socket client** works perfectly as alternative - ✅ **Forgejo-client** integration ready with fallbacks ### Root Cause mappy-core methods consume Arc<Self> by value, but Python bindings call on shared references. Applied initial Arc cloning fixes, but type annotation issues remain. ### Required Fixes 1. **Type Annotations**: Add explicit as Arc<Engine> for engine methods 2. **Maplet Types**: May need explicit type annotations for complex maplet variants 3. **Testing**: Verify Python import and forgejo-client integration ### Alternative: Socket-First Approach (RECOMMENDED) Since socket client already works, consider making it the primary interface: - ✅ No compilation issues - ✅ Better service architecture - ✅ Production ready - ✅ Immediate solution available - ❌ Requires running mappy service ### Files to Fix - services/mappy/mappy-python/src/lib.rs - Type annotation fixes ### Success Criteria 1. cargo build --package mappy-python succeeds 2. from mappy_core import MappyCache works in Python 3. Forgejo-client shows mappy_available: True ### Strategic Recommendation **Primary**: Deploy mappy service + use socket client (2-3 hours, working today) **Secondary**: Fix Python bindings (3-6 hours, development enhancement)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kade/mappy#4
No description provided.