Skip to content

Commit 7ae30cd

Browse files
authored
Use ruff to format Python files in test-support (#48)
1 parent de55d69 commit 7ae30cd

File tree

3 files changed

+52
-39
lines changed

3 files changed

+52
-39
lines changed

.github/workflows/ci.yaml

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,42 @@ on:
77
pull_request:
88

99
jobs:
10+
test-support:
11+
name: Lint and set up test-support
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
16+
with:
17+
submodules: true
18+
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@22695119d769bdb6f7032ad67b9bca0ef8c4a174 # v5
21+
with:
22+
python-version: "3.13"
23+
24+
- run: |
25+
uv python install
26+
uv pip install modal ruff
27+
28+
- run: |
29+
ruff check test-support/
30+
ruff format --check test-support/
31+
32+
- run: test-support/setup.sh
33+
env:
34+
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
35+
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
36+
MODAL_ENVIRONMENT: libmodal
37+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
38+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
39+
AWS_REGION: us-east-1
40+
41+
1042
js:
11-
name: modal-js build and test
43+
name: modal-js build, lint, and test
1244
runs-on: ubuntu-latest
45+
needs: test-support
1346

1447
steps:
1548
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
@@ -35,24 +68,6 @@ jobs:
3568
- run: npm run build
3669
working-directory: ./modal-js
3770

38-
- name: Install uv
39-
uses: astral-sh/setup-uv@22695119d769bdb6f7032ad67b9bca0ef8c4a174 # v5
40-
with:
41-
python-version: "3.13"
42-
43-
- run: |
44-
uv python install
45-
uv pip install modal
46-
47-
- run: test-support/setup.sh
48-
env:
49-
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
50-
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
51-
MODAL_ENVIRONMENT: libmodal
52-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
53-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
54-
AWS_REGION: us-east-1
55-
5671
- run: npm test
5772
working-directory: ./modal-js
5873
env:
@@ -61,32 +76,15 @@ jobs:
6176
MODAL_ENVIRONMENT: libmodal
6277

6378
go:
64-
name: modal-go build and test
79+
name: modal-go build, lint, and test
6580
runs-on: ubuntu-latest
81+
needs: test-support
6682

6783
steps:
6884
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
6985
with:
7086
submodules: true
7187

72-
- name: Install uv
73-
uses: astral-sh/setup-uv@22695119d769bdb6f7032ad67b9bca0ef8c4a174 # v5
74-
with:
75-
python-version: "3.13"
76-
77-
- run: |
78-
uv python install
79-
uv pip install modal
80-
81-
- run: test-support/setup.sh
82-
env:
83-
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
84-
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
85-
MODAL_ENVIRONMENT: libmodal
86-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
87-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
88-
AWS_REGION: us-east-1
89-
9088
- name: Set up Go
9189
uses: actions/setup-go@v5
9290
with:

ruff.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
exclude = [
2+
'.venv',
3+
'.git',
4+
'__pycache__',
5+
]
6+
line-length = 120
7+
lint.ignore = ['E741']
8+
lint.select = ['E', 'F', 'W', 'I']
9+
10+
[lint.isort]
11+
combine-as-imports = true
12+
known-first-party = [
13+
"modal",
14+
]
15+
extra-standard-library = ["pytest"]

test-support/libmodal_test_support.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import modal
21
import time
32

3+
import modal
44

55
app = modal.App("libmodal-test-support")
66

0 commit comments

Comments
 (0)