|
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}")') |
3 | | - |
4 | | -# Generate requirements filename based on Python version |
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 dependencies for all Python versions using pyenv: |
21 | | -# rm -rf .venv* requirements-dev-py*.txt |
22 | | -# for v in 3.8 3.9 3.10 3.11 3.12 3.13; do |
23 | | -# pyenv local $v |
24 | | -# make dev-env update-dev-dep-lockfile |
25 | | -# done |
26 | | - |
27 | | -dev-env: |
28 | | - python -m venv .venv$(PYTHON_VERSION) |
| 1 | +dev: |
| 2 | + python3 -m venv .venv |
29 | 3 | ifeq ($(OS), Windows_NT) |
30 | | - .venv$(PYTHON_VERSION)\Scripts\activate |
| 4 | + .venv\Scripts\activate |
31 | 5 | else |
32 | | - . .venv$(PYTHON_VERSION)/bin/activate |
| 6 | + . .venv/bin/activate |
33 | 7 | endif |
34 | | - |
35 | | -dev: dev-env |
36 | | - # Install all dependencies from the version-specific requirements file |
37 | | - # Regenerate this file with `make update-dev-dep-lockfile PYTHON_VERSION=X.Y` |
38 | | - pip install -r $(REQUIREMENTS_FILE) |
39 | | - |
40 | | -dev-latest: dev-env |
41 | | - # Install all dependencies from the pyproject.toml file |
42 | 8 | pip install '.[dev]' |
43 | 9 |
|
44 | | -install-pip-tools: |
45 | | - pip install pip-tools |
46 | | - |
47 | | -update-dev-dep-lockfile: install-pip-tools |
48 | | - pip-compile pyproject.toml --extra dev --output-file $(REQUIREMENTS_FILE) |
49 | | - |
50 | 10 | install: |
51 | 11 | pip install . |
52 | 12 |
|
|
0 commit comments