Skip to content

Commit 0d69e40

Browse files
authored
ci: pin python version in ci jobs (#142)
1 parent a56b332 commit 0d69e40

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

.github/workflows/build-test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
name: Test package build
1414
runs-on: ubuntu-latest
1515
if: "!startsWith(github.event.head_commit.message, 'bump:')"
16+
env:
17+
PYTHON_VERSION: 3.13
1618
steps:
1719
- name: Check out the repo
1820
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -21,14 +23,14 @@ jobs:
2123
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
2224

2325
- name: Build the package
24-
run: uv build
26+
run: uv build --python $PYTHON_VERSION
2527

2628
- name: List built artifacts
2729
run: ls -la dist/
2830

2931
- name: Install the built wheel
3032
run: |
31-
uv venv
33+
uv venv --python $PYTHON_VERSION
3234
# Find the wheel file and install it
3335
WHEEL_FILE=$(ls dist/*.whl | head -1)
3436
echo "Installing wheel: $WHEEL_FILE"
@@ -64,7 +66,6 @@ jobs:
6466
docker: ${{ steps.docker-changes.outputs.docker }}
6567
workflow: ${{ steps.docker-changes.outputs.workflow }}
6668

67-
6869
test-docker-build:
6970
needs: [should-test-docker-build]
7071
name: Test Docker build
@@ -92,4 +93,3 @@ jobs:
9293
push: false
9394
platforms: linux/amd64,linux/arm64
9495
cache-from: type=registry,ref=ghcr.io/elementsinteractive/lightman-ai:buildcache
95-

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
2020

2121
- name: Install the project
22-
run: uv sync --locked --group lint --group test --all-extras
22+
run: uv sync --locked --group lint --group test --all-extras --python 3.13
2323

2424
- name: Cache mypy cache
2525
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.2.1

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
2525
- name: Publish to pypi
2626
run: |
27-
uv build
27+
uv build --python 3.13
2828
uv publish
2929
3030
push_to_docker_hub:
@@ -59,8 +59,8 @@ jobs:
5959
context: .
6060
image-name: elementsinteractive/lightman-ai
6161
cache-from: type=registry,ref=ghcr.io/elementsinteractive/lightman-ai:buildcache
62-
cache-to: type=registry,ref=ghcr.io/elementsinteractive/lightman-ai:buildcache,mode=max,compression=zstd,force-compression=true,oci-mediatypes=true
63-
62+
cache-to: type=registry,ref=ghcr.io/elementsinteractive/lightman-ai:buildcache,mode=max,compression=zstd,force-compression=true,oci-mediatypes=true
63+
6464
- name: Delete old cache entries
6565
env:
6666
GH_TOKEN: ${{ github.token }}

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6.8.0
2020

2121
- name: Install the project
22-
run: uv sync --locked --group test --all-extras
22+
run: uv sync --locked --group test --all-extras --python 3.13
2323

2424
- name: Run tests
2525
run: uv run pytest tests

justfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ python_version :="3.13"
44
run := "uv run"
55
eval_path := "eval/cli.py"
66

7-
venv-exists := path_exists(venv)
7+
venv_exists := path_exists(venv)
88

99

1010
target_dirs := "src tests eval"
@@ -16,9 +16,9 @@ help:
1616

1717
# Cleans all artifacts generated while running this project, including the virtualenv.
1818
venv:
19-
@if ! {{ venv-exists }}; \
19+
@if ! {{ venv_exists }}; \
2020
then \
21-
uv sync --frozen --all-extras --all-groups; \
21+
uv sync --frozen --all-extras --all-groups --python {{ python_version }}; \
2222
fi
2323

2424
# Runs the evaluation script

0 commit comments

Comments
 (0)