build(python): migrate to pyproject.toml and bump python to 3.14 (#4772)
This commit is contained in:
2
.github/workflows/ci-flatpak.yml
vendored
2
.github/workflows/ci-flatpak.yml
vendored
@@ -60,7 +60,7 @@ jobs:
|
|||||||
id: python
|
id: python
|
||||||
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
||||||
with:
|
with:
|
||||||
python-version: '3.12'
|
python-version: '3.14'
|
||||||
|
|
||||||
- name: Setup Dependencies Linux Flatpak
|
- name: Setup Dependencies Linux Flatpak
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
6
.github/workflows/ci-freebsd.yml
vendored
6
.github/workflows/ci-freebsd.yml
vendored
@@ -114,7 +114,7 @@ jobs:
|
|||||||
ftp/curl \
|
ftp/curl \
|
||||||
graphics/libdrm \
|
graphics/libdrm \
|
||||||
graphics/wayland \
|
graphics/wayland \
|
||||||
lang/python312 \
|
lang/python314 \
|
||||||
multimedia/libva \
|
multimedia/libva \
|
||||||
multimedia/pipewire \
|
multimedia/pipewire \
|
||||||
net/miniupnpc \
|
net/miniupnpc \
|
||||||
@@ -133,13 +133,13 @@ jobs:
|
|||||||
ln -s /usr/local/bin/bash /bin/bash
|
ln -s /usr/local/bin/bash /bin/bash
|
||||||
|
|
||||||
# setup python
|
# 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
|
python -m ensurepip
|
||||||
release: ${{ matrix.bsd_release }}
|
release: ${{ matrix.bsd_release }}
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
# install gcvor
|
# install gcvor
|
||||||
python -m pip install gcovr
|
python -m pip install "./scripts[test]"
|
||||||
|
|
||||||
# fix git safe.directory issues
|
# fix git safe.directory issues
|
||||||
git config --global --add safe.directory "*"
|
git config --global --add safe.directory "*"
|
||||||
|
|||||||
4
.github/workflows/ci-linux.yml
vendored
4
.github/workflows/ci-linux.yml
vendored
@@ -62,7 +62,7 @@ jobs:
|
|||||||
id: python
|
id: python
|
||||||
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.14'
|
||||||
|
|
||||||
- name: Build latest libva
|
- name: Build latest libva
|
||||||
env:
|
env:
|
||||||
@@ -181,7 +181,7 @@ jobs:
|
|||||||
(steps.test.outcome == 'success' || steps.test.outcome == 'failure')
|
(steps.test.outcome == 'success' || steps.test.outcome == 'failure')
|
||||||
working-directory: build
|
working-directory: build
|
||||||
run: |
|
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 \
|
${{ steps.python.outputs.python-path }} -m gcovr --gcov-executable "gcov-${GCC_VERSION}" . -r ../src \
|
||||||
--exclude-noncode-lines \
|
--exclude-noncode-lines \
|
||||||
--exclude-throw-branches \
|
--exclude-throw-branches \
|
||||||
|
|||||||
4
.github/workflows/ci-windows.yml
vendored
4
.github/workflows/ci-windows.yml
vendored
@@ -173,7 +173,7 @@ jobs:
|
|||||||
id: setup-python
|
id: setup-python
|
||||||
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
||||||
with:
|
with:
|
||||||
python-version: '3.11'
|
python-version: '3.14'
|
||||||
|
|
||||||
- name: Python Path
|
- name: Python Path
|
||||||
id: python-path
|
id: python-path
|
||||||
@@ -258,7 +258,7 @@ jobs:
|
|||||||
shell: msys2 {0}
|
shell: msys2 {0}
|
||||||
working-directory: build
|
working-directory: build
|
||||||
run: |
|
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 \
|
${{ steps.python-path.outputs.python-path }} -m gcovr . -r ../src \
|
||||||
--exclude-noncode-lines \
|
--exclude-noncode-lines \
|
||||||
--exclude-throw-branches \
|
--exclude-throw-branches \
|
||||||
|
|||||||
10
.github/workflows/localize.yml
vendored
10
.github/workflows/localize.yml
vendored
@@ -25,16 +25,16 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
|
||||||
- name: Install Python 3.9
|
- name: Install Python
|
||||||
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
||||||
with:
|
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: |
|
run: |
|
||||||
cd ./scripts
|
|
||||||
python -m pip install --upgrade pip setuptools
|
python -m pip install --upgrade pip setuptools
|
||||||
python -m pip install -r requirements.txt
|
python -m pip install ".[locale]"
|
||||||
|
|
||||||
- name: Set up xgettext
|
- name: Set up xgettext
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -127,9 +127,15 @@ any of the following paths are modified.
|
|||||||
- 'src/**'
|
- 'src/**'
|
||||||
```
|
```
|
||||||
|
|
||||||
When testing locally it may be desirable to manually extract, initialize, update, and compile strings. Python is
|
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,
|
required for this, along with the python dependencies in the `./scripts/pyproject.toml` file. You can install this with
|
||||||
[xgettext](https://www.gnu.org/software/gettext) must be installed.
|
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
|
* Extract, initialize, and update
|
||||||
```bash
|
```bash
|
||||||
|
|||||||
34
scripts/pyproject.toml
Normal file
34
scripts/pyproject.toml
Normal 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"
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
Babel==2.18.0
|
|
||||||
clang-format==20.*
|
|
||||||
Reference in New Issue
Block a user