AI-generated support for collations - #5
Merged
Merged
Conversation
…arches This commit implements comprehensive collation support for text searches and sorting in the icalendar-searcher library. Key features: - Simple API: case_sensitive parameter for add_property_filter() and add_sort_key() - Power user API: Collation enum with BINARY, CASE_INSENSITIVE, UNICODE, and LOCALE - Optional PyICU integration for advanced Unicode/locale-aware collation - Collation support for all text properties and CATEGORIES - Graceful fallback when PyICU is not installed Breaking change: - Default text search behavior is now case-sensitive (was case-insensitive) - Use case_sensitive=False to restore previous behavior All 141 tests pass, including 18 new tests for collation features. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add PyICU as development dependency for testing - Replace runtime PyICU checks with proper mocked tests - Add tests that skip when PyICU is installed (using pytest.skipif) - Add tests that mock HAS_PYICU=False to test error handling - Simplify ICU substring matching (remove unused collator variable) - Add proper assertions for CollationError messages - Fix ruff issues (unused variables, import ordering) All 142 tests pass (2 skipped when PyICU not installed). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This allows using the modern | syntax for type hints while maintaining compatibility with Python 3.9 (which requires-python >= 3.9). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Convert Union[X, Y] to X | Y syntax and remove string quotes from type annotations. These changes are Python 3.9 compatible thanks to 'from __future__ import annotations'. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Member
Author
|
I ran |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Actually, the use-case was just to be able to do case-insensitive filtering. Then I came to think that we should have good collation-support too. I considered that part to be done faster and better by the AI than what I could do myself - but all the changes have been reviewed and curated by me (the human).