Skip to content

Conversation

@pablotoledo
Copy link
Owner

@pablotoledo pablotoledo commented Jan 14, 2025

Pull Request Summary

This PR introduces the following changes:


1. Dependencies and Configuration

  • Updated:
    • .github/workflows/test.yml:
      • Changed pip install commands to use pip install ".[dev]" for installing development dependencies.
      • Retained pytest execution with -p no:warnings.
    • poetry.lock:
      • Adjusted several dependencies (black, isort, mypy, pypdf, packaging, platformdirs, etc.) to be part of the [tool.poetry.group.dev.dependencies] group.
    • pyproject.toml:
      • Migrated dependencies to [tool.poetry.dependencies] and [tool.poetry.group.dev.dependencies] for better separation of main and dev dependencies.
      • Added isort configuration for consistent import sorting.

2. Code Changes

  • Enhancements:
    • error_handling.py:
      • Introduced print_error function for safer error printing with fallback support.
    • __init__.py:
      • Included print_error in module exports.
    • cli.py:
      • Added detailed help text and examples for the readium command.
      • Enhanced output option description for clarity.
      • Integrated print_error for consistent error handling.
      • Add error handling for unprintable content in CLI output
    • core.py:
      • Improved type hinting with overload and more specific type annotations.
      • Enhanced error handling and debug logging for file processing.

3. Tests

  • New Unit Tests:
    • test_cli.py:
      • Validated CLI help text, examples, and the inclusion of the output option.
    • test_error_handling.py:
      • Tested print_error function under various scenarios (normal text, rich markup, fallback).
  • Updates:
    • test_basic.py:
      • Removed an obsolete comment in a basic test.

Notes

This update improves dependency management, adds new functionality for safer error handling, and enhances developer and user experiences through additional documentation and robust testing.

@pablotoledo pablotoledo merged commit ede512a into main Jan 14, 2025
3 checks passed
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.

Fix error display when error messages contain rich-markup-like content

2 participants