DiamondLightSource / tickit

Event-based hardware simulation framework
Apache License 2.0
7 stars 0 forks source link

Mypy errors in master #145

Closed rosesyrett closed 1 year ago

rosesyrett commented 1 year ago

Overview

In a CI job for #144 I noticed lots of mypy errors originating from click.

Seems like click had a recent release on the 6th of July that have caused this issue. pre-commit has been notified of this: issue:https://github.com/pallets/click/issues/2558

Solution

Perhaps pinning click to the previous stable version, i.e. 8.1.3 for now.

Steps to reproduce

tox -e pre-commit,mypy

Output

pre-commit installed: accessible-pygments==0.0.4,aioca==1.7,aiohttp==3.8.4,aiokafka==0.8.1,aiosignal==1.3.1,aiozmq==1.0.0,alabaster==0.7.13,apisc hema==0.16.1,async-timeout==4.0.2,attrs==23.1.0,Babel==2.12.1,beautifulsoup4==4.12.2,black==23.3.0,certifi==2023.5.7,cfgv==3.3.1,charset-normalizer==3.2.0,click==8.1.4,colorama==0.4.6,coverage==7.2.7,distlib==0.3.6,docutils==0.19,epicscorelibs==7.0.7.99.0.2,epicsdbbuilder==1.5,exceptiongroup==1.1.2,filelock==3.12.2,flake8==6.0.0,flake8-isort==6.0.0,Flake8-pyproject==1.2.3,frozenlist==1.3.3,identify==2.5.24,idna==3.4,imagesize==1.4.1,immutables==0.19,iniconfig==2.0.0,isort==5.12.0,Jinja2==3.1.2,kafka-python==2.0.2,livereload==2.6.3,MarkupSafe==2.1.3,mccabe==0.7.0,mock==5.0.2,multidict==6.0.4,mypy==1.4.1,mypy-extensions==1.0.0,nodeenv==1.8.0,numpy==1.25.1,packaging==23.1,pathlib2==2.3.7.post1,pathspec==0.11.1,pipdeptree==2.9.4,platformdirs==3.8.1,pluggy==1.2.0,pre-commit==3.3.3,pvxslibs==1.2.2,py==1.11.0,pycodestyle==2.10.0,pydata-sphinx-theme==0.13.3,pydocstyle==6.3.0,pyflakes==3.0.1,Pygments==2.15.1,pytest==7.4.0,pytest-asyncio==0.21.0,pytest-black==0.3.12,pytest-cov==4.1.0,pytest-flake8==1.1.1,pytest-mypy==0.10.3,pytest-pydocstyle==2.3.2,PyYAML==6.0,pyzmq==25.1.0,requests==2.31.0,setuptools-dso==2.9,six==1.16.0,snowballstemmer==2.2.0,softioc==4.4.0,soupsieve==2.4.1,Sphinx==6.2.1,sphinx-autobuild==2021.3.14,sphinx-copybutton==0.5.2,sphinx_design==0.4.1,sphinxcontrib-applehelp==1.0.4,sphinxcontrib-devhelp==1.0.2,sphinxcontrib-htmlhelp==2.0.1,sphinxcontrib-jsmath==1.0.1,sphinxcontrib-qthelp==1.0.3,sphinxcontrib-serializinghtml==1.1.5,-e git+https://github.com/dls-controls/tickit.git@c8e0fbdb06c423589d4c2a4b18cfccfbdfca8878#egg=tickit,toml==0.10.2,tomli==2.0.1,tornado==6.3.2,tox==3.28.0,tox-direct==0.4,types-mock==5.0.0.7,types-PyYAML==6.0.12.10,typing_extensions==4.7.1,urllib3==2.0.3,virtualenv==20.23.1,yarl==1.9.2 pre-commit run-test-pre: PYTHONHASHSEED='1140261700' pre-commit run-test: commands[0] | pre-commit run --all-files Check for added large files..............................................Passed Check Yaml...............................................................Passed Check for merge conflicts................................................Passed Run black................................................................Passed Run flake8...............................................................Passed mypy installed: accessible-pygments==0.0.4,aioca==1.7,aiohttp==3.8.4,aiokafka==0.8.1,aiosignal==1.3.1,aiozmq==1.0.0,alabaster==0.7.13,apischema== 0.16.1,async-timeout==4.0.2,attrs==23.1.0,Babel==2.12.1,beautifulsoup4==4.12.2,black==23.3.0,certifi==2023.5.7,cfgv==3.3.1,charset-normalizer==3.2.0,click==8.1.4,colorama==0.4.6,coverage==7.2.7,distlib==0.3.6,docutils==0.19,epicscorelibs==7.0.7.99.0.2,epicsdbbuilder==1.5,exceptiongroup==1.1.2,filelock==3.12.2,flake8==6.0.0,flake8-isort==6.0.0,Flake8-pyproject==1.2.3,frozenlist==1.3.3,identify==2.5.24,idna==3.4,imagesize==1.4.1,immutables==0.19,iniconfig==2.0.0,isort==5.12.0,Jinja2==3.1.2,kafka-python==2.0.2,livereload==2.6.3,MarkupSafe==2.1.3,mccabe==0.7.0,mock==5.0.2,multidict==6.0.4,mypy==1.4.1,mypy-extensions==1.0.0,nodeenv==1.8.0,numpy==1.25.1,packaging==23.1,pathlib2==2.3.7.post1,pathspec==0.11.1,pipdeptree==2.9.4,platformdirs==3.8.1,pluggy==1.2.0,pre-commit==3.3.3,pvxslibs==1.2.2,py==1.11.0,pycodestyle==2.10.0,pydata-sphinx-theme==0.13.3,pydocstyle==6.3.0,pyflakes==3.0.1,Pygments==2.15.1,pytest==7.4.0,pytest-asyncio==0.21.0,pytest-black==0.3.12,pytest-cov==4.1.0,pytest-flake8==1.1.1,pytest-mypy==0.10.3,pytest-pydocstyle==2.3.2,PyYAML==6.0,pyzmq==25.1.0,requests==2.31.0,setuptools-dso==2.9,six==1.16.0,snowballstemmer==2.2.0,softioc==4.4.0,soupsieve==2.4.1,Sphinx==6.2.1,sphinx-autobuild==2021.3.14,sphinx-copybutton==0.5.2,sphinx_design==0.4.1,sphinxcontrib-applehelp==1.0.4,sphinxcontrib-devhelp==1.0.2,sphinxcontrib-htmlhelp==2.0.1,sphinxcontrib-jsmath==1.0.1,sphinxcontrib-qthelp==1.0.3,sphinxcontrib-serializinghtml==1.1.5,-e git+https://github.com/dls-controls/tickit.git@c8e0fbdb06c423589d4c2a4b18cfccfbdfca8878#egg=tickit,toml==0.10.2,tomli==2.0.1,tornado==6.3.2,tox==3.28.0,tox-direct==0.4,types-mock==5.0.0.7,types-PyYAML==6.0.12.10,typing_extensions==4.7.1,urllib3==2.0.3,virtualenv==20.23.1,yarl==1.9.2 mypy run-test-pre: PYTHONHASHSEED='1140261700' mypy run-test: commands[0] | mypy src tests src/tickit/core/management/schedulers/master.py:91: note: By default the bodies of untyped functions are not checked, consider using --check-unty ped-defs [annotation-unchecked] src/tickit/cli.py:14: error: Argument 1 has incompatible type "Callable[[str], Any]"; expected [arg-type] src/tickit/cli.py:33: error: has no attribute "get_help" [attr-defined] src/tickit/cli.py:36: error: Argument 1 has incompatible type "Callable[[str, str, str], None]"; expected [arg-type] src/tickit/cli.py:36: error: has no attribute "command" [attr-defined] src/tickit/cli.py:54: error: Argument 1 has incompatible type "Callable[[str, str], None]"; expected [arg-type] src/tickit/cli.py:54: error: has no attribute "command" [attr-defined] src/tickit/cli.py:70: error: Argument 1 has incompatible type "Callable[[str, str], None]"; expected [arg-type] src/tickit/cli.py:70: error: has no attribute "command" [attr-defined] src/tickit/main.py:5: error: not callable [misc] tests/adapters/interpreters/command/test_command_interpreter.py:25: note: By default the bodies of untyped functions are not checked, consider us ing --check-untyped-defs [annotation-unchecked] tests/conftest.py:20: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecke d] tests/conftest.py:39: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs [annotation-unchecke d] Found 9 errors in 2 files (checked 94 source files) ERROR: InvocationError for command /venv/bin/mypy src tests (exited with code 1) ____ summary ____ pre-commit: commands succeeded ERROR: mypy: commands failed

tpoliaw commented 1 year ago

Can we unpin click after the latest release?