diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 99990350..5da8b226 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -6,33 +6,42 @@ on: jobs: test-python: runs-on: ubuntu-latest + strategy: + matrix: + py-version: ["3.9", "3.12"] steps: - name: Checkout code uses: actions/checkout@v4 - name: Py-prep - run: make py-prep + run: make py-prep PY_VERSION=${{ matrix.py-version }} - name: Check Format run: uvx ruff format --check - name: Lint run: uvx ruff check --fix sematic - name: MyPy + if: matrix.py-version == '3.12' run: uv run mypy -p sematic --disable-error-code import-untyped - name: Test run: | source .venv/bin/activate + python3 -c "import sys; print(sys.version)" pytest - name: Check Schemas + if: matrix.py-version == '3.12' run: git checkout . && make migrate_up_sqlite && make update-schema && git diff --exit-code - name: Wheel + if: matrix.py-version == '3.12' run: | make ui make uv-wheel - uses: actions/upload-artifact@v4 + if: matrix.py-version == '3.12' with: name: sematic-wheel path: "./dist/sematic-*.whl" retention-days: 10 - uses: actions/upload-artifact@v4 + if: matrix.py-version == '3.12' with: name: sematic-wheel-test path: "sematic/tests/integration/test_pip_install.sh" diff --git a/Makefile b/Makefile index f31147bf..e026eb5f 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,7 @@ SHELL=/bin/bash UNAME_S := $(shell uname -s) RED := \033[0;31m NO_COLOR := \033[1;0m +PY_VERSION := "3.12" migrate_up_rds: cd sematic; DATABASE_URL=${DATABASE_URL} dbmate -s db/schema.sql.pg up @@ -33,7 +34,7 @@ fix: py-prep: uv --version || curl -LsSf https://astral.sh/uv/install.sh | sh rm -rf ".venv" || echo "No virtualenv yet" - uv venv --python 3.12 + uv venv --python $(PY_VERSION) uv sync --extra examples --extra ray uv tool install --force ruff==0.8.3 uv pip install mypy==1.13.0 diff --git a/sematic/tests/test_3_10_function.py b/sematic/tests/test_3_10_function.py index 8bc96941..eab627a9 100644 --- a/sematic/tests/test_3_10_function.py +++ b/sematic/tests/test_3_10_function.py @@ -1,3 +1,5 @@ +import sys + # Third-party import pytest @@ -6,6 +8,7 @@ from sematic.runners.silent_runner import SilentRunner +@pytest.mark.skipif(sys.version_info < (3, 10), reason="Requires python >=3.10") def test_decorator_3_10_style_hints(): @func def f(a: list[int], b: dict[str, str]) -> int | float: