Commit Graph

17 Commits

Author SHA1 Message Date
ItsAllAboutTheCode
80e6c46ee8 Fixed Lutris UnitTest when run on github
The primary causes of the issue is the manipulation of how the gog_cloud.py and gog_cloud_hooks.py was getting imported in UnitTest via the importlib mechanism. That seemed to have broken the resolution of paths to `lutris.services.*`.
As the GTK issues that it was trying to side step has been fixed at the `tests` root level, the workaround is no longer needed.

Additional changes have been added to help harden any potentially UnitTest environment and  circular import issues.
* Updated the github unit test run to use a virtual env to install the package dependencies and run the test
* Moved the imports of `lutris.services` subpackage to the method calls inside of the `__init__.py` script which will defer any potential circular imports until after the `lutris/services/__init__.py` script is fully imported.
2026-04-11 09:47:37 -05:00
ItsAllAboutTheCode
900904c4db Added unittest run to the static analysis workflow
Also updated the pre-commit hook to invoke the test as well.

Added a nose2 plugin that skip the Dialog test when running on CI
2026-03-24 10:42:47 -05:00
Daniel Johnson
ab7b53c287 Add system dependencies to Ruff CI job for pygobject-stubs
The ruff-checker job runs `make dev` which installs pygobject-stubs,
but unlike the mypy-checker job it was missing the required Ubuntu
packages (libcairo2-dev, etc.), causing the build to fail.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 09:28:59 -04:00
Daniel Johnson
ea743a236f Detect unquoted TYPE_CHECKING annotations that break on Python 3.10
Python 3.14 evaluates annotations lazily (PEP 649), so unquoted
annotations like `threading.Event` work even when `threading` is only
imported under TYPE_CHECKING. On Python 3.10, these annotations are
evaluated eagerly and raise NameError at import time.

Add utils/check_annotations.py, an AST-based checker that detects
unquoted annotations referencing TYPE_CHECKING-only imports, covering
both bare names (`HTTPResponse`) and dotted access (`threading.Event`)
— the latter being a gap in ruff's FA102 rule. Wire it into `make
annotation-compat`, `make check`, and a new CI job.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-01 16:12:14 -05:00
Sebastien Duthil
dd0f3c45ea ruff: fix code style check 2026-02-19 12:27:56 -08:00
ItsAllAboutTheCode
860c369a53 Updating the mypy Python version check to be 3.10
Both the github workflow action and the Makefile was updated to target Python 3.10.
This is to make sure that when locally running `make check`, it matches the result of the workflow.
2026-02-17 18:21:53 -08:00
ItsAllAboutTheCode
14a93a1178 Updated the Mypy static analysis to use Python 3.9 2026-02-17 16:00:18 -08:00
Mathieu Comandon
8909940042 Install gettext in po-checker CI job
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 14:59:43 -08:00
Mathieu Comandon
3e8d296e70 Fix broken translations and add .po validation to CI
Fix format string errors in ru.po and tr.po that caused ValueError
on Russian locale (fixes #6423). Add msgfmt --check to CI to catch
translation errors early.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 14:31:37 -08:00
Mathieu Comandon
8b8ebbb175 Add syntax compatibility check for older Python versions
Prevents issues like #6419 where PEP 701 f-string syntax valid on
Python 3.12+ causes SyntaxError on older versions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 14:21:41 -08:00
Sebastien Duthil
609135bca6 github actions: make mypy check for Python 3.8 typing syntax 2026-02-16 13:29:02 -08:00
Zebra2711
cf3ee38071 update girepository dev for CI
Update dependency to libgintrospection2.0-dev for PyGObject 3.51.0 compatibility
2025-03-12 22:00:00 +07:00
Mathieu Comandon
3cfacbc8d1 Add Cairo dev for CI 2024-12-28 11:43:01 -08:00
Mathieu Comandon
ffda685490 Add cairo to Ubuntu deps, use Python 3.12 for CI 2024-12-28 11:43:01 -08:00
Zitrone
6c9e01d124 remove last ruff format error and update workflow to fail on unformatted files 2024-08-11 13:55:26 -06:00
Rafał Mikrut
5378de4060 Add CI checks for every commit 2024-02-28 16:27:06 -08:00
Rafał Mikrut
6bf2af7efc Use ruff for formatting and code checking 2024-01-15 23:49:10 +01:00