Skip to content

Conversation

@bkeryan
Copy link
Collaborator

@bkeryan bkeryan commented May 2, 2025

What does this Pull Request accomplish?

Add redirection/stubs for more of the standard typing module.

Hide _typing.py from documentation generation by importing it as a fallback for ImportError:

try:
    from typing import TypeAlias
except ImportError:
    from nitypes._typing import TypeAlias

As far as the doc tools are concerned, we're using the standard Python typing module directly.

Update check_docs.yml to use Python 3.13.3, for the latest typing module.

Why should this Pull Request be merged?

Stop thinking about _typing

What testing has been done?

poetry run nps lint, mypy, pytest -v
Generated docs and inspected type aliases.

@github-actions
Copy link
Contributor

github-actions bot commented May 2, 2025

Test Results

0 files   -    10  0 suites   - 10   0s ⏱️ -24s
0 tests  -   511  0 ✅  -   511  0 💤 ±0  0 ❌ ±0 
0 runs   - 5 110  0 ✅  - 5 110  0 💤 ±0  0 ❌ ±0 

Results for commit 7148b85. ± Comparison against base commit 10bdfbe.

♻️ This comment has been updated with latest results.

@bkeryan bkeryan changed the title _typing: Redirect more typing classes _typing: Redirect more typing classes and hide _typing from doc gen May 5, 2025
@bkeryan
Copy link
Collaborator Author

bkeryan commented May 5, 2025

docs before:
image

docs after:
image

@bkeryan
Copy link
Collaborator Author

bkeryan commented May 5, 2025

Hide _typing.py from documentation generation by importing it as a fallback for ImportError:

try:
    from typing import TypeAlias
except ImportError:
    from nitypes._typing import TypeAlias

This fixes the documentation generation but it breaks mypy due to https://www.github.com/python/mypy/issues/14220

@bkeryan bkeryan closed this May 5, 2025
@bkeryan bkeryan deleted the users/bkeryan/more-typing branch June 7, 2025 00:21
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.

2 participants