change python version in tests from 3.7 to 3.9

This commit is contained in:
Kay0u 2021-03-10 11:30:28 +01:00 committed by Alexandre Aubin
parent 8aae994720
commit 7ff1ce5432
2 changed files with 13 additions and 14 deletions

View file

@ -3,21 +3,20 @@
######################################## ########################################
# later we must fix lint and format-check jobs and remove "allow_failure" # later we must fix lint and format-check jobs and remove "allow_failure"
--- lint39:
lint37:
stage: lint stage: lint
image: "before-install" image: "before-install"
needs: [] needs: []
allow_failure: true allow_failure: true
script: script:
- tox -e py37-lint - tox -e py39-lint
invalidcode37: invalidcode39:
stage: lint stage: lint
image: "before-install" image: "before-install"
needs: [] needs: []
script: script:
- tox -e py37-invalidcode - tox -e py39-invalidcode
format-check: format-check:
stage: lint stage: lint
@ -25,7 +24,7 @@ format-check:
allow_failure: true allow_failure: true
needs: [] needs: []
script: script:
- tox -e py37-black-check - tox -e py39-black-check
format-run: format-run:
stage: lint stage: lint
@ -40,7 +39,7 @@ format-run:
script: script:
# create a local branch that will overwrite distant one # create a local branch that will overwrite distant one
- git checkout -b "ci-format-${CI_COMMIT_REF_NAME}" --no-track - git checkout -b "ci-format-${CI_COMMIT_REF_NAME}" --no-track
- tox -e py37-black-run - tox -e py39-black-run
- '[ $(git diff | wc -l) != 0 ] || exit 0' # stop if there is nothing to commit - '[ $(git diff | wc -l) != 0 ] || exit 0' # stop if there is nothing to commit
- git commit -am "[CI] Format code" || true - git commit -am "[CI] Format code" || true
- git push -f origin "ci-format-${CI_COMMIT_REF_NAME}":"ci-format-${CI_COMMIT_REF_NAME}" - git push -f origin "ci-format-${CI_COMMIT_REF_NAME}":"ci-format-${CI_COMMIT_REF_NAME}"

14
tox.ini
View file

@ -1,13 +1,13 @@
[tox] [tox]
envlist = py37-{lint,invalidcode},py37-black-{run,check} envlist = py39-{lint,invalidcode},py39-black-{run,check}
[testenv] [testenv]
skip_install=True skip_install=True
deps = deps =
py37-{lint,invalidcode}: flake8 py39-{lint,invalidcode}: flake8
py37-black-{run,check}: black py39-black-{run,check}: black
commands = commands =
py37-lint: flake8 src doc data tests --ignore E402,E501,E203,W503 --exclude src/yunohost/vendor py39-lint: flake8 src doc data tests --ignore E402,E501,E203,W503 --exclude src/yunohost/vendor
py37-invalidcode: flake8 src data --exclude src/yunohost/tests,src/yunohost/vendor --select F py39-invalidcode: flake8 src data --exclude src/yunohost/tests,src/yunohost/vendor --select F
py37-black-check: black --check --diff src doc data tests py39-black-check: black --check --diff src doc data tests
py37-black-run: black src doc data tests py39-black-run: black src doc data tests