Skip to content

Commit

Permalink
SQLAlchemy 2.0 Support with 3.9/3.10/3.11 tests by NOX
Browse files Browse the repository at this point in the history
* Simplified pyproject.toml

* Implement Nox and tests for 3.9 / 3.10 / 3.11 in both SQLA 1.4 and 2.0

* Implement multiple version testing in Github Actions using the matrix strategy.
  • Loading branch information
flipbit03 authored Jun 19, 2023
1 parent 8016bb4 commit d50e718
Show file tree
Hide file tree
Showing 14 changed files with 784 additions and 1,553 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.7.2
current_version = 0.8.0
commit = True
tag = False

Expand Down
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.pytest_cache
.tox
.nox
dist
24 changes: 0 additions & 24 deletions .github/workflows/test.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/test_matrix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Multiple Python Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main, "*" ]
workflow_dispatch:

jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [ "3.9", "3.10", "3.11" ]
steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install poetry
poetry install
- name: Run Tests
run: |
poetry run nox -p ${{ matrix.python-version }}
- name: Show Test Logs if tests failed
if: ${{ failure() }}
run: docker compose logs
4 changes: 3 additions & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
3.10.1
3.9
3.10
3.11
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ COPY tests tests

RUN poetry install

RUN poetry install -E test

FROM content as testing_and_coverage

CMD sleep 2 && poetry run pytest --cov=sqlalchemy_easy_softdelete --cov-branch --cov-report=term-missing --cov-report=xml tests
10 changes: 10 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import nox


@nox.session(python=("3.9", "3.10", "3.11"))
@nox.parametrize("sqla_version", ["2.0.16", "1.4.48"])
def tests(session, sqla_version):
session.install(f'SQLAlchemy=={sqla_version}')
session.install('pytest')
session.install('snapshottest')
session.run('pytest')
Loading

0 comments on commit d50e718

Please sign in to comment.