Writing all function signatures in Python#631
Conversation
|
Note, |
|
The |
jcfreeman2
left a comment
There was a problem hiding this comment.
This successfully builds as part of a test build from this morning, MYPYFD_DEV_260723_A9, and integration tests all pass (i.e., this doesn't break anything). Note that building it won't generate *.pyi files automatically since right now *.pyi file generation is only done as part of calls to daq_add_python_bindings - this will require some thought on the part of Software Coordination as to what to do about daq-cmake in this regard.
However, if I run pybind11-stubgen daqconf from the command line, I do see stubs/daqconf/__init__.pyi created, which I believe is what was intended.
|
Thank you for reviewing @jcfreeman2 Stub files are required when the source python code does not include type hinting, which is the case when we check against python code generated from The use of the static type checking on this code will require stub files, as the TLDR - if native python code is written with type hinting, no stub files will be required. Generally, python code generated through I am following DUNE-DAQ/daq-cmake#174 to see when I can merge in some of our |
Description
Prepares the repository for static type checking with
mypy. Thepy.typedfile is required to indicate that the code is ready for type checking, as per the PEP561 standards.Type of change
Testing checklist
dbt-build --unittest)pytest -s minimal_system_quick_test.py)dunedaq_integtest_bundle.sh)python -m pytest)pre-commit run --all-files)Comments here on the testing
Further checks
dbt-build --lint, and/or see https://dune-daq-sw.readthedocs.io/en/latest/packages/styleguide/)(Indicate issue here: # (issue))