Skip to content

Add typing_extensions as a main dependency#196

Merged
bkeryan merged 3 commits intomainfrom
users/mprosser/add-typing-extensions-dep
Sep 10, 2025
Merged

Add typing_extensions as a main dependency#196
bkeryan merged 3 commits intomainfrom
users/mprosser/add-typing-extensions-dep

Conversation

@mikeprosserni
Copy link
Copy Markdown
Contributor

@mikeprosserni mikeprosserni commented Sep 10, 2025

What does this Pull Request accomplish?

This adds an explicit dependency on typing_extensions.

Why should this Pull Request be merged?

When I tried to use the latest version of nitypes in the nidaqmx repo, I got this error when running tests with Python 3.11+:

.venv\Lib\site-packages\nitypes\waveform\_analog.py:8: in <module>
    from typing_extensions import TYPE_CHECKING, TypeVar, final, override
E   ModuleNotFoundError: No module named 'typing_extensions'

I think the upgrade to poetry 2.1 changed how the typing_extensions dependency works. For older versions of Python, it's still implicitly provided, but for the newer versions, it isn't. But since _analog.py is trying to import the typing_extensions module, I think it makes sense for nitypes to explicitly list it as a dependency so that is guaranteed to be available.

What testing has been done?

I'm hoping this change would fix the issue in nidaqmx without nidaqmx having to explicitly depend on typing_extensions, but I don't know how to test that before submitting this PR.

(Note: I went ahead and added the typing_extensions dependency to nidaqmx, so this PR isn't actually needed for that, although it might be a good idea regardless?)

@mikeprosserni mikeprosserni marked this pull request as ready for review September 10, 2025 21:19
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Sep 10, 2025

Test Results

    44 files  ±0      44 suites  ±0   22m 29s ⏱️ + 1m 18s
 2 190 tests ±0   2 190 ✅ ±0  0 💤 ±0  0 ❌ ±0 
49 738 runs  ±0  49 738 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit c0ed792. ± Comparison against base commit ccb12f3.

♻️ This comment has been updated with latest results.

@bkeryan
Copy link
Copy Markdown
Collaborator

bkeryan commented Sep 10, 2025

I think the upgrade to poetry 2.1 changed how the typing_extensions dependency works. For older versions of Python, it's still implicitly provided, but for the newer versions, it isn't.

If that happens, it's because one of dependencies conditionally depends on it. We can't rely on that.

The other reason it gets installed is for mypy and pyright.

mikeprosserni and others added 2 commits September 10, 2025 17:08
Co-authored-by: Brad Keryan <brad.keryan@ni.com>
@bkeryan bkeryan merged commit bf6f5a0 into main Sep 10, 2025
28 checks passed
@bkeryan bkeryan deleted the users/mprosser/add-typing-extensions-dep branch September 10, 2025 23:03
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