Skip to content

Commit

Permalink
chore: Sync with WeblateOrg/meta
Browse files Browse the repository at this point in the history
  • Loading branch information
nijel committed Nov 5, 2024
1 parent ec6eeab commit 9f34903
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 18 deletions.
17 changes: 16 additions & 1 deletion .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"labels": [
"dependencies"
],
"lockFileMaintenance": {
"enabled": true
},
"rangeStrategy": "widen",
"dependencyDashboard": true,
"automerge": true,
Expand Down Expand Up @@ -94,7 +97,7 @@
{
"customType": "regex",
"fileMatch": [
"^Dockerfile$"
"^.*Dockerfile$"
],
"matchStrings": [
"ENV WEBLATE_VERSION=(?<currentValue>.*?)\\n"
Expand All @@ -103,6 +106,18 @@
"datasourceTemplate": "pypi",
"versioningTemplate": "pep440"
},
{
"customType": "regex",
"fileMatch": [
"^.*Dockerfile$"
],
"matchStrings": [
"ENV UV_VERSION=(?<currentValue>.*?)\\n"
],
"depNameTemplate": "uv",
"datasourceTemplate": "pypi",
"versioningTemplate": "pep440"
},
{
"customType": "regex",
"fileMatch": [
Expand Down
42 changes: 25 additions & 17 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,32 +29,40 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: '3.13'
- uses: astral-sh/setup-uv@v3
- name: detect PEP 735
id: pep735
- name: detect method
id: detect
run: |
if grep -q dependency-groups pyproject.toml ; then
echo "found=1" >> $GITHUB_OUTPUT
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
echo "found=0" >> $GITHUB_OUTPUT
echo "method=uvx" >> $GITHUB_OUTPUT
fi
- name: pre-commit
if: ${{ steps.pep735.outputs.found == 1 }}
- name: pre-commit (PEP 735)
if: steps.detect.outputs.method == 'pep735'
run: uv run --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.pep735.outputs.found == 0 }}
run: |
if [ -f requirements-lint.txt ] ; then
uv pip install --system -r requirements-lint.txt
else
uv pip install --system $(sed -n 's/.*"\(pre-commit==\([^"]*\)\)".*/\1/p' pyproject.toml)
fi
- name: pre-commit
if: ${{ steps.pep735.outputs.found == 0 }}
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

0 comments on commit 9f34903

Please sign in to comment.