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

This commit is contained in:
David Lane
2026-02-24 19:29:40 -05:00
committed by GitHub
parent fbb8520ab0
commit 766473f691
8 changed files with 56 additions and 18 deletions

View File

@ -60,7 +60,7 @@ jobs:
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: |

View File

@ -114,7 +114,7 @@ jobs:
ftp/curl \
graphics/libdrm \
graphics/wayland \
lang/python312 \
lang/python314 \
multimedia/libva \
multimedia/pipewire \
net/miniupnpc \
@ -133,13 +133,13 @@ jobs:
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 gcovr
python -m pip install "./scripts[test]"
# fix git safe.directory issues
git config --global --add safe.directory "*"

View File

@ -62,7 +62,7 @@ jobs:
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 @@ jobs:
(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 \

View File

@ -173,7 +173,7 @@ jobs:
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 @@ jobs:
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 \

View File

@ -25,16 +25,16 @@ jobs:
- 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.9'
python-version: '3.14'
- 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: |

View File

@ -127,9 +127,15 @@ any of the following paths are modified.
- '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

34
scripts/pyproject.toml Normal file
View File

@ -0,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"

View File

@ -1,2 +0,0 @@
Babel==2.18.0
clang-format==20.*