Rationalize testing and fix travis

Test for couple (python version, django version) found in Debian, Ubuntu
and RHEL and if not done, for every supported Django version with the last
version of python

Configure tox to use the locally available python3 then called without parameters
This commit is contained in:
Valentin Samir 2021-06-19 17:21:48 +02:00
parent aeb794fe74
commit 968f4a591f
3 changed files with 171 additions and 165 deletions

View file

@ -1,71 +1,61 @@
language: python language: python
matrix: matrix:
include: include:
# generic checks
- python: "3.9" - python: "3.9"
env: TOX_ENV=flake8 env: TOX_ENV=flake8
- python: "3.9" - python: "3.9"
env: TOX_ENV=check_rst env: TOX_ENV=check_rst
- python: "3.9"
env: TOX_ENV=coverage
# Python 2 support. Not officialy supported but nice to known
# then it will break
- python: "2.7" - python: "2.7"
env: TOX_ENV=py27-django111 env: TOX_ENV=py27-django111
- python: "2.7"
env: TOX_ENV=py27-django111
arch: ppc64le
# Debian strech support
- python: "3.5" - python: "3.5"
env: TOX_ENV=py35-django111 env: TOX_ENV=py35-django111
- python: "3.5"
env: TOX_ENV=py35-django111
arch: ppc64le
# Ubuntu bionic and EPEL 7 support
- python: "3.6" - python: "3.6"
env: TOX_ENV=py36-django111 env: TOX_ENV=py36-django111
- python: "3.6"
env: TOX_ENV=py36-django111
arch: ppc64le
# RHEL 8 support
- python: "3.6"
env: TOX_ENV=py36-django22
- python: "3.6"
env: TOX_ENV=py36-django22
arch: ppc64le
# Debian buster support
- python: "3.7" - python: "3.7"
env: TOX_ENV=py37-django22 env: TOX_ENV=py37-django111
- python: "3.7"
env: TOX_ENV=py37-django111
arch: ppc64le
# Ubuntu focal and Ubuntu groovy support
- python: "3.8" - python: "3.8"
env: TOX_ENV=py38-django22 env: TOX_ENV=py38-django22
- python: "3.8" - python: "3.8"
env: TOX_ENV=py38-django30 env: TOX_ENV=py38-django22
- python: "3.8" arch: ppc64le
env: TOX_ENV=py38-django31 # Debian bullseye and Ubuntu hirsute support
- python: "3.9" - python: "3.9"
env: TOX_ENV=py39-django22 env: TOX_ENV=py39-django22
- python: "3.9" - python: "3.9"
env: TOX_ENV=py39-django30 env: TOX_ENV=py39-django22
arch: ppc64le
# Django additional supported version
- python: "3.9" - python: "3.9"
env: TOX_ENV=py39-django31 env: TOX_ENV=py39-django31
- python: "3.9" - python: "3.9"
env: TOX_ENV=coverage env: TOX_ENV=py39-django32
- python: "3.8"
env: TOX_ENV=flake8
arch: ppc64le
- python: "3.8"
env: TOX_ENV=check_rst
arch: ppc64le
- python: "2.7"
env: TOX_ENV=py27-django111
arch: ppc64le
- python: "3.5"
env: TOX_ENV=py35-django111
arch: ppc64le
- python: "3.6"
env: TOX_ENV=py36-django111
arch: ppc64le
- python: "3.5"
env: TOX_ENV=py35-django20
arch: ppc64le
- python: "3.6"
env: TOX_ENV=py36-django20
arch: ppc64le
- python: "3.5"
env: TOX_ENV=py35-django21
arch: ppc64le
- python: "3.6"
env: TOX_ENV=py36-django21
arch: ppc64le
- python: "3.7"
env: TOX_ENV=py37-django22
arch: ppc64le
- python: "3.8"
env: TOX_ENV=py38-django22
arch: ppc64le
- python: "3.8"
env: TOX_ENV=py38-django30
arch: ppc64le
- python: "3.8"
env: TOX_ENV=coverage
arch: ppc64le
cache: cache:
directories: directories:

View file

@ -1,15 +1,15 @@
.PHONY: build dist docs .PHONY: build dist docs
VERSION=`python setup.py -V` VERSION=`python3 setup.py -V`
build: build:
python setup.py build python3 setup.py build
install: dist install: dist
pip -V pip3 -V
pip install --no-cache-dir --no-deps --upgrade --force-reinstall --find-links ./dist/django-cas-server-${VERSION}.tar.gz django-cas-server pip3 install --no-cache-dir --no-deps --upgrade --force-reinstall --find-links ./dist/django-cas-server-${VERSION}.tar.gz django-cas-server
uninstall: uninstall:
pip uninstall django-cas-server || true pip3 uninstall django-cas-server || true
clean_pyc: clean_pyc:
find ./ -name '*.pyc' -delete find ./ -name '*.pyc' -delete
@ -34,11 +34,11 @@ clean: clean_pyc clean_build clean_coverage clean_tild_backup
clean_all: clean clean_tox clean_test_venv clean_docs clean_eggs clean_all: clean clean_tox clean_test_venv clean_docs clean_eggs
dist: dist:
python setup.py sdist python3 setup.py sdist
test_venv/bin/python: test_venv/bin/python:
python3 -m venv test_venv python3 -m venv test_venv
test_venv/bin/pip install -U --requirement requirements-dev.txt 'Django>=2.0,<2.1' test_venv/bin/pip install -U --requirement requirements-dev.txt 'Django>=3.2,<3.3'
test_venv/cas/manage.py: test_venv test_venv/cas/manage.py: test_venv
mkdir -p test_venv/cas mkdir -p test_venv/cas
@ -61,7 +61,7 @@ run_server: test_project
test_venv/bin/python test_venv/cas/manage.py runserver test_venv/bin/python test_venv/cas/manage.py runserver
run_tests: test_venv run_tests: test_venv
python setup.py check --restructuredtext --stric python3 setup.py check --restructuredtext --stric
test_venv/bin/py.test -rw -x --cov=cas_server --cov-report html --cov-report term test_venv/bin/py.test -rw -x --cov=cas_server --cov-report html --cov-report term
rm htmlcov/coverage_html.js # I am really pissed off by those keybord shortcuts rm htmlcov/coverage_html.js # I am really pissed off by those keybord shortcuts
@ -72,4 +72,4 @@ docs: test_venv/bin/sphinx-build
bash -c "source test_venv/bin/activate; cd docs; make html" bash -c "source test_venv/bin/activate; cd docs; make html"
publish_pypi_release: publish_pypi_release:
python setup.py sdist bdist_wheel upload --sign python3 setup.py sdist bdist_wheel upload --sign

238
tox.ini
View file

@ -3,21 +3,14 @@ envlist=
flake8, flake8,
check_rst, check_rst,
py27-django111, py27-django111,
py35-django111, py3-django111,
py36-django111, py3-django22,
py37-django111, py3-django31,
py36-django22, py3-django32,
py37-django22,
py38-django22, ##################
py39-django22, # generic config #
py36-django30, ##################
py37-django30,
py38-django30,
py39-django30,
py36-django31,
py37-django31,
py38-django31,
py39-django31,
[flake8] [flake8]
max-line-length=100 max-line-length=100
@ -43,102 +36,9 @@ commands=
{[post_cmd]commands} {[post_cmd]commands}
whitelist_externals={[post_cmd]whitelist_externals} whitelist_externals={[post_cmd]whitelist_externals}
[testenv:py27-django111] ###################
basepython=python2.7 # genercic checks #
deps = ###################
Django>=1.11,<1.12
{[base]deps}
[testenv:py35-django111]
basepython=python3.5
deps =
Django>=1.11,<1.12
{[base]deps}
[testenv:py36-django111]
basepython=python3.6
deps =
Django>=1.11,<1.12
{[base]deps}
[testenv:py37-django111]
basepython=python3.7
deps =
Django>=1.11,<1.12
{[base]deps}
[testenv:py36-django22]
basepython=python3.6
deps =
Django>=2.2,<3.0
{[base]deps}
[testenv:py37-django22]
basepython=python3.7
deps =
Django>=2.2,<3.0
{[base]deps}
[testenv:py38-django22]
basepython=python3.8
deps =
Django>=2.2,<3.0
{[base]deps}
[testenv:py39-django22]
basepython=python3.9
deps =
Django>=2.2,<3.0
{[base]deps}
[testenv:py36-django30]
basepython=python3.6
deps =
Django>=3.0,<3.1
{[base]deps}
[testenv:py37-django30]
basepython=python3.7
deps =
Django>=3.0,<3.1
{[base]deps}
[testenv:py38-django30]
basepython=python3.8
deps =
Django>=3.0,<3.1
{[base]deps}
[testenv:py39-django30]
basepython=python3.9
deps =
Django>=3.0,<3.1
{[base]deps}
[testenv:py36-django31]
basepython=python3.6
deps =
Django>=3.1,<3.2
{[base]deps}
[testenv:py37-django31]
basepython=python3.7
deps =
Django>=3.1,<3.2
{[base]deps}
[testenv:py38-django31]
basepython=python3.8
deps =
Django>=3.1,<3.2
{[base]deps}
[testenv:py39-django31]
basepython=python3.9
deps =
Django>=3.1,<3.2
{[base]deps}
[testenv:flake8] [testenv:flake8]
basepython=python3 basepython=python3
@ -177,3 +77,119 @@ commands=
{toxinidir}/.update_coverage "{toxinidir}" "django-cas-server" {toxinidir}/.update_coverage "{toxinidir}" "django-cas-server"
{[post_cmd]commands} {[post_cmd]commands}
whitelist_externals={[post_cmd]whitelist_externals} whitelist_externals={[post_cmd]whitelist_externals}
####################
# Python 2 support #
####################
[testenv:py27-django111]
basepython=python2.7
deps =
Django>=1.11,<1.12
{[base]deps}
##################################
# Generic Python 3 for local use #
##################################
[testenv:py3-django111]
basepython=python3
deps =
Django>=1.11,<1.12
{[base]deps}
[testenv:py3-django22]
basepython=python3
deps =
Django>=2.2,<2.3
{[base]deps}
[testenv:py3-django31]
basepython=python3
deps =
Django>=3.1,<3.2
{[base]deps}
[testenv:py3-django32]
basepython=python3
deps =
Django>=3.2,<3.3
{[base]deps}
#########################
# Debian strech support #
#########################
[testenv:py35-django111]
basepython=python3.5
deps =
Django>=1.11,<1.12
{[base]deps}
####################################
# Ubuntu bionic and EPEL 7 support #
####################################
[testenv:py36-django111]
basepython=python3.6
deps =
Django>=1.11,<1.12
{[base]deps}
##################
# RHEL 8 support #
##################
[testenv:py36-django22]
basepython=python3.6
deps =
Django>=2.2,<3.0
{[base]deps}
#########################
# Debian buster support #
#########################
[testenv:py37-django111]
basepython=python3.7
deps =
Django>=1.11,<1.12
{[base]deps}
##########################################
# Ubuntu focal and Ubuntu groovy support #
##########################################
[testenv:py38-django22]
basepython=python3.8
deps =
Django>=2.2,<3.0
{[base]deps}
##############################################
# Debian bullseye and Ubuntu hirsute support #
##############################################
[testenv:py39-django22]
basepython=python3.9
deps =
Django>=2.2,<3.0
{[base]deps}
#######################################
# Django additional supported version #
#######################################
[testenv:py39-django31]
basepython=python3.9
deps =
Django>=3.1,<3.2
{[base]deps}
[testenv:py39-django32]
basepython=python3.9
deps =
Django>=3.2,<3.3
{[base]deps}