Skip to content

Update tox to use the latest python versions #47

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[paths]
source =
src/
.tox/*/lib/*/site-packages/
69 changes: 35 additions & 34 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: 3.11
- name: Install dependencies
run: pip install tox
- name: Validate formatting
Expand All @@ -23,30 +23,30 @@ jobs:
max-parallel: 4
matrix:
tox_env:
- py36-django22
- py36-django30
- py37-django22
- py37-django30
- py38-django22
- py38-django30
- py311-django42
- py311-django52
- py312-django42
- py312-django52
- py313-django42
- py313-django52
include:
- python-version: 3.6
tox_env: py36-django22
- python-version: 3.6
tox_env: py36-django30
- python-version: 3.7
tox_env: py37-django22
- python-version: 3.7
tox_env: py37-django30
- python-version: 3.8
tox_env: py38-django22
- python-version: 3.8
tox_env: py38-django30
- python-version: 3.11
tox_env: py311-django42
- python-version: 3.11
tox_env: py311-django52
- python-version: 3.12
tox_env: py312-django42
- python-version: 3.12
tox_env: py312-django52
- python-version: 3.13
tox_env: py313-django42
- python-version: 3.13
tox_env: py313-django52

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -57,28 +57,29 @@ jobs:
run: tox -e ${{ matrix.tox_env }}
- name: Prepare artifacts
run: mkdir .coverage-data && mv .coverage.* .coverage-data/
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: coverage-data
name: coverage-data-${{ matrix.tox_env }}
include-hidden-files: true
path: .coverage-data/

coverage:
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@master
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
name: coverage-data
path: .
- name: Set up Python 3.7
uses: actions/setup-python@v1
python-version: 3.11
- uses: actions/download-artifact@v4
with:
python-version: 3.7
pattern: coverage-data-*
merge-multiple: true
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
pip install tox tox-gh-actions coverage[toml]
- name: Prepare Coverage report
run: tox -e coverage-report
- name: Upload to codecov
Expand Down
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import find_packages, setup

install_requires = [
"Django>=1.11",
"Django>=4.2",
"cryptography",
"djangorestframework",
"pyjwt",
Expand All @@ -13,11 +13,11 @@
]

tests_require = [
"coverage[toml]==5.0.3",
"pytest==5.3.5",
"pytest-django==3.8.0",
"pytest-cov==2.8.1",
"pytest-responses==0.4.0",
"coverage[toml]==7.8.2",
"pytest==8.4.0",
"pytest-django==4.11.1",
"pytest-cov==6.1.1",
"pytest-responses==0.5.1",
# Linting
"isort[pyproject]==4.3.21",
"flake8==3.7.9",
Expand Down
4 changes: 2 additions & 2 deletions tests/urls.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from django.conf.urls import url
from django.urls import path
from rest_framework.decorators import api_view, authentication_classes
from rest_framework.response import Response

Expand All @@ -11,4 +11,4 @@ def sample_view(request):
return Response({"hello": "world"})


urlpatterns = [url(r"^$", sample_view, name="sample_view")]
urlpatterns = [path("", sample_view, name="sample_view")]
17 changes: 9 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
[tox]
envlist = py{36,37,38}-django{22,30}
envlist = py{311,312,312}-django{42,52}


[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.11: py311
3.12: py312
3.13: py313

[testenv]
commands = coverage run --source django_cognito_jwt --parallel -m pytest {posargs}
deps =
django22: Django>=2.2,<2.3
django30: Django>=3.0,<3.1
django42: Django>=4.2,<4.3
django52: Django>=5.2,<5.3
extras = test

[testenv:coverage-report]
basepython = python3.7
basepython = python3.11
deps = coverage[toml]
skip_install = true
ignore_errors = true
commands =
coverage combine
coverage xml
coverage report

[testenv:format]
basepython = python3.7
basepython = python3.11
deps =
black
isort[toml]
Expand Down