Commit Graph

112 Commits

Author SHA1 Message Date
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
Daniel Johnson
64149e9f38 Fix incorrect mypy version in pyproject.toml (this is overridden in the Makefile but may matter for other uses) and fix a type-o in the Makefile. 2026-03-24 06:00:47 -04:00
ItsAllAboutTheCode
ae512b30b5 Pin the pygobject-stubs package to be at minimum 2.17.0
Unpinned PyPi packages aren't upgraded by pip unless the `--upgrade` argument is supplied.
2026-03-22 17:25:03 -05:00
ItsAllAboutTheCode
03da7ba267 Add git hooks to verify static anaylsis checks are run
The hooks run the `mypy`, `ruff` and the check_annotation.py script to verify that python files are in a valid state.

Caveat: In order to have the hooks run on the client, the contributor must run `make dev` or `make install-hooks` in their environment at least once to install the hooks.
The hooks are initially in the `.hooks/` directory, but need to be in `.git/hooks` to run.
However due to the `.git` directory not being part of the git repo, the `.git/hooks` directory can't be under source control.
See [Customizing Git - Git Hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) page about Client-Side Hooks

fixes #6539
2026-03-12 23:11:38 +00: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
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
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
Mathieu Comandon
9e7f529003 Install pygobject-stubs 2025-06-28 18:09:37 -07:00
Mathieu Comandon
817244447f Update mypy 2025-06-28 17:47:58 -07:00
Mathieu Comandon
8ff910d863 Update ruff version 2025-06-28 17:45:37 -07:00
Mathieu Comandon
7a10f9e2d2 Update version of ruff in Makefile 2024-04-01 23:52:18 -07:00
Mathieu Comandon
99567b8057 Add import fixing to ruff format 2024-03-21 22:34:46 -07:00
Mathieu Comandon
2c9d12337d Update Makefile 2024-02-24 21:01:38 -08:00
Rafał Mikrut
6bf2af7efc Use ruff for formatting and code checking 2024-01-15 23:49:10 +01:00
Mathieu Comandon
a892d08f63 Update CONTRIBUTING and INSTALL 2024-01-07 20:33:04 -08:00
Mathieu Comandon
6fc6d9512a Add mypy to checks 2023-08-26 01:07:48 -07:00
Alex Lowe
9f466f49ec Sample mypy configuration (with baselines)
This was brought up by discussion in #4866 about
use of type annotations - here's how I'd handle mypy
to hopefully have it provide utility without causing
headaches.
2023-08-26 00:16:44 -07:00
Mathieu Comandon
555daa3c7b Try with non quoted passphrase (quoted in secrets) 2023-05-16 13:12:20 -07:00
Mathieu Comandon
3a2cb3c311 Add build dependencies in Makefile 2023-05-11 19:38:09 -07:00
Mathieu Comandon
0cc1885620 Add Makefile target to create unsigned package 2023-02-05 11:24:43 -08:00
Amy Gauna
bd9aef3aad Update Publish Lutris PPA Workflow
* Split the workflow out into a reusable workflow.
* Call the release PPA workflow only on GitHub release publications.
* Call the staging PPA workflow on all GitHub release & prerelease publications.
* Clean up comments, and make them a bit more consistent.
* Add autoincrement logic to the PPA version number when the version we're building already exists on the target PPA.
* Build Lunar and Kinetic packages on Jammy since GitHub only has LTS Ubuntu runners.
2023-01-04 11:44:01 -08:00
Amy Gauna
b37661911c Initial commit of publish PPA GitHub workflow.
- Adds a new GitHub workflow that triggers on published releases.
- Adds a supporting Bash script to facilitate the building and signing process.
- Adds a new directive to the Makefile for passing a GPG key id to the make process through environment variables.
2022-12-12 20:34:51 -08:00
Mathieu Comandon
7b07394214 Add pytest to dev dependencies 2022-05-23 20:57:20 -07:00
Mathieu Comandon
bb4b6ed147 Remove poetry 2022-05-23 19:35:17 -07:00
Mathieu Comandon
facc296014 Refactor / cleanup vdf related code 2022-03-15 21:10:33 -07:00
Mathieu Comandon
cdb27283f5 Merge branch 'master' into nix-fixes 2021-12-14 15:43:02 -08:00
tannisroot
382a3213cb Update to nose2 2021-12-14 08:40:05 +03:00
Mathieu Comandon
768ca31a32 Cleanup 2021-12-13 15:44:30 -08: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
wackbyte
5b223e396f Unhardcode xrandr and fix nosetests call in make test 2021-10-17 13:23:45 -04:00
Mathieu Comandon
a6c85e011a Cleanup 2021-04-25 16:15:08 -07:00
Mathieu Comandon
63ff3b670a Remove flake8 from tests 2021-01-22 20:02:13 -08:00
Mathieu Comandon
50336d1cf5 Merge tag 'v0.5.7.1' 2020-07-18 17:18:59 -07:00
Mathieu Comandon
90ad63f479 Force editor to vim for changelogs 2020-07-18 15:50:28 -07:00
Mathieu Comandon
faeab43fdb Update package upload location 2020-07-04 11:37:40 -07:00
Mathieu Comandon
fef2be2319 Revert to installing pipenv as user 2020-05-08 10:33:17 -07:00
Mathieu Comandon
3b5df9e487 Remove yapf check, not consistent with Black 2020-05-06 12:55:58 -07:00
Mathieu Comandon
00d9cee4f2 Do not install pipenv in ~/.local/share 2020-05-06 12:42:50 -07:00
Alexandru-Rudi Mățău
43afda0bf9 - Removed required python version from Pipfile as that breaks on systems that have higher versions
- Simplified make dev
2020-04-27 11:17:07 -07:00
Alexandru-Rudi Mățău
e018ba79aa Updated style configs 2020-04-27 19:52:01 +03:00
Alexandru-Rudi Mățău
24cb599f31 Updated Makefile, .travis.yml and .gitignore 2020-04-27 19:52:01 +03:00
Mathieu Comandon
39fc682edf Specify python3 version of nosetests 2020-04-24 16:29:24 -07:00
Mathieu Comandon
a338d19fab Provide default git branch + build-source and release Make targets 2020-04-14 18:50:20 -07:00
Mathieu Comandon
bf0888dced Remove bundled winetricks 2020-01-05 16:00:25 -08:00
Stephan Lachnit
9efd539a57 Makefile changes
- Default target always builds the master branch and cleans afterwards.
- Update clean target to use to debian/clean file.
- Remove editor variable as it should be done system-wide.
- Various other changes.

Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
2019-12-27 16:15:22 -08:00
Mathieu Comandon
2696d49b00 Add upload-ppa Makefile target (untested) 2019-07-09 19:21:05 -07:00
Mathieu Comandon
e627a1a52d Bump ubuntu package version and fix path for dput upload 2019-04-04 15:11:35 -07:00
Mathieu Comandon
f11d49790a Bump package version 2019-04-04 03:42:30 -07:00
Mathieu Comandon
cb098841a7 Fix pathname + force upload 2019-04-04 03:23:58 -07:00