-
-
Notifications
You must be signed in to change notification settings - Fork 696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add separate workflow for type checking #4872
base: master
Are you sure you want to change the base?
Conversation
Pre-commit runs a different mypy version maybe? |
Nvm looks like the same version |
@jwijenbergh so, the problem is actually that our pre-commit hook isn't working properly. It's running in a virtual environment that doesn't have multiple packages installed ( If we add these to the environment then we actually see the errors! |
240ae31
to
bd47275
Compare
We have reports of the stack trace: [ 1845s] Checking Qtile config at: /tmp/tmpmddmh3ov/config.py [ 1845s] Checking if config is valid python... [ 1845s] Traceback (most recent call last): [ 1845s] File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/scripts/check.py", line 122, in check_config [ 1845s] config.load() [ 1845s] File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/confreader.py", line 134, in load [ 1845s] config = importlib.import_module(name) [ 1845s] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [ 1845s] File "/usr/lib64/python3.11/importlib/__init__.py", line 126, in import_module [ 1845s] return _bootstrap._gcd_import(name[level:], package, level) [ 1845s] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [ 1845s] File "<frozen importlib._bootstrap>", line 1204, in _gcd_import [ 1845s] File "<frozen importlib._bootstrap>", line 1176, in _find_and_load [ 1845s] File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked [ 1845s] File "<frozen importlib._bootstrap>", line 690, in _load_unlocked [ 1845s] File "<frozen importlib._bootstrap_external>", line 940, in exec_module [ 1845s] File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed [ 1845s] File "/tmp/tmpmddmh3ov/config.py", line 10, in <module> [ 1845s] tb.set_font(fontsize=12) [ 1845s] File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/widget/base.py", line 733, in set_font [ 1845s] self.bar.draw() [ 1845s] ^^^^^^^^ [ 1845s] File "/home/abuild/rpmbuild/BUILD/qtile-0.26.0/libqtile/command/base.py", line 281, in __getattr__ [ 1845s] raise AttributeError(f"{self.__class__} has no attribute {name}") [ 1845s] AttributeError: <class 'libqtile.widget.textbox.TextBox'> has no attribute bar the problem here is that the test actually calls set_font() when imported, which we can't do since we haven't actually configured a bar yet. This is part of qtile#4868 and suggests that we are somehow not running the migration tests correctly in our CI. Signed-off-by: Tycho Andersen <[email protected]>
Ok, I pushed my patch to your branch, but I'm actually wondering if we shouldn't run
for e.g. the tests in remove_command_prefix.py, after I add the obvious We could go through and make all the configs not actually call qtile.spawn() like I did in my patch, but I'd rather land something quickly so we can get these tests passing for packaging folks, and it looked like a fair amount of work to change everything. it makes me wonder though: what happens if people have naked |
That example above should not be run. The |
I don't think this branch is enough, then. The at least one failure from #4868 was a Check test. I think we need tests of that file to pass (i.e. we have to run it in CI and make whatever it runs pass) so that it will work when people run the tests as part of packaging. |
The Could be a mistake in how I've set up the tests so I'll take a look later. |
The change tests are all skipped because the normal environment doesn't ship mypy; when I added it in #4869 we started getting the same failures that packagers do. |
Then I need to fix that. Change tests shouldn't need mypy. |
Maybe it's as simple as:
to reproduce, then? |
but |
I don't think |
i see, ok, that's the bit i was missing. |
This PR is stale because it has been open 90 days with no activity. Remove the |
This would be my preferred way for running our mypy-dependent tests. However, I've no idea why mypy is failing (before even running the specific tests) but our
pre-commit
script shows no mypy errors.