Skip to content

Commit

Permalink
Sync Ruff version on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel-Therrien-Beslogic committed Nov 19, 2024
1 parent 61cc156 commit ca98e83
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 26 deletions.
14 changes: 12 additions & 2 deletions .github/workflows/canopeum_backend_pr_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
cache-dependency-glob: "canopeum_backend/uv.lock"
- run: uv sync --locked --extra dev
- name: Run Django Tests
run: python manage.py test
run: uv run manage.py test
mypy:
runs-on: ubuntu-latest
defaults:
Expand Down Expand Up @@ -85,14 +85,24 @@ jobs:
ref: ${{ github.event.pull_request.head.ref }}
# Token with Contents permissions to allow retriggering workflow
token: ${{ secrets.PR_AUTOFIX_PAT }}
- run: echo "${{github.event.head_commit.author.name}}"
- name: Get Ruff version
id: ruff_version
# We need an exact value, feature request for any valid range specifier
# https://github.com/astral-sh/ruff-action/issues/11
run: |
$Env:RUFF_VERSION=Select-String -path pyproject.toml -pattern 'ruff ?[=<>~]?= ?(.+?)"' | %{ $_.Matches[0].Groups[1].Value }
echo $Env:RUFF_VERSION
echo "RUFF_VERSION=$Env:RUFF_VERSION" >> $Env:GITHUB_OUTPUT
shell: pwsh
- uses: astral-sh/ruff-action@v1
with:
version: ${{ steps.ruff_version.outputs.RUFF_VERSION }}
args: check --fix
- uses: astral-sh/ruff-action@v1
# Format even on lint failure
if: ${{ !cancelled() }}
with:
version: ${{ steps.ruff_version.outputs.RUFF_VERSION }}
args: format
- name: Commit autofixes
uses: EndBug/add-and-commit@v9
Expand Down
2 changes: 1 addition & 1 deletion canopeum_backend/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dev = [
# Tools
"mypy", # version taken from [compatible-mypy],
"pyright>=1.1.374",
"ruff==0.6.*",
"ruff~=0.7.4",
# Stubs
"django-stubs[compatible-mypy]>=5.0.0",
"djangorestframework-stubs[compatible-mypy]>=3.15.0",
Expand Down
2 changes: 1 addition & 1 deletion canopeum_backend/scripts/checkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@


def run_command(command: Sequence["StrOrBytesPath"]):
print(f"\nRunning: {" ".join(str(arg) for arg in command)}")
print(f"\nRunning: {' '.join(str(arg) for arg in command)}")
run(command, check=False)


Expand Down
44 changes: 22 additions & 22 deletions canopeum_backend/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ca98e83

Please sign in to comment.