Skip to content

chore: update docs for system-wide installation and expand test coverage

Ahlad Pataparla requested to merge chore/tool-install into develop

Summary

This MR updates project documentation to reflect modern installation workflows (global uv tool install) and significantly expands test coverage across the CLI codebase.

Changes

Documentation

  • README.md & docs/user-manual.md
    • Added system-wide installation instructions via uv tool install and pipx
    • Added development installation section with uv sync
    • Updated all command examples from uv run corpus-client … to corpus-client …
    • Added new corpus-client status command to the reference list
    • Added step-by-step record upload guide
    • Expanded FAQ with common questions (multiple directories, file size limits, non-interactive credentials)

Bug Fix

  • src/corpus_client_cli/job.py
    • Fixed Python 2-style exception tuple syntax (except A, B:except (A, B):)

Code Quality

  • src/corpus_client_cli/upload.py
    • Minor line-length formatting fix

Test Coverage

  • tests/test_extracted_text_upload.py

    • ExtractedTextState edge cases (load errors, legacy log, save failures)
    • parse_dots_ocr edge cases (footer, image caption/footnote strings, empty text, reading order)
    • GeneralizedExtractedTextUploader tests (409 response, non-200 errors, generic exceptions)
  • tests/test_output.py (new file)

    • Tests for output() JSON and non-JSON modes
    • Tests for log() stderr output
  • tests/test_retry_logic.py

    • with_retry edge cases (non-tuple results, exhausted retries, zero max retries)
    • format_error_payload comprehensive tests (strings, lists, dicts, validation errors)
    • _format_validation_item tests
    • read_response_payload and read_error_message async tests
  • tests/test_s3_upload.py

    • upload_single_shot tests (non-list category IDs, error responses, exceptions)
    • process_file tests (chunk failure, finalize failure, exception with cleanup)
    • UploadState tests (job path restore, progress log exception handling)
    • finalize_upload response payload error handling
  • tests/test_upload.py

    • resolve_file_pattern tests (no pattern, extensions, recursive glob)
    • ProgressTracker tests
    • process_file tests (not found, validation fails, finalize fails, success path)
  • tests/test_upload_state.py

    • Load with progress log, save throttling, force save, corrupted log handling, append log errors
  • tests/test_validation_fail_fast.py

    • Extensive validation helper tests (_normalize_mime_type, _words, _looks_like_repeated_characters, _size_limits_for_media_type, _guess_mime_type)
    • validate_title, validate_description, validate_source_fields, validate_release_rights, validate_coordinates, validate_inline_text_content tests
    • validate_file_before_upload edge cases (OSError, size limits, MIME detection, duration checks)
Edited by Ahlad Pataparla

Merge request reports

Loading