chore(deps): use lizardbyte-common for python helpers (#5250)

This commit is contained in:
David Lane
2026-06-04 19:48:38 -04:00
committed by GitHub
parent 1f0455cc0c
commit 98ee1d00f5
13 changed files with 40 additions and 530 deletions
+7 -3
View File
@@ -15,6 +15,7 @@ on:
env:
BRANCH: ${{ github.head_ref || github.ref_name }}
BUILD_VERSION: ${{ inputs.release_version }}
PYTHON_VERSION: '3.14'
COMMIT: ${{ inputs.release_commit }}
FREEBSD_CLANG_VERSION: 19
@@ -90,7 +91,7 @@ jobs:
with:
arch: ${{ matrix.arch }}
cpu: ${{ steps.processor_count.outputs.PROCESSOR_COUNT }}
envs: 'BRANCH BUILD_VERSION COMMIT'
envs: 'BRANCH BUILD_VERSION COMMIT PYTHON_VERSION'
# TODO: there is no libcap for freebsd... we need graphics/libdrm if we find a way to use libcap
# TODO: docs are off because doxygen is too old: https://www.freshports.org/devel/doxygen/ must be >= 1.10
prepare: |
@@ -142,7 +143,10 @@ jobs:
release: ${{ matrix.bsd_release }}
run: |
set -e
uv sync --locked --group glad --group test --python /usr/local/bin/python3.14 \
uv sync --locked --only-group glad --python "/usr/local/bin/python${PYTHON_VERSION}" \
--no-python-downloads --no-install-project
uv sync --project third-party/lizardbyte-common --locked --only-group test-c \
--python "/usr/local/bin/python${PYTHON_VERSION}" \
--no-python-downloads --no-install-project
# fix git safe.directory issues
@@ -255,7 +259,7 @@ jobs:
shell: freebsd {0}
run: |
cd "${GITHUB_WORKSPACE}/build"
uv run --locked --no-sync python -m gcovr . -r ../src \
uv run --project ../third-party/lizardbyte-common --locked --no-sync gcovr . -r ../src \
--exclude-noncode-lines \
--exclude-throw-branches \
--exclude-unreachable-branches \
+6 -2
View File
@@ -172,7 +172,10 @@ jobs:
enable-cache: true
- name: Sync Python tools
run: uv sync --locked --only-group test --python "${PYTHON_VERSION}" --no-python-downloads --no-install-project
run: |
uv sync --project third-party/lizardbyte-common --locked --only-group test-c \
--python "${PYTHON_VERSION}" \
--no-python-downloads --no-install-project
- name: Run tests
id: test
@@ -192,7 +195,8 @@ jobs:
(steps.test.outcome == 'success' || steps.test.outcome == 'failure')
working-directory: build
run: |
uv run --locked --no-sync python -m gcovr --gcov-executable "gcov-${GCC_VERSION}" . -r ../src \
uv run --project ../third-party/lizardbyte-common --locked --no-sync gcovr \
--gcov-executable "gcov-${GCC_VERSION}" . -r ../src \
--exclude-noncode-lines \
--exclude-throw-branches \
--exclude-unreachable-branches \
+5 -2
View File
@@ -99,7 +99,10 @@ jobs:
enable-cache: true
- name: Sync Python tools
run: uv sync --locked --only-group test --python "${PYTHON_VERSION}" --no-python-downloads --no-install-project
run: |
uv sync --project third-party/lizardbyte-common --locked --only-group test-c \
--python "${PYTHON_VERSION}" \
--no-python-downloads --no-install-project
- name: Configure
env:
@@ -181,7 +184,7 @@ jobs:
(steps.test.outcome == 'success' || steps.test.outcome == 'failure')
working-directory: build
run: |
uv run --locked --no-sync python -m gcovr . -r ../src \
uv run --project ../third-party/lizardbyte-common --locked --no-sync gcovr . -r ../src \
--exclude-noncode-lines \
--exclude-throw-branches \
--exclude-unreachable-branches \
+4 -2
View File
@@ -214,7 +214,9 @@ jobs:
MSYS2_PATH_TYPE: inherit
UV_PYTHON: ${{ steps.setup-python.outputs.python-path }}
run: |
uv sync --locked --only-group test --no-python-downloads --no-install-project
uv sync --project third-party/lizardbyte-common --locked --only-group test-c \
--no-python-downloads \
--no-install-project
- name: Build Windows
shell: msys2 {0}
@@ -367,7 +369,7 @@ jobs:
env:
MSYS2_PATH_TYPE: inherit
run: |
uv run --locked --no-sync python -m gcovr . -r ../src \
uv run --project ../third-party/lizardbyte-common --locked --no-sync gcovr . -r ../src \
--exclude-noncode-lines \
--exclude-throw-branches \
--exclude-unreachable-branches \
+3 -92
View File
@@ -12,100 +12,11 @@ on:
- 'locale/sunshine.po'
workflow_dispatch:
env:
FILE: ./locale/sunshine.po
PYTHON_VERSION: '3.14'
jobs:
localize:
name: Update Localization
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Install Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Setup uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
enable-cache: true
- name: Sync Python tools
run: |
uv sync --frozen --only-group locale \
--python "${PYTHON_VERSION}" \
--no-python-downloads \
--no-install-project
- name: Set up xgettext
run: |
sudo apt-get update -y && \
sudo apt-get --reinstall install -y \
gettext
- name: Update Strings
run: |
new_file=true
# first, try to remove existing file as xgettext does not remove unused translations
if [ -f "${FILE}" ];
then
rm "${FILE}"
new_file=false
fi
echo "NEW_FILE=${new_file}" >> "${GITHUB_ENV}"
# extract the new strings
uv run --frozen --no-sync python ./scripts/_locale.py --extract
- name: git diff
if: env.NEW_FILE == 'false'
run: |
# disable the pager
git config --global pager.diff false
# print the git diff
git diff locale/sunshine.po
# set the variable with minimal output, replacing `\t` with ` `
OUTPUT=$(git diff --numstat locale/sunshine.po | sed -e "s#\t# #g")
echo "GIT_DIFF=${OUTPUT}" >> "${GITHUB_ENV}"
- name: git reset
# only run if a single line changed (date/time) and file already existed
if: >-
env.GIT_DIFF == '1 1 locale/sunshine.po' &&
env.NEW_FILE == 'false'
run: |
git reset --hard
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> "${GITHUB_OUTPUT}"
- name: Create/Update Pull Request
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
add-paths: |
locale/*.po
token: ${{ secrets.GH_BOT_TOKEN }} # must trigger PR tests
commit-message: "chore(l10n): new babel updates"
branch: localize/update
delete-branch: true
base: master
title: "chore(l10n): new babel updates"
body: |
Update report
- Updated ${{ steps.date.outputs.date }}
- Auto-generated by [create-pull-request][1]
[1]: https://github.com/peter-evans/create-pull-request
labels: |
babel
l10n
uses: LizardByte/lizardbyte-common/.github/workflows/localize.yml@master
secrets:
GH_TOKEN: ${{ secrets.GH_BOT_TOKEN }}