← Back to team overview

launchpad-reviewers team mailing list archive

Re: [Merge] ~cjwatson/lpcraft:mypy into lpcraft:main

 

Currently the mypy check fails with ...

$ tox -e mypy 
GLOB sdist-make: /home/jugmac00/Projects/lpcraft/setup.py
mypy inst-nodeps: /home/jugmac00/Projects/lpcraft/.tox/.tmp/package/1/lpcraft-0.0.1.zip
mypy installed: appdirs==1.4.4,craft-cli @ git+git://github.com/canonical/craft-cli.git@4af19f9c0da733321dc754be1180aea28f3feeb1,lpcraft @ file:///home/jugmac00/Projects/lpcraft/.tox/.tmp/package/1/lpcraft-0.0.1.zip,mypy==0.910,mypy-extensions==0.4.3,pydantic==1.8.2,PyYAML==6.0,toml==0.10.2,typing-extensions==3.10.0.2
mypy run-test-pre: PYTHONHASHSEED='735124665'
mypy run-test: commands[0] | mypy lpcraft
lpcraft/main.py:9: error: Skipping analyzing "craft_cli": found module but no type hints or library stubs
lpcraft/tests/test_main.py:6: error: Skipping analyzing "craft_cli": found module but no type hints or library stubs
lpcraft/tests/test_main.py:6: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 2 errors in 2 files (checked 6 source files)
ERROR: InvocationError for command /home/jugmac00/Projects/lpcraft/.tox/mypy/bin/mypy lpcraft (exited with code 1)

This is nothing we can fix. I prepared a pull request upstream:
https://github.com/canonical/craft-cli/pull/35

Some more thoughts. I think we could drop the extensive configuration section where all checks are set to true and just run `mypy --strict`.

Also, while I also usually created a new `tox` env for `mypy`, it could be run as a `pre-commit` hook. At the end `mypy` is also a linter. I am fine with both ways. If you plan to do so, let's wait for upstream to merge my PR, otherwise `pre-commit` will fail, which would be quite annoying.
-- 
https://code.launchpad.net/~cjwatson/lpcraft/+git/lpcraft/+merge/411761
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/lpcraft:mypy into lpcraft:main.



References