Skip to content

Commit

Permalink
tests: enable for python 3.10, drop django-nose (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
eshaan7 committed Jan 20, 2022
1 parent 384d89c commit e4929a6
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 30 deletions.
13 changes: 4 additions & 9 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 5
max-parallel: 6
matrix:
python-version: ['3.5', '3.6', '3.7', '3.8', '3.9']
python-version: ['3.5', '3.6', '3.7', '3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v2
Expand All @@ -22,14 +22,9 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox tox-gh-actions flake8 codecov
pip install -r requirements.dev.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count
- name: Run tox tests
- name: "Test: tox tests"
run: |
# run tests with coverage
tox
Expand Down
3 changes: 0 additions & 3 deletions example_project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"django.contrib.staticfiles",
# extra
"rest_framework",
"django_nose",
# project apps
"durin",
"example_project",
Expand Down Expand Up @@ -73,5 +72,3 @@
USE_TZ = True

STATIC_URL = "/static/"

TEST_RUNNER = "django_nose.NoseTestSuiteRunner"
19 changes: 13 additions & 6 deletions requirements.dev.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# ci
codecov
tox
tox-gh-actions

# lint
black==20.8b1; python_version > '3.5'
flake8==3.8.4; python_version > '3.5'
pre-commit==2.9.2; python_version > '3.5'
isort; python_version > '3.5'

# project
djangorestframework>=3.7.0
humanize
flake8
django-nose
coverage
django-cache-memoize
isort
pytest-django
django-cache-memoize
30 changes: 18 additions & 12 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
[tox]
envlist =
isort,
flake8,
black,
isort,
py{35,36,37,38,39}-django22,
py{36,37,38,39}-django30
py{36,37,38,39}-django31
py{36,37,38,39}-django32
py{36,37,38,39,310}-django30
py{36,37,38,39,310}-django31
py{36,37,38,39,310}-django32

[testenv:flake8]
changedir = {toxinidir}
commands = flake8 .
deps = flake8
changedir = {toxinidir}
commands = flake8 . --count

[testenv:black]
deps = black
changedir = {toxinidir}
commands = black . --check

[testenv:isort]
deps = isort
changedir = {toxinidir}
commands = isort --check-only --diff \
durin/ \
example_project/ \
setup.py \
durin \
example_project \
tests

[testenv]
commands =
python manage.py migrate
python manage.py test --with-coverage
coverage run manage.py test tests --noinput
setenv =
DJANGO_SETTINGS_MODULE = example_project.settings
PIP_INDEX_URL = https://pypi.python.org/simple/
Expand All @@ -44,10 +50,10 @@ python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39, isort, flake8
3.9: py39
3.10: py310, flake8, black, isort

# Configuration for coverage and flake8 is being set in `./setup.cfg`
[testenv:codecov]
passenv = TOXENV CI TRAVIS TRAVIS_* CODECOV_*
passenv = TOXENV CI CODECOV_*
commands = codecov -e TOXENV
deps = codecov>=2.1.10

0 comments on commit e4929a6

Please sign in to comment.