ni / nidaqmx-python

A Python API for interacting with NI-DAQmx
Other
440 stars 154 forks source link

nidaqmx: Fix mypy errors #523

Closed bkeryan closed 7 months ago

bkeryan commented 7 months ago

What does this Pull Request accomplish?

Enable running mypy on the actual nidaqmx package without errors. For details, see commits.

Update PR build workflow to run mypy on generated/nidaqmx.

Why should this Pull Request be merged?

Even without type hints, running mypy on the nidaqmx package can catch bugs, such as passing the wrong arguments to a function.

Running mypy on the nidaqmx package is a prerequisite for adding type hints.

Note

Adding type hints will force us to stop reassigning to parameters, like val = numpy.array(val, dtype=numpy.float64). These currently pass because they are untyped and thus are assumed to be typing.Any.

What testing has been done?

Ran poetry run pytest -v Ran poetry run mypy generated/nidaqmx and poetry run mypy tests

github-actions[bot] commented 7 months ago

Test Results

    30 files  ±0      30 suites  ±0   37m 31s :stopwatch: -26s  1 898 tests ±0   1 631 :white_check_mark: ±0    267 :zzz: ±0  0 :x: ±0  30 200 runs  ±0  26 280 :white_check_mark: ±0  3 920 :zzz: ±0  0 :x: ±0 

Results for commit d54ccebb. ± Comparison against base commit 5f3dd8f9.

:recycle: This comment has been updated with latest results.