Skip to content

Commit a985698

Browse files
committed
fix
1 parent 935ec41 commit a985698

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ jobs:
3434
shell: bash
3535
run: |
3636
if [ "${{ matrix.dep-type }}" = "latest" ]; then
37-
make dev-latest test PYTHON_VERSION=${{ inputs.pyVersion }}
37+
make dev-latest test
3838
else
39-
make dev test PYTHON_VERSION=${{ inputs.pyVersion }}
39+
make dev test
4040
fi
4141
4242
- name: Publish test coverage

Makefile

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,34 @@
1-
# Default Python version if not specified
2-
# This is expected to have the form X.Y.
3-
# The corresponding requirements file is requirements-dev-pyXY.txt.
4-
PYTHON_VERSION ?= 3.13
5-
PYTHON_VERSION_NO_DOTS = $(subst .,,$(PYTHON_VERSION))
1+
# Detect Python version from the system
2+
PYTHON_VERSION := $(shell python3 -c 'import sys; print(f"{sys.version_info.major}{sys.version_info.minor}")')
63

74
# Generate requirements filename based on Python version
8-
REQUIREMENTS_FILE = requirements-dev-py$(PYTHON_VERSION_NO_DOTS).txt
9-
10-
# A quick one-liner to update all environments using pyenv:
5+
REQUIREMENTS_FILE = requirements-dev-py$(PYTHON_VERSION).txt
6+
7+
# Testing workflow:
8+
# 1. GitHub Actions runs tests for each Python version (3.8-3.12) on multiple OSes
9+
# 2. For each Python version, tests run in two modes:
10+
# - 'latest': Uses dependencies directly from pyproject.toml
11+
# - 'frozen': Uses version-specific requirements-dev-pyXY.txt
12+
# 3. Each Python version gets its own virtual environment (.venvXY)
13+
# 4. Tests are only blocking in `frozen` mode. Tests run in `latest` mode are
14+
# allowed to fail and serve as a warning that there may have been a breaking
15+
# change in a dependency.
16+
# 5. To run tests locally:
17+
# - make dev test # uses frozen dependencies
18+
# - make dev-latest test # uses latest dependencies
19+
#
20+
# To update all Python versions using pyenv:
1121
# for v in 3.8 3.9 3.10 3.11 3.12 3.13; do
1222
# pyenv local $v
13-
# make dev-env update-dev-dep-lockfile PYTHON_VERSION=$v
23+
# make dev-env update-dev-dep-lockfile
1424
# done
1525

1626
dev-env:
17-
python -m venv .venv$(PYTHON_VERSION_NO_DOTS)
27+
python -m venv .venv$(PYTHON_VERSION)
1828
ifeq ($(OS), Windows_NT)
19-
.venv$(PYTHON_VERSION_NO_DOTS)\Scripts\activate
29+
.venv$(PYTHON_VERSION)\Scripts\activate
2030
else
21-
. .venv$(PYTHON_VERSION_NO_DOTS)/bin/activate
31+
. .venv$(PYTHON_VERSION)/bin/activate
2232
endif
2333

2434
dev: dev-env

0 commit comments

Comments
 (0)