Commit f1c38d1c authored by Petr Špaček's avatar Petr Špaček

deckard: drop Python 2 support

Right now I'm not aware of any reason to invest into Python 2 any further.
parent 49992167
Pipeline #13465 passed with stage
in 1 minute and 13 seconds
......@@ -4,25 +4,25 @@ variables:
stages:
- test
test:python2:pep8:
test:pep8:
image: cznic/deckard-ci
stage: test
script:
- cp ci/common.sh /tmp
- cp ci/compare-pep8.sh /tmp
- PYTHON=python2 /tmp/compare-pep8.sh
- /tmp/compare-pep8.sh
tags:
- docker
- linux
- amd64
test:python2:pylint:
test:pylint:
image: cznic/deckard-ci
stage: test
script:
- cp ci/common.sh /tmp
- cp ci/compare-pylint.sh /tmp
- PYTHON=python2 /tmp/compare-pylint.sh
- /tmp/compare-pylint.sh
artifacts:
when: on_failure
expire_in: '1 hour'
......@@ -34,84 +34,23 @@ test:python2:pylint:
- linux
- amd64
test:python2:unittests:
test:unittests:
image: cznic/deckard-ci
stage: test
script:
- make check PYTHON=python2
- make check
tags:
- docker
- linux
- amd64
test:python2:comparative:kresd:
test:comparative:kresd:
image: cznic/deckard-ci
stage: test
script:
- cp ci/common.sh /tmp
- cp ci/compare-tests.sh /tmp
- PYTHON=python2 /tmp/compare-tests.sh $(pwd)/kresd_run.sh
artifacts:
when: always
expire_in: '1 hour'
paths:
- modified_tests
- base.log
- base.tests
- head.log
- head.tests
tags:
- docker
- linux
- amd64
test:python3:pep8:
image: cznic/deckard-ci
stage: test
script:
- cp ci/common.sh /tmp
- cp ci/compare-pep8.sh /tmp
- PYTHON=python3 /tmp/compare-pep8.sh
tags:
- docker
- linux
- amd64
test:python3:pylint:
image: cznic/deckard-ci
stage: test
script:
- cp ci/common.sh /tmp
- cp ci/compare-pylint.sh /tmp
- PYTHON=python3 /tmp/compare-pylint.sh
artifacts:
when: on_failure
expire_in: '1 hour'
paths:
- base.log
- head.log
tags:
- docker
- linux
- amd64
test:python3:unittests:
image: cznic/deckard-ci
stage: test
script:
- make check PYTHON=python3
tags:
- docker
- linux
- amd64
test:python3:comparative:kresd:
image: cznic/deckard-ci
stage: test
script:
- cp ci/common.sh /tmp
- cp ci/compare-tests.sh /tmp
- PYTHON=python3 /tmp/compare-tests.sh $(pwd)/kresd_run.sh
- /tmp/compare-tests.sh $(pwd)/kresd_run.sh
artifacts:
when: always
expire_in: '1 hour'
......@@ -128,7 +67,7 @@ test:python3:comparative:kresd:
# Run all tests on the latest kresd version to ensure that we not push tests
# which do not work on latest kresd. It would lead to breakage in kresd CI.
test:python3:latest:kresd:
test:latest:kresd:
image: cznic/deckard-ci
stage: test
script:
......@@ -146,11 +85,10 @@ test:python3:latest:kresd:
# sanity check that Unbound under Deckard still works
# I've selected the only tests which are working
# on kresd and Unbound 1.5.8 as well as 1.6.0
test:python3:sanity:unbound:
test:sanity:unbound:
image: cznic/deckard-ci
stage: test
script:
- export PYTHON=python3
- TESTS=sets/resolver/iter_hint_lame.rpl ./unbound_run.sh
- TESTS=sets/resolver/iter_lame_root.rpl ./unbound_run.sh
# these do not work with Unbound 1.5.8 which is in CI container
......@@ -164,11 +102,10 @@ test:python3:sanity:unbound:
# sanity check that PowerDNS recursor under Deckard still works
# I've selected couple tests which are working
# on kresd and PowerDNS recursor 4.0.0~alpha2 as well as 4.0.4
test:python3:sanity:pdnsrecursor:
test:sanity:pdnsrecursor:
image: cznic/deckard-ci
stage: test
script:
- export PYTHON=python3
- TESTS=sets/resolver/iter_recurse.rpl ./pdns_run.sh
- TESTS=sets/resolver/iter_tcbit.rpl ./pdns_run.sh
tags:
......
......@@ -4,7 +4,7 @@ DAEMON ?= kresd
TEMPLATE ?= template/kresd.j2
CONFIG ?= config
PYTHON ?= python
PYTHON ?= python3
LIBEXT := .so
PLATFORM := $(shell uname -s)
ifeq ($(PLATFORM),Darwin)
......@@ -67,4 +67,4 @@ $(libcwrap): $(libcwrap_cmake_DIR)/Makefile
check:
@echo Running unittests using pytest
${PYTHON} -m pytest
\ No newline at end of file
${PYTHON} -m pytest
......@@ -23,7 +23,7 @@ Requirements
Deckard requires following software to be installed:
- Python >= 2.7
- Python >= 3.3
- dnspython_ - DNS library for Python
- Jinja2_ - template engine for generating config files
- PyYAML_ - YAML parser for Python
......
......@@ -14,9 +14,7 @@ RUN apt-get upgrade -y
RUN apt-get install -y knot-resolver
RUN apt-get install -y unbound
RUN apt-get install -y pdns-recursor
RUN apt-get install -y python-augeas python-pep8 pylint python-pip python-jinja2 python-yaml python-pytest
RUN apt-get install -y python3-augeas python3-pep8 pylint3 python3-pip python3-jinja2 python3-yaml python3-pytest
# version of dnspython in Ubuntu repository is f**ked up
RUN pip install --upgrade dnspython selenium xvfbwrapper
RUN pip3 install --upgrade dnspython selenium xvfbwrapper
......@@ -3,7 +3,7 @@ set -o errexit -o nounset
HEAD="$(git log -1 --format="%H" HEAD)"
MERGEBASE="$(git merge-base origin/master "${HEAD}")"
LOGDIR="$(pwd)"
PYTHON=${PYTHON:-"python"}
PYTHON=${PYTHON:-"python3"}
# workaround for Gitlab's missing support for absolute paths in artifacts:
# https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/1011
......
......@@ -19,22 +19,17 @@ test -n "${STATUS}" && echo "Working tree is dirty, commit your changes now." &&
trap checkout_back EXIT
trap "{ FAILURE_DETECTED=1; }" ERR
for PYTHON in python2 python3
do
export PYTHON
"${CIDIR}"/compare-pylint.sh
checkout_back
git clean -xdf
"${CIDIR}"/compare-pep8.sh
checkout_back
git clean -xdf
"${CIDIR}"/compare-tests.sh "${CIDIR}/../kresd_run.sh"
checkout_back
git clean -xdf
done
"${CIDIR}"/compare-pylint.sh
checkout_back
git clean -xdf
"${CIDIR}"/compare-pep8.sh
checkout_back
git clean -xdf
"${CIDIR}"/compare-tests.sh "${CIDIR}/../kresd_run.sh"
checkout_back
git clean -xdf
# at this point all the tests passed so we can clean up
git clean -xdf
......
#!/usr/bin/env python
#!/usr/bin/env python3
import argparse
from datetime import datetime
import errno
......
#!/usr/bin/env python
#!/usr/bin/env python3
import logging
......
#!/usr/bin/env python
#!/usr/bin/env python3
import sys
from distutils.core import setup
......@@ -17,6 +17,7 @@ kwargs = {
'license': 'BSD',
'url': 'https://github.com/CZ-NIC/deckard',
'packages': ['pydnstest'],
'python_requires': '>=3.3',
'install_requires': [
'dnspython>=1.15',
'jinja2',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment