Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into 10526_glossary_supp…
Browse files Browse the repository at this point in the history
…ort_google_cloud_translation_advanced
  • Loading branch information
gersona committed Nov 12, 2024
2 parents 2295605 + 0239904 commit 877e6a1
Show file tree
Hide file tree
Showing 577 changed files with 300,099 additions and 272,208 deletions.
27 changes: 22 additions & 5 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@
"git-refs"
],
"automerge": false,
"schedule": "on the last day of the month"
"schedule": "on the first day of the month"
},
{
"matchDatasources": [
"helm"
],
"automerge": false,
"schedule": "on the last day of the month"
"schedule": "on the first day of the month"
},
{
"matchPaths": [
"matchFileNames": [
"**/package.json"
],
"automerge": false
Expand Down Expand Up @@ -68,8 +68,9 @@
}
}
],
"regexManagers": [
"customManagers": [
{
"customType": "regex",
"fileMatch": [
"\\.pre-commit-config\\.yaml"
],
Expand All @@ -80,6 +81,7 @@
"versioningTemplate": "pep440"
},
{
"customType": "regex",
"fileMatch": [
"\\.pre-commit-config\\.yaml"
],
Expand All @@ -90,8 +92,9 @@
"versioningTemplate": "npm"
},
{
"customType": "regex",
"fileMatch": [
"^Dockerfile$"
"^.*Dockerfile$"
],
"matchStrings": [
"ENV WEBLATE_VERSION=(?<currentValue>.*?)\\n"
Expand All @@ -101,6 +104,19 @@
"versioningTemplate": "pep440"
},
{
"customType": "regex",
"fileMatch": [
"^.*Dockerfile$"
],
"matchStrings": [
"ENV UV_VERSION=(?<currentValue>.*?)\\n"
],
"depNameTemplate": "uv",
"datasourceTemplate": "pypi",
"versioningTemplate": "pep440"
},
{
"customType": "regex",
"fileMatch": [
"(^|/)Chart\\.yaml$"
],
Expand All @@ -109,6 +125,7 @@
]
},
{
"customType": "regex",
"fileMatch": [
"^\\.github/workflows/[^/]+\\.ya?ml$"
],
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,27 @@ jobs:
with:
enable-cache: true
cache-dependency-glob: ''
cache-suffix: '3.12'
cache-suffix: '3.13'
- name: Start services
run: ./ci/services-up $CI_DATABASE
- name: Install apt dependencies
run: sudo ./ci/apt-install $CI_DATABASE
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
python-version: '3.13'
- name: Used versions
run: ./ci/print-versions
- name: Install Python dependencies
run: ./ci/pip-install latest
- name: Prepare database
run: ./ci/prepare-database
- name: Migrate database
run: coverage run ./manage.py migrate --noinput --traceback
run: uv run --no-sources ./manage.py migrate --noinput --traceback
- name: Generate OpenAPI
run: |
echo "::add-matcher::.github/matchers/spectacular.json"
./manage.py spectacular --urlconf="weblate.api.urls" > weblate-openapi.yaml
uv run --no-sources ./manage.py spectacular --urlconf="weblate.api.urls" > weblate-openapi.yaml
echo "::remove-matcher owner=spectacular::"
- name: openapi-lint
run: npx @redocly/cli lint --format github-actions weblate-openapi.yaml
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ jobs:
with:
enable-cache: true
cache-dependency-glob: ''
cache-suffix: '3.12'
cache-suffix: '3.13'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
- name: Used versions
run: ./ci/print-versions
- name: Install Python dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
- name: Install apt dependencies
run: |
sudo apt update
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fossa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions:

jobs:
fossa-scan:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
if: ${{ github.repository == 'WeblateOrg/weblate' }}
steps:
- name: Checkout Code
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/licenses-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
- uses: astral-sh/setup-uv@v3
- name: Install dependencies
run: uv pip install --system $(sed -n 's/.*"\(pre-commit==\([^"]*\)\)".*/\1/p' pyproject.toml)
- run: ./scripts/generate-license-data
- name: Update renovate branch
if: github.ref != 'refs/heads/main'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linkcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
- uses: astral-sh/setup-uv@v3
- name: Install apt dependencies
run: |
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/migrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
CI_DB_PORT: '60000'
CI_SELENIUM: '1'
DJANGO_SETTINGS_MODULE: weblate.settings_test
UV_FROZEN: '1'

steps:
- uses: actions/checkout@v4
Expand All @@ -44,11 +45,12 @@ jobs:
with:
enable-cache: true
cache-dependency-glob: ''
cache-suffix: '3.12'
# Do not share cache with tests as this uses python 3.11 for older versions
cache-suffix: multi
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
- name: Install Python dependencies
run: ./ci/pip-install latest
- name: Check missing migrations
Expand All @@ -73,8 +75,8 @@ jobs:
run: ./ci/run-migrate 5.8
- name: Coverage
run: |
coverage combine
coverage xml
uv run --no-sources coverage combine
uv run --no-sources coverage xml
- uses: codecov/codecov-action@v4
with:
token: ${{secrets.CODECOV_TOKEN}}
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,14 @@ jobs:
with:
enable-cache: true
cache-dependency-glob: ''
cache-suffix: '3.12'
cache-suffix: '3.13'
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: ./ci/pip-install mypy
python-version: '3.13'

- name: Run mypy
run: mypy --show-column-numbers weblate > mypy.log
run: uv run --no-sources --all-extras --group types mypy --show-column-numbers weblate > mypy.log
# Temporary hack until we have this fully working
continue-on-error: true
- name: Report mypy
Expand Down
39 changes: 31 additions & 8 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,40 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install dependencies
python-version: '3.13'
- uses: astral-sh/setup-uv@v3
- name: detect method
id: detect
run: |
if [ -f requirements-lint.txt ] ; then
uv pip install --system -r requirements-lint.txt
if test -f requirements-lint.txt ; then
echo "method=requirements" >> $GITHUB_OUTPUT
elif test -f pyproject.toml && grep -q dependency-groups pyproject.toml ; then
echo "method=pep735" >> $GITHUB_OUTPUT
elif test -f pyproject.toml && grep -q dependency-groups pyproject.toml ; then
echo "method=pyproject" >> $GITHUB_OUTPUT
else
uv pip install --system $(sed -n 's/.*"\(pre-commit==\([^"]*\)\)".*/\1/p' pyproject.toml)
echo "method=uvx" >> $GITHUB_OUTPUT
fi
- name: pre-commit
- name: pre-commit (PEP 735)
if: steps.detect.outputs.method == 'pep735'
run: uv run --no-sources --only-group pre-commit pre-commit run --all
env:
RUFF_OUTPUT_FORMAT: github
REUSE_OUTPUT_FORMAT: github
- name: pre-commit (uvx)
if: steps.detect.outputs.method == 'uvx'
run: uvx pre-commit run --all
env:
RUFF_OUTPUT_FORMAT: github
REUSE_OUTPUT_FORMAT: github
- name: Install dependencies
if: steps.detect.outputs.method == 'requirements'
run: uv pip install --system -r requirements-lint.txt
- name: Install dependencies
if: steps.detect.outputs.method == 'pyproject'
run: uv pip install --system $(sed -n 's/.*"\(pre-commit==\([^"]*\)\)".*/\1/p' pyproject.toml)
- name: pre-commit (installed)
if: steps.detect.outputs.method == 'requirements' || steps.detect.outputs.method == 'pyproject'
run: pre-commit run --all
env:
RUFF_OUTPUT_FORMAT: github
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/pull_requests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ jobs:
name: Weblate automerge
if: github.actor == 'weblate'
steps:
- uses: peter-evans/enable-pull-request-automerge@v3
with:
pull-request-number: ${{ github.event.pull_request.number }}
merge-method: rebase
- uses: actions/checkout@v4
- name: Enable Pull Request Automerge
run: gh pr merge --rebase --auto "${{ github.event.pull_request.number }}"
env:
GH_TOKEN: ${{ secrets.WEBLATE_CI_TOKEN }}
7 changes: 2 additions & 5 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: uv pip install --system $(sed -n 's/.*"\(pylint==\([^"]*\)\)".*/\1/p' pyproject.toml)
python-version: '3.13'
- name: Add pylint annotator
uses: pr-annotators/[email protected]

- name: Run pylint
run: pylint weblate/
run: uv run --no-sources --only-group pylint pylint weblate/
5 changes: 4 additions & 1 deletion .github/workflows/rundev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ jobs:
PYTHONUNBUFFERED: 1
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v3
- run: ./rundev.sh build
- run: ./rundev.sh start
- run: ./rundev.sh wait
- run: ./rundev.sh check
- run: ./rundev.sh test --failfast weblate.vcs
- run: ./rundev.sh compilemessages
- run: ./rundev.sh test --failfast weblate
- run: ./rundev.sh logs
if: always()
- run: ./rundev.sh stop
19 changes: 14 additions & 5 deletions .github/workflows/schema-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,22 @@ on:
- pyproject.toml
- docs/Makefile

permissions:
contents: read

jobs:
jsonschema-update:
runs-on: ubuntu-24.04
permissions:
contents: write
pull-requests: write

steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.WEBLATE_CI_TOKEN }}
- uses: astral-sh/setup-uv@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
- name: Install Python dependencies
run: |
uv pip install --system $(sed -n 's/.*"\(weblate-schemas==\([^"]*\)\)".*/\1/p' pyproject.toml)
Expand All @@ -42,12 +44,19 @@ jobs:
with:
commit_message: 'docs: Update JSON schemas'
- name: Create Pull Request
id: cpr
if: github.ref == 'refs/heads/main'
uses: peter-evans/create-pull-request@v7
with:
branch: create-pull-request/jsonschema-update
title: 'docs: Update JSON schemas'
commit-message: 'docs: Update JSON schemas'
token: ${{ secrets.WEBLATE_CI_TOKEN }}
labels: |
dependencies
automerge
- name: Enable Pull Request Automerge
if: github.ref == 'refs/heads/main' && steps.cpr.outputs.pull-request-operation != 'none'
run: gh pr merge --rebase --auto "${{ steps.cpr.outputs.pull-request-number }}"
env:
GH_TOKEN: ${{ secrets.WEBLATE_CI_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/scorecards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ jobs:

# Upload the results to GitHub's code scanning dashboard.
- name: Upload to code-scanning
uses: github/codeql-action/[email protected].0
uses: github/codeql-action/[email protected].1
with:
sarif_file: results.sarif
Loading

0 comments on commit 877e6a1

Please sign in to comment.