Commit Graph

32 Commits

Author SHA1 Message Date
Daniel Johnson
ecdb045bcb Default LUTRIS_VERSION from lutris/__init__.py in AppImage build
Previously `make appimage` produced Lutris-dev-x86_64.AppImage unless the
caller remembered to set LUTRIS_VERSION. On a tagged release commit that
yielded a misleadingly-named artifact. Have build.sh awk the version out
of lutris/__init__.py when no explicit value is provided; an env override
(e.g. LUTRIS_VERSION=0.5.23-rc1 for a release candidate) still wins.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-11 17:15:30 -04:00
Daniel Johnson
053933a34c Add AppImage packaging proof-of-concept
Flathub's recent ban on AI-using projects (see #6724) puts Lutris's
Flatpak channel at risk, and Flatpak has always been an awkward fit
anyway: Lutris is fundamentally an unsandboxed game manager that needs
to call host xrandr, 7z, fuser, wine, flatpak, mount drives, and reach
the user's whole $HOME. AppImage gives us a single-file distribution
that does none of that sandboxing.

This adds `make appimage`, which builds a self-contained AppImage in
a Docker/Podman container based on Ubuntu 22.04 (glibc 2.35, Python
3.10, GTK3, WebKit2GTK 4.1). The pipeline:

  utils/appimage/build.sh          — host wrapper (docker or podman)
  utils/appimage/Dockerfile        — build env with all GI typelibs
  utils/appimage/build-in-container.sh
                                   — assembles AppDir via linuxdeploy
                                     + linuxdeploy-plugin-gtk, runs
                                     appimagetool
  utils/appimage/AppRun            — launcher; sources plugin-gtk hook,
                                     sets PYTHONPATH, execs bundled
                                     python3 with bin/lutris

Design notes worth flagging for review:

* The bundled Python is the build image's /usr/bin/python3.10 plus its
  stdlib, with tkinter/test/idle stripped.

* PyGObject and dbus-python are taken from apt (python3-gi, python3-dbus)
  rather than pip — both have switched to meson-python build backends
  that drag in a sizeable toolchain, and the prebuilt packages link
  against exactly the libgirepository/libdbus we already bundle from
  the same distro.

* AppRun deliberately does NOT export LD_LIBRARY_PATH. linuxdeploy
  already sets $ORIGIN-relative RPATH on every binary it deploys, and
  exporting LD_LIBRARY_PATH would leak into every host subprocess —
  which surfaced immediately when flatpak crashed loading our bundled
  libssl 3.0 instead of the host's 3.4. The build script patchelf's
  the RPATH on the manually-copied _gi.so / _dbus*.so so they still
  find the bundled libgirepository without the env override.

* PATH is left intact apart from prepending $APPDIR/usr/bin, so host
  tools (xrandr, 7z, wine, flatpak) still win — that's the whole
  point of choosing AppImage over Flatpak here.

Output is dist/Lutris-<version>-x86_64.AppImage at ~83 MB. Smoke-tested
end-to-end on Fedora 43 Nobara: boots GUI, GPU detection, DB load,
service auth, GTK theme, and host subprocess invocations all work.

Refs #6724.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-11 17:15:30 -04:00
Mathieu Comandon
64f7e7aa9e Remove clean_configs script 2026-04-07 12:25:47 -07:00
Mathieu Comandon
cf3dd08f78 Remove issuelocker script 2026-04-06 11:54:51 -07:00
Daniel Johnson
697fa22d23 Detect string literals in | union annotations (crashes Python <3.14)
`"Foo" | None` fails at runtime on Python 3.10–3.13 because str doesn't
implement __or__. This only works on 3.14+ where PEP 749 defers annotation
evaluation. Add a check for this pattern alongside the existing conditional
import check so we catch it before it reaches users.

Ref: https://github.com/lutris/lutris/pull/6595

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 07:16:30 -04:00
Daniel Johnson
444385decc check_annotations: detect all conditional imports, not just TYPE_CHECKING
Broaden the checker to flag unquoted annotations referencing any import
under an `if` or `try` block, not only `TYPE_CHECKING` guards. This
catches cases like try/except optional imports (e.g. GnomeDesktop) that
can be None at runtime and crash on dotted attribute access in eager
annotations.

Also fix dotted access check to cover `from X import Y` names used as
`Y.Attr` in annotations, not just `import X` modules.

Motivated by #6552 (fixed in 7019866).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 18:30:35 -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
Eikeno
9dd0254caa formatting fix
ruff related

[ticket: X]
2025-03-22 18:39:43 +01:00
Eikeno
1d40df3cf2 modify refs from ~/.config/lutris to ~/.local/share/lutris
Also make utils/clean_config use CONFIG_DIR from settings.py instead of
hardcoded ref.

1 typo fix
2025-03-22 18:30:29 +01:00
Mathieu Comandon
3866cf21bd Make lutris panic, crash and burn on key errors on DB game object because this should not be inconsistent 2024-04-07 15:18:26 -07:00
Mathieu Comandon
00652b9653 Improve prefix cleaner 2024-04-07 00:43:01 -07:00
Rafał Mikrut
5378de4060 Add CI checks for every commit 2024-02-28 16:27:06 -08:00
Mathieu Comandon
35e29e657c Sync categories to website 2024-02-26 22:56:20 -08:00
Mathieu Comandon
daa3eea2e9 Add issuelocker script 2024-02-26 17:53:56 -08:00
Mathieu Comandon
24f8fee432 Re-enable imports sorting 2024-02-24 21:14:32 -08:00
Mathieu Comandon
38fbe9f05e Ruff reformat 2024-02-24 21:02:06 -08:00
Mathieu Comandon
0934b014fe Remove libstrangle option 2024-01-31 10:31:45 -08:00
Mathieu Comandon
9952c97b4c Add clean_configs script 2024-01-27 13:36:12 -08:00
Mathieu Comandon
fedc9d857e Improvements to clean_prefix script 2023-06-06 21:31:26 -07:00
Mathieu Comandon
0879886ffc Reformat cleanup_prefix 2023-02-05 20:12:25 -08:00
Mathieu Comandon
4d3d04d4ec Minor adjustment to prefix scanner 2023-01-31 15:57:05 -08:00
Mathieu Comandon
40cd119aea Prefix scanning implementation 2023-01-31 13:21:40 -08:00
Daniel Johnson
77d00fefdc Move extract_icon to a more appropriate directory
./utils contains stand alone utility scripts; utility routines used
by wine seem to be in lutris/util/wine, so lets move this there.

I am hoping this will address issue #4529
2022-09-28 03:55:15 -04:00
Mathieu Comandon
5ee931679e Handle pefile not being installed 2022-09-26 20:26:56 -07:00
Fedi Takeli
f69a04b043 formatting 2022-09-26 20:16:42 -07:00
Fedi Takeli
363e5cba8e init - extract_icon 2022-09-26 20:16:42 -07:00
Maximiliano Sandoval R
f52a7308bf meson: Add post install scrip
Makes sure the icons and desktop file are installed
2022-04-11 14:09:21 -07:00
Alexander Ravenheart
f5e8e007b3 - Replaced pipenv with poetry
- Updated min version check in setup.py to Python 3.6
- Updated isort config file and calls to align with v5.x
- Added init-hook for gi imports in .pylintrc to avoid invalid no-member issues
- Makefile: added lock, show-tree, bandit, black, mypy; updated test, cover, dev, isort, autopep8, check, isort-check, flake8, pylint; removed req, requirements;
- Updated .travis.yml to use poetry and make
- Added my email in AUTHORS
- Updated CONTRIBUTING.md
- Updated lint_python.yml to use poetry and make, reorganized instructions to have all install related steps first
- sorted imports: lutris, lutris-wrapper, cleanup_prefix.py and multiple files in tests dir
2021-11-17 21:17:43 -08:00
Christian Clauss
e5652a0210 Placate flake8 2021-08-02 13:44:18 -07:00
Mathieu Comandon
85d5a32b06 Add prototype script for wine prefix cleanup 2021-05-24 18:24:06 -07:00
Mathieu Comandon
7e000f5cfa Add scanners package 2021-05-10 23:16:15 -07:00
Mathieu Comandon
663f1e5b62 Add a proof of concept for Retroarch ROM import 2021-04-25 16:08:16 -07:00