-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Problem Description
While testing, I encountered a TypeError during pytest execution on my Python 3.9.21 environment.
The traceback indicates an inability to evaluate type annotations like str | None, which is syntax introduced in Python 3.10.
tests/conftest.py:16: in
from gitingest.query_parser import IngestionQuery
src/gitingest/__init__.py:4: in
from gitingest.entrypoint import ingest, ingest_async
# ... (truncated for brevity) ...
E TypeError: Unable to evaluate type annotation 'str | None'.
If you are making use of the new typing syntax (unions using `|` since Python 3.10
or builtins subscripting since Python 3.9), you should either replace the use of
new syntax with the existing `typing` constructs or install the `eval_type_backport`
package.This issue appears to stem from recent changes introduced in PR #329, specifically commit 2f447ae, where Python 3.10+ type hint syntax (e.g., str | None, tuple[str, ...]) was adopted. Here's an example
Questions & Proposed Actions
-
Python Version Support: Is the project officially dropping support for Python versions older than 3.10?
- If yes, I will update my local environment to Python 3.10+ to align with the new requirement.
- If no, I think these type hints should be reverted to their Python < 3.10 compatible forms (e.g.,
Optional[str],Tuple[str, ...]) to maintain broader compatibility.
-
Documentation Update: Regardless of the decision on Python version support, I believe the
README.mdshould be updated to clearly state the supported Python versions to prevent similar confusion for other contributors.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working