cockpit
cockpit copied to clipboard
Run mypy on testlib.py
This is just a PR to add mypy for testlib.py and make it pass. The typing in testlib.py is not complete yet.
In the future we can lint src/cockpit but that is actually quite trivial.
@allisonkarlitskaya argggh so the issue is:
drwxr-xr-x 2 root root 4.0K Aug 16 15:46 builder
And builder tries to write config.log in the previous image it was:
builder@175cc8c22bf2:~$ ls -lh /home/
total 0
drwxr-xr-x 1 builder nogroup 0 Jul 24 22:06 builder
So yay debian changed adduser in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=679746
Proof mypy works https://github.com/cockpit-project/cockpit/runs/7878382609?check_suite_focus=true
Wondering if check-memory failing on clang is https://bugs.kde.org/show_bug.cgi?id=452758
I wonder if you want to first try getting this working with
systemd_ctypesas a practice run?
Sounds good, also an excellent time to figure out how the library stub files should be shipped :-)
This has diverged too much, needs rework. We have a pyproject.toml now and run mypy on src. Just not on test/common this currently fails:
[jelle@t14s][~/projects/cockpit/main]%mypy test/common
test/common/lcov.py:35: error: Cannot find implementation or library stub for module named "task" [import]
test/common/lcov.py:35: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
test/common/testlib.py: error: Source file found twice under different module names: "test.common.testlib" and "testlib"
test/common/testlib.py: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#mapping-file-paths-to-modules for more info
test/common/testlib.py: note: Common resolutions include: a) adding `__init__.py` somewhere, b) using `--explicit-package-bases` or adjusting MYPYPATH
Found 2 errors in 2 files (errors prevented further checking)