ref:766473f69181a8c7fa3e446dcfa96b482c8febf9

build(python): migrate to pyproject.toml and bump python to 3.14 (#4772)

SHA: 766473f69181a8c7fa3e446dcfa96b482c8febf9
Author: David Lane <42013603+ReenigneArcher@users.noreply.github.com>
Date: 2026-02-25 00:29
Parents: fbb8520
8 files changed +56 -18
Type
.github/workflows/ci-flatpak.yml +1 −1
@@ -60,7 +60,7 @@
id: python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.12'
python-version: '3.14'
- name: Setup Dependencies Linux Flatpak
run: |
.github/workflows/ci-freebsd.yml +3 −3
@@ -114,7 +114,7 @@
ftp/curl \
graphics/libdrm \
graphics/wayland \
lang/python312 \
lang/python314 \
multimedia/libva \
multimedia/pipewire \
net/miniupnpc \
@@ -133,13 +133,13 @@
ln -s /usr/local/bin/bash /bin/bash
# setup python
ln -s /usr/local/bin/python3.12 /usr/local/bin/python
ln -s /usr/local/bin/python3.14 /usr/local/bin/python
python -m ensurepip
release: ${{ matrix.bsd_release }}
run: |
set -e
# install gcvor
python -m pip install "./scripts[test]"
python -m pip install gcovr
# fix git safe.directory issues
git config --global --add safe.directory "*"
.github/workflows/ci-linux.yml +2 −2
@@ -62,7 +62,7 @@
id: python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.11'
python-version: '3.14'
- name: Build latest libva
env:
@@ -181,7 +181,7 @@
(steps.test.outcome == 'success' || steps.test.outcome == 'failure')
working-directory: build
run: |
${{ steps.python.outputs.python-path }} -m pip install gcovr
${{ steps.python.outputs.python-path }} -m pip install "../scripts[test]"
${{ steps.python.outputs.python-path }} -m gcovr --gcov-executable "gcov-${GCC_VERSION}" . -r ../src \
--exclude-noncode-lines \
--exclude-throw-branches \
.github/workflows/ci-windows.yml +2 −2
@@ -173,7 +173,7 @@
id: setup-python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.11'
python-version: '3.14'
- name: Python Path
id: python-path
@@ -258,7 +258,7 @@
shell: msys2 {0}
working-directory: build
run: |
${{ steps.python-path.outputs.python-path }} -m pip install gcovr
${{ steps.python-path.outputs.python-path }} -m pip install "../scripts[test]"
${{ steps.python-path.outputs.python-path }} -m gcovr . -r ../src \
--exclude-noncode-lines \
--exclude-throw-branches \
.github/workflows/localize.yml +5 −5
@@ -25,16 +25,16 @@
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Install Python 3.9
- name: Install Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: '3.14'
python-version: '3.9'
- name: Set up Python 3.9 Dependencies
- name: Set up Python Dependencies
working-directory: scripts
run: |
cd ./scripts
python -m pip install --upgrade pip setuptools
python -m pip install -r requirements.txt
python -m pip install ".[locale]"
- name: Set up xgettext
run: |
docs/contributing.md +9 −3
@@ -127,9 +127,15 @@
- 'src/**'
```
When testing locally it may be desirable to manually extract, initialize, update, and compile strings. Python is
required for this, along with the python dependencies in the `./scripts/requirements.txt` file. Additionally,
[xgettext](https://www.gnu.org/software/gettext) must be installed.
When testing locally, it may be desirable to manually extract, initialize, update, and compile strings. Python is
required for this, along with the python dependencies in the `./scripts/pyproject.toml` file. You can install this with
the following command.
```bash
python -m pip install "./scripts[locale]"
```
Additionally, [xgettext](https://www.gnu.org/software/gettext) must be installed.
* Extract, initialize, and update
```bash
scripts/pyproject.toml +34 −0
@@ -1,0 +1,34 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "Sunshine"
dynamic = ["version"]
description = "Helper scripts for Sunshine"
requires-python = ">=3.14"
license = {text = "GPL-3.0-only"}
authors = [
{name = "LizardByte", email = "lizardbyte@users.noreply.github.com"}
]
dependencies = []
[project.optional-dependencies]
lint = [
"clang-format==20.*",
"flake8==7.3.0",
]
locale = [
"Babel==2.18.0",
]
test = [
"gcovr==8.6",
]
[project.urls]
Homepage = "https://app.lizardbyte.dev/Sunshine"
Repository = "https://github.com/LizardByte/Sunshine"
Issues = "https://github.com/LizardByte/Sunshine/issues"
scripts/requirements.txt +0 −2
@@ -1,2 +1,0 @@
Babel==2.18.0
clang-format==20.*