Skip to content

Fix packaging bug: include generated sync code in wheel (v1.0.6)#803

Merged
abrookins merged 1 commit intomainfrom
fix/packaging-bug-1.0.6
Jan 30, 2026
Merged

Fix packaging bug: include generated sync code in wheel (v1.0.6)#803
abrookins merged 1 commit intomainfrom
fix/packaging-bug-1.0.6

Conversation

@abrookins
Copy link
Collaborator

Summary

Fixes the packaging bug in v1.0.5 where the redis_om (sync) module only contained __init__.py but no other files.

Root Causes

  1. Hatchling respects .gitignore by default: The .gitignore file has redis_om/* (with exceptions for placeholder files). When make sync generates the sync code during CI, hatchling excluded those files from the wheel because they're gitignored.

  2. supports_hash_field_expiration() bug: The function checks redis_lib.asyncio.Redis.hexpire in both async and sync versions. The sync version should check redis_lib.Redis.hexpire instead.

Changes

pyproject.toml

Added artifacts option to include generated files that are in .gitignore:

[tool.hatch.build.targets.wheel]
artifacts = ["redis_om/**/*", "tests_sync/**/*"]

[tool.hatch.build.targets.sdist]
artifacts = ["redis_om/**/*", "tests_sync/**/*"]

make_sync.py

Added post-processing to fix the supports_hash_field_expiration() function by replacing redis_lib.asyncio.Redis with redis_lib.Redis in the generated sync code.

Verification

  • Built wheel now includes all files in both aredis_om/ and redis_om/
  • All async and sync tests pass
  • supports_hash_field_expiration() works correctly in both modules

- Add artifacts option to pyproject.toml so hatchling includes redis_om/
  files that are in .gitignore (generated by make sync)
- Fix supports_hash_field_expiration() to check sync Redis class in
  generated sync code via post-processing in make_sync.py
- Bump version to 1.0.6
@abrookins abrookins force-pushed the fix/packaging-bug-1.0.6 branch from ee6332b to 94e464a Compare January 30, 2026 22:24
@abrookins
Copy link
Collaborator Author

This was a fallout from the move to uv and hatchling, I believe.

@abrookins abrookins merged commit 43a7d49 into main Jan 30, 2026
16 checks passed
@abrookins abrookins deleted the fix/packaging-bug-1.0.6 branch January 30, 2026 22:35
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.

1 participant