Skip to content

Commit 5c48147

Browse files
authored
Merge pull request #2813 from devitocodes/JDBetteridge/ruff_manual_changes
misc: Ruff manual changes
2 parents 1ec3c7f + c91949e commit 5c48147

251 files changed

Lines changed: 4779 additions & 4108 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/actionlint.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
self-hosted-runner:
2+
labels:
3+
- asv
4+
- amdgpu
5+
- nvidiagpu

.github/workflows/asv.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@ jobs:
3636

3737
- name: Set VIRTUAL_ENV
3838
run: |
39-
echo "VIRTUAL_ENV=$ENVHOME/asv" >> $GITHUB_ENV
40-
echo "PATH=$VIRTUAL_ENV/bin:$PATH" >> $GITHUB_ENV
39+
echo "VIRTUAL_ENV=$ENVHOME/asv" >> "$GITHUB_ENV"
40+
echo "PATH=$VIRTUAL_ENV/bin:$PATH" >> "$GITHUB_ENV"
4141
4242
- name: Set PATH
4343
run: |
44-
echo "PATH=$VIRTUAL_ENV/bin:$PATH" >> $GITHUB_ENV
44+
echo "PATH=$VIRTUAL_ENV/bin:$PATH" >> "$GITHUB_ENV"
4545
4646
- name: Install dependencies
4747
run: |

.github/workflows/docker-bases.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ jobs:
114114
TAG_BASE: ${{ format('cpu-gcc{0}', matrix.gcc) }}
115115
run: |
116116
docker buildx imagetools create \
117-
--tag devitocodes/bases:${TAG_BASE} \
118-
devitocodes/bases:${TAG_BASE}-amd64 \
119-
devitocodes/bases:${TAG_BASE}-arm64
120-
docker buildx imagetools inspect devitocodes/bases:${TAG_BASE}
117+
--tag "devitocodes/bases:${TAG_BASE}" \
118+
"devitocodes/bases:${TAG_BASE}-amd64" \
119+
"devitocodes/bases:${TAG_BASE}-arm64"
120+
docker buildx imagetools inspect "devitocodes/bases:${TAG_BASE}"
121121
122122
#######################################################
123123
############## Intel OneApi CPU #######################
@@ -296,10 +296,10 @@ jobs:
296296
FINAL_TAG: ${{ matrix.final_tag }}
297297
run: |
298298
docker buildx imagetools create \
299-
--tag devitocodes/bases:${FINAL_TAG} \
300-
devitocodes/bases:${FINAL_TAG}-amd64 \
301-
devitocodes/bases:${FINAL_TAG}-arm64
302-
docker buildx imagetools inspect devitocodes/bases:${FINAL_TAG}
299+
--tag "devitocodes/bases:${FINAL_TAG}" \
300+
"devitocodes/bases:${FINAL_TAG}-amd64" \
301+
"devitocodes/bases:${FINAL_TAG}-arm64"
302+
docker buildx imagetools inspect "devitocodes/bases:${FINAL_TAG}"
303303
304304
#######################################################
305305
##################### AMD #############################

.github/workflows/docker-devito.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113

114114
- name: Set per‑runner variables
115115
run: |
116-
echo "CONTAINER_NAME=testrun-${{ matrix.tag }}-${RUNNER_NAME// /_}" >> $GITHUB_ENV
116+
echo "CONTAINER_NAME=testrun-${{ matrix.tag }}-${RUNNER_NAME// /_}" >> "$GITHUB_ENV"
117117
118118
- name: Check event name
119119
run: echo ${{ github.event_name }}
@@ -246,8 +246,8 @@ jobs:
246246
refs="$refs devitocodes/devito:${tag}-${arch}"
247247
done
248248
echo "Creating manifest for devitocodes/devito:${tag} using:${refs}"
249-
docker buildx imagetools create --tag devitocodes/devito:${tag} $refs
250-
docker buildx imagetools inspect devitocodes/devito:${tag}
249+
docker buildx imagetools create --tag "devitocodes/devito:${tag}" "$refs"
250+
docker buildx imagetools inspect "devitocodes/devito:${tag}"
251251
done
252252
253253
test-devito:
@@ -286,7 +286,7 @@ jobs:
286286

287287
- name: Set per‑runner variables
288288
run: |
289-
echo "CONTAINER_NAME=testrun-${{ matrix.tag }}-${RUNNER_NAME// /_}" >> $GITHUB_ENV
289+
echo "CONTAINER_NAME=testrun-${{ matrix.tag }}-${RUNNER_NAME// /_}" >> "$GITHUB_ENV"
290290
291291
- name: Run tests against multi-arch image
292292
run: |

.github/workflows/examples-mpi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
- name: Install dependencies
6464
run: |
6565
pip install --upgrade pip
66-
pip install -e .[extras,mpi,tests]
66+
pip install -e ".[extras,mpi,tests]"
6767
python3 scripts/clear_devito_cache.py
6868
6969
- name: Test mpi notebooks

.github/workflows/examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,4 @@ jobs:
101101
uses: codecov/codecov-action@v5
102102
with:
103103
token: ${{ secrets.CODECOV_TOKEN }}
104-
name: ${{ matrix.name }}
104+
name: Examples

.github/workflows/lint.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
name: "Spellcheck everything"
4848
runs-on: ubuntu-latest
4949
steps:
50-
- uses: actions/checkout@v5
50+
- uses: actions/checkout@v6
5151
- name: Set up Python 3.10
5252
uses: actions/setup-python@v6
5353
with:
@@ -69,7 +69,7 @@ jobs:
6969
# #example-error-annotation-on-github-actions
7070
runs-on: ubuntu-latest
7171
steps:
72-
- uses: actions/checkout@v3
72+
- uses: actions/checkout@v6
7373
- name: Check workflow files
7474
uses: docker://rhysd/actionlint:latest
7575
with:
@@ -81,9 +81,9 @@ jobs:
8181
container:
8282
image: hadolint/hadolint:latest-alpine
8383
env:
84-
HADOLINT_IGNORE: "DL3005,DL3007,DL3008,DL3015,DL3059"
84+
HADOLINT_IGNORE: "DL3003,DL3004,DL3005,DL3007,DL3008,DL3009,DL3013,DL3015,DL3042,DL3059,SC2103,SC2046,SC2086"
8585
steps:
86-
- uses: actions/checkout@v3
86+
- uses: actions/checkout@v6
8787
- name: Lint dockerfiles inside hadolint container
8888
run: |
8989
for DOCKERFILE in docker/Dockerfile.*; \

.github/workflows/pytest-core-nompi.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ jobs:
153153
- name: Set run prefix
154154
run: |
155155
if [[ "${{ matrix.name }}" =~ "docker" ]]; then
156-
echo "RUN_CMD=docker run --init -t --rm -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} --name testrun devito_img" >> $GITHUB_ENV
156+
echo "RUN_CMD=docker run --init -t --rm -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} --name testrun devito_img" >> "$GITHUB_ENV"
157157
else
158-
echo "RUN_CMD=" >> $GITHUB_ENV
158+
echo "RUN_CMD=" >> "$GITHUB_ENV"
159159
fi
160160
id: set-run
161161

@@ -168,7 +168,7 @@ jobs:
168168
run : |
169169
if [ "${{ runner.os }}" == 'macOS' ]; then
170170
brew install llvm libomp
171-
echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH
171+
echo "/opt/homebrew/opt/llvm/bin" >> "$GITHUB_PATH"
172172
fi
173173
id: set-tests
174174

@@ -178,14 +178,14 @@ jobs:
178178
major=${ver%%.*}
179179
minor=${ver#*.}; minor=${minor%%.*}
180180
if [ "$major" -eq 3 ] && [ "$minor" -ge 12 ]; then
181-
echo "PIPFLAGS='--break-system-packages'" >> $GITHUB_ENV
181+
echo "PIPFLAGS='--break-system-packages'" >> "$GITHUB_ENV"
182182
fi
183183
184184
- name: Install dependencies
185185
if: "!contains(matrix.name, 'docker')"
186186
run: |
187187
python3 -m pip install ${{ env.PIPFLAGS }} --upgrade pip
188-
python3 -m pip install ${{ env.PIPFLAGS }} -e .[tests,extras]
188+
python3 -m pip install ${{ env.PIPFLAGS }} -e ".[tests,extras]"
189189
python3 -m pip install ${{ env.PIPFLAGS }} sympy==${{matrix.sympy}}
190190
191191
- name: Check Docker image Python version

.github/workflows/pytest-gpu.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ jobs:
7979

8080
- name: Set per-runner tags
8181
run: |
82-
echo "DOCKER_IMAGE=${{ matrix.name }}-${RUNNER_NAME// /_}" >> $GITHUB_ENV
83-
echo "CONTAINER_BASENAME=testrun-${{ matrix.name }}-${RUNNER_NAME// /_}-${{ github.sha }}" >> $GITHUB_ENV
82+
echo "DOCKER_IMAGE=${{ matrix.name }}-${RUNNER_NAME// /_}" >> "$GITHUB_ENV"
83+
echo "CONTAINER_BASENAME=testrun-${{ matrix.name }}-${RUNNER_NAME// /_}-${{ github.sha }}" >> "$GITHUB_ENV"
8484
8585
- name: Ensure buildx builder
8686
run: |
@@ -93,7 +93,7 @@ jobs:
9393
docker buildx build . \
9494
--builder "${RUNNER_NAME// /_}" \
9595
--load \
96-
--label ci-run=$GITHUB_RUN_ID \
96+
--label ci-run="$GITHUB_RUN_ID" \
9797
--rm --pull \
9898
--file docker/Dockerfile.devito \
9999
--tag "${DOCKER_IMAGE}" \
@@ -107,7 +107,7 @@ jobs:
107107
# Make sure CUDA_VISIBLE_DEVICES is at least *something* on NVIDIA
108108
# runners; fall back to "all" so the driver probe does not fail.
109109
if [[ "${{ matrix.runner_label }}" == "nvidiagpu" && -z "${CUDA_VISIBLE_DEVICES:-}" ]]; then
110-
echo "CUDA_VISIBLE_DEVICES=all" >> $GITHUB_ENV
110+
echo "CUDA_VISIBLE_DEVICES=all" >> "$GITHUB_ENV"
111111
fi
112112
113113
# Run a simple driver-probe command (nvidia-smi / rocm-smi)
@@ -124,7 +124,7 @@ jobs:
124124
125125
# Run the test suite using the matrix-defined flags
126126
docker run ${{ matrix.flags }} \
127-
${ci_env} \
127+
"${ci_env}" \
128128
-e CI=true \
129129
-e PYTHONFAULTHANDLER=1 \
130130
-e DEVITO_LOGGING=DEBUG \
@@ -152,7 +152,7 @@ jobs:
152152
docker rmi -f "${DOCKER_IMAGE}" || true
153153
154154
# Classic image layers created in this job
155-
docker image prune -f --filter label=ci-run=$GITHUB_RUN_ID
155+
docker image prune -f --filter label=ci-run="$GITHUB_RUN_ID"
156156
157157
# BuildKit cache: target the per-runner builder explicitly
158158
docker builder prune --builder "${RUNNER_NAME// /_}" \

.github/workflows/tutorials.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,17 +78,17 @@ jobs:
7878
- name: Set run prefix
7979
run: |
8080
if [ "${{ matrix.name }}" == 'tutos-docker-gcc-py310' ]; then
81-
echo "RUN_CMD=docker run --init -t --rm --name testrun devito_img" >> $GITHUB_ENV
81+
echo "RUN_CMD=docker run --init -t --rm --name testrun devito_img" >> "$GITHUB_ENV"
8282
else
83-
echo "RUN_CMD=" >> $GITHUB_ENV
83+
echo "RUN_CMD=" >> "$GITHUB_ENV"
8484
fi
8585
id: set-run
8686

8787
- name: Install dependencies
8888
if: matrix.name != 'tutos-docker-gcc-py310'
8989
run: |
9090
python -m pip install --upgrade pip
91-
pip install -e .[tests,extras]
91+
pip install -e ".[tests,extras]"
9292
pip install blosc
9393
9494
- name: Check Docker image Python version

0 commit comments

Comments
 (0)