diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 56910d3d18b706f21d1cdccfc35927aa4992df0f..1a7e7c6ed0093c65ca0b0c6782d3c74e436edcbb 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,5 +5,6 @@ "ghcr.io/devcontainers-contrib/features/nox:2": {}, "ghcr.io/devcontainers-contrib/features/pre-commit:2": {} }, - "postCreateCommand": "pre-commit install" + "postCreateCommand": "sudo apt-get install graphviz graphviz-dev", + "postStartCommand": "pre-commit install" } diff --git a/.github/workflows/unit.yaml b/.github/workflows/unit.yaml index 88addbf066070a7b9c28c991e040dc149420909d..afa0213404f6a3ee80ca9f74d8e3ce90b5eacba6 100644 --- a/.github/workflows/unit.yaml +++ b/.github/workflows/unit.yaml @@ -35,6 +35,11 @@ jobs: strategy: matrix: python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + sqlachemy-version: [""] + include: + # oldest python/sqlalchemy supported + python-version: "3.8" + sqlalchemy-version: "1.4" services: eralchemy-db: image: postgres:alpine @@ -66,7 +71,7 @@ jobs: - name: Install nox run: pip install nox - name: Test with pytest - run: nox -s ci_test + run: nox -s ci_test -- ${{ matrix.sqlalchemy-version }} - uses: actions/upload-artifact@v4 if: ${{ matrix.python-version == '3.10' }} with: diff --git a/noxfile.py b/noxfile.py index 1bf81264a591bd3cca1790113258a6164824d6e3..57a60755a9fcc0c7266d54e4d2c7079da7fcec23 100644 --- a/noxfile.py +++ b/noxfile.py @@ -25,10 +25,14 @@ def docs(session): @nox.session(reuse_venv=True) def ci_test(session): - """Run the tests report coverage in xml format.""" + """Run the tests report coverage in xml format. + + This is used by the CI and can update the version of sqlalchemy with the posargs. + """ session.install(".[test]") - test_files = session.posargs or ["tests"] - session.run("pytest", "--color=yes", "--cov", "--cov-report=xml", *test_files) + version = f"=={session.posargs[0]}" if session.posargs else "" + session.install(f"sqlalchemy{version}") + session.run("pytest", "--color=yes", "--cov", "--cov-report=xml", "tests") @nox.session(reuse_venv=True) diff --git a/pyproject.toml b/pyproject.toml index ef3f1cc3ebb2e0494be43c02791c1a9085805b4a..bdad3cc97bb160fec245b282c1a842aaae83faa3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,15 +39,11 @@ test = [ "psycopg2 >= 2.9.3", "pytest >= 7.4.3", "pytest-cov", -graphviz = ["graphviz >= 0.20.3"] -pygraphviz = ["pygraphviz >= 1.9"] -ci = [ - "flask-sqlalchemy >= 2.5.1", - "psycopg2 >= 2.9.3", - "pytest >= 7.4.3", "pygraphviz >= 1.9", "graphviz >= 0.20.3", ] +graphviz = ["graphviz >= 0.20.3"] +pygraphviz = ["pygraphviz >= 1.9"] dev = [ "nox", "pre-commit"