From 76950f341ec5834c88555002796e508a2386b683 Mon Sep 17 00:00:00 2001 From: Jerin Peter George Date: Thu, 18 Jan 2024 20:50:08 +0530 Subject: [PATCH] Integrate tox --- .github/workflows/code-quality.yml | 5 +++-- pyproject.toml | 1 - tox.ini | 24 ++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 tox.ini diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index ca8a71a..d53f88a 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -25,7 +25,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ["3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3 @@ -37,6 +37,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -e .[all,test] + pip install tox -U - name: Run Tests run: | - python -m pytest --cov=src --cov-fail-under=100 + tox diff --git a/pyproject.toml b/pyproject.toml index cca84c5..c6fea24 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,7 +49,6 @@ all = [ test = [ "pytest==7.4.3", "pytest-django==4.7.0", - "pytest-httpx==0.27.0", "pytest-cov==4.1.0", "pytest-mock==3.12.0", ] diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..e646163 --- /dev/null +++ b/tox.ini @@ -0,0 +1,24 @@ +[tox] +env_list = + {py38,py39}-django30 + {py38,py39}-django31 + {py38,py39,py310}-django32 + {py38,py39,py310}-{django40,django41,django42,django50} + {py311}-{django41,django42,django50} +minversion = 4.11.1 + +[testenv] +description = run the tests with pytest +package = wheel +wheel_build_env = .pkg +commands = python -m pytest --cov=src --cov-fail-under=100 +deps = + -e .[all, test] + django31: Django>=3.1,<3.2 + django32: Django>=3.2,<4.0 + django40: Django>=4.0,<4.1 + django41: Django>=4.1,<4.2 + django42: Django>=4.2,<5.0 +setenv = + PYTHONPATH = {toxinidir} + PYTHONUNBUFFERED=yes