Skip to content

Commit ee48988

Browse files
authored
Merge pull request #212 from rtibblesbot/issue-211-d81051
Migrate to uv, ruff, and prek
2 parents 0625bc3 + 785e37e commit ee48988

48 files changed

Lines changed: 1090 additions & 616 deletions

Some content is hidden

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

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Migrate to ruff formatter (replaces black)
2+
fdf3066e3346c925faaf8fdc3746698588d77dad

.github/dependabot.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
# Automatically update versions for pip and npm
2-
1+
# Automatically update versions for uv and GitHub Actions
32
version: 2
43
updates:
5-
6-
# Maintain dependencies for Python
7-
- package-ecosystem: "pip"
4+
# Maintain dependencies for uv
5+
- package-ecosystem: "uv"
86
directory: "/"
97
schedule:
108
interval: "monthly"
119
time: "00:00"
1210
cooldown:
1311
default-days: 7
14-
1512
# Maintain dependencies for Github Actions
1613
- package-ecosystem: "github-actions"
1714
directory: "/"

.github/workflows/call-contributor-issue-comment.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
name: Handle contributor comment on GitHub issue
2-
32
on:
43
issue_comment:
54
types: [created]
6-
75
jobs:
86
call-workflow:
97
uses: learningequality/.github/.github/workflows/contributor-issue-comment.yml@main

.github/workflows/call-contributor-pr-reply.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: Send reply on a new contributor pull request
22
on:
33
pull_request_target:
44
types: [opened]
5-
65
jobs:
76
call-workflow:
87
name: Call shared workflow
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
name: Manage issue header
2-
32
on:
43
issues:
54
types: [opened, reopened, labeled, unlabeled]
6-
75
jobs:
86
call-workflow:
97
name: Call shared workflow
108
uses: learningequality/.github/.github/workflows/manage-issue-header.yml@main
119
secrets:
12-
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
13-
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
10+
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
11+
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}

.github/workflows/call-update-pr-spreadsheet.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
name: Update community pull requests spreadsheet
2-
32
on:
43
pull_request_target:
54
types: [assigned, unassigned, opened, closed, reopened, edited, review_requested, review_request_removed]
6-
75
jobs:
86
call-workflow:
97
name: Call shared workflow
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
name: Community Contribution Label
2-
32
on:
43
issues:
54
types: [assigned, unassigned]
6-
75
jobs:
86
call-label-action:
97
uses: learningequality/.github/.github/workflows/community-contribution-label.yml@main
108
secrets:
11-
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
12-
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}
9+
LE_BOT_APP_ID: ${{ secrets.LE_BOT_APP_ID }}
10+
LE_BOT_PRIVATE_KEY: ${{ secrets.LE_BOT_PRIVATE_KEY }}

.github/workflows/finalized_specs.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
name: Finalized specs
2-
32
on:
43
push:
54
branches:
6-
- main
5+
- main
76
pull_request:
8-
97
jobs:
108
change_check:
119
name: Check if file changed
@@ -21,12 +19,12 @@ jobs:
2119
- id: changes
2220
# Set outputs using the command.
2321
run: |
24-
echo "modified=$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep spec/labels-v1.json$ | xargs)" >> $GITHUB_OUTPUT
22+
echo "modified=$(git diff --name-only --diff-filter=ACMRT "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" | grep spec/labels-v1.json$ | xargs)" >> "$GITHUB_OUTPUT"
2523
unit_test:
2624
name: Error if finalized spec modified
2725
needs: change_check
2826
if: ${{ needs.change_check.outputs.modified }}
2927
runs-on: ubuntu-latest
3028
steps:
31-
- name: Fail if specs modified
32-
run: exit 1
29+
- name: Fail if specs modified
30+
run: exit 1

.github/workflows/npm-publish.yml

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,25 @@
11
name: Publish npmjs Package
2-
32
on:
43
release:
54
types: [published]
6-
75
permissions:
86
id-token: write # Required for npm trusted publishing (OIDC)
97
contents: read
10-
118
jobs:
129
deploy:
1310
runs-on: ubuntu-latest
1411
steps:
1512
- uses: actions/checkout@v6
13+
with:
14+
fetch-depth: 0
1615
- uses: actions/setup-node@v6
1716
with:
1817
node-version: '24'
1918
registry-url: https://registry.npmjs.org/
20-
- name: Set up Python
21-
uses: actions/setup-python@v6
22-
with:
23-
python-version: 3.9
24-
- name: Cache pip
25-
uses: actions/cache@v5
19+
- name: Set up uv
20+
uses: astral-sh/setup-uv@v7
2621
with:
27-
path: ~/.cache/pip
28-
key: ${{ runner.os }}-pip-py3.9-${{ hashFiles('.github/workflows/npm-publish.yml') }}
29-
- name: Install Python dependencies
30-
run: |
31-
python -m pip install --upgrade pip
32-
pip install pre-commit
33-
- run: make release-npm
22+
enable-cache: true
23+
cache-python: true
24+
- name: Build and publish
25+
run: make release-npm

.github/workflows/pre-commit.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
name: Linting
2-
32
on:
43
push:
54
branches:
6-
- main
5+
- main
76
pull_request:
8-
97
jobs:
108
pre_job:
119
name: Path match check
@@ -24,7 +22,11 @@ jobs:
2422
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
2523
runs-on: ubuntu-latest
2624
steps:
27-
- uses: actions/checkout@v6
28-
- uses: actions/setup-python@v6
29-
- run: pip install setuptools
30-
- uses: pre-commit/[email protected]
25+
- uses: actions/checkout@v6
26+
with:
27+
fetch-depth: 0
28+
- uses: astral-sh/setup-uv@v7
29+
with:
30+
enable-cache: true
31+
cache-python: true
32+
- uses: j178/prek-action@v2

0 commit comments

Comments
 (0)