Skip to content

Conversation

@27Bslash6
Copy link
Contributor

Summary

  • Replace os.uname().nodename with platform.node()
  • os.uname() doesn't exist on Windows, breaking all imports

Test plan

  • Verified from cachekit import cache works on Windows
  • CI should pass on all platforms

Fixes #43

ArrowSerializer was unconditionally imported at module load time,
causing ImportError for users who install cachekit without the
[data] extra (pyarrow).

Changes:
- Remove top-level ArrowSerializer import
- Add lazy loading via _get_arrow_serializer() helper
- Use __getattr__ for lazy attribute access
- Update SERIALIZER_REGISTRY to use None placeholder
- Fix benchmark_serializers and get_serializer_info to handle
  lazy loading gracefully

Users can now:
- pip install cachekit and use default serializers
- pip install cachekit[data] to enable ArrowSerializer

Fixes #41
os.uname() is not available on Windows, causing ImportError when
importing cachekit. platform.node() is cross-platform and provides
the same hostname information.

Fixes #43
@codecov
Copy link

codecov bot commented Jan 13, 2026

Codecov Report

❌ Patch coverage is 34.78261% with 15 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/cachekit/serializers/__init__.py 28.57% 14 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Windows import fails - os.uname() not available

2 participants