feat: file ops helpers for archive coupling (#9, #10, #11) #12

Merged
gravityfargo merged 1 commit from feat/file-ops-helpers into main 2026-05-03 14:47:49 +00:00
Owner

Summary

Adds three helpers requested by athena-archive-api #81 so the BE can route file ops through this library instead of bypassing it with raw pathlib calls.

  • ArchiveConfig.temp_dir + extended ensure_directories() (#10) — optional short-lived workspace separate from persistent storage_dir
  • FileWorker.from_bytes(target, data) (#11) — atomic write via .part + Path.replace; crash-safe (interrupt mid-write leaves no partial file at target)
  • FileWorker.delete() (#9) — unlink + bool result; documented as invalidating the worker

Bumps to 1.5.0 (additive surface, no breaking changes).

Verification

  • 247 tests pass (10 new)
  • make mypy clean
  • make lint unchanged from main (33 pre-existing TC errors, no new ones)

Test plan

  • CI green
  • Merge → make publish to push 1.5.0 to Forgejo PyPI
  • BE: uv lock --upgrade-package athena-file and start round 2

Closes #9
Closes #10
Closes #11

## Summary Adds three helpers requested by [athena-archive-api #81](https://code.modernleft.org/ModernLeft/athena-archive-api/issues/81) so the BE can route file ops through this library instead of bypassing it with raw pathlib calls. - **`ArchiveConfig.temp_dir`** + extended `ensure_directories()` (#10) — optional short-lived workspace separate from persistent `storage_dir` - **`FileWorker.from_bytes(target, data)`** (#11) — atomic write via `.part` + `Path.replace`; crash-safe (interrupt mid-write leaves no partial file at `target`) - **`FileWorker.delete()`** (#9) — `unlink` + `bool` result; documented as invalidating the worker Bumps to 1.5.0 (additive surface, no breaking changes). ## Verification - 247 tests pass (10 new) - `make mypy` clean - `make lint` unchanged from main (33 pre-existing TC errors, no new ones) ## Test plan - [ ] CI green - [ ] Merge → `make publish` to push 1.5.0 to Forgejo PyPI - [ ] BE: `uv lock --upgrade-package athena-file` and start round 2 Closes #9 Closes #10 Closes #11
Adds three helpers requested by athena-archive-api #81 to let the BE
route file ops through this library instead of bypassing it with raw
pathlib calls.

- ArchiveConfig.temp_dir + ensure_directories() (#10): optional short-
  lived workspace separate from persistent storage_dir
- FileWorker.from_bytes(target, data) (#11): atomic write via .part +
  Path.replace; crash-safe — interrupt mid-write leaves no partial
  file at target
- FileWorker.delete() (#9): unlink + bool result; documented as
  invalidating the worker

Bumps to 1.5.0 (additive surface, no breaking changes).
gravityfargo deleted branch feat/file-ops-helpers 2026-05-03 14:47:49 +00:00
Sign in to join this conversation.
No reviewers
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
ModernLeft/athena-file!12
No description provided.