diff --git a/.zuul.yaml b/.zuul.yaml index 06dd412..5146989 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -2,8 +2,8 @@ check: jobs: - tox-pep8 - - tox-py27 + - tox-py37 gate: jobs: - tox-pep8 - - tox-py27 + - tox-py37 diff --git a/gerritbot/bot.py b/gerritbot/bot.py index 73fdd9c..c711d5b 100755 --- a/gerritbot/bot.py +++ b/gerritbot/bot.py @@ -15,6 +15,31 @@ # License for the specific language governing permissions and limitations # under the License. +import configparser +import daemon +from ib3.auth import SASL +from ib3.connection import SSL +import irc.bot +import json +import logging.config +import os +import re +import sys +import threading +import time +import yaml + +import paho.mqtt.client as mqtt + +try: + import daemon.pidlockfile + pid_file_module = daemon.pidlockfile +except Exception: + # as of python-daemon 1.6 it doesn't bundle pidlockfile anymore + # instead it depends on lockfile-0.9.1 + import daemon.pidfile + pid_file_module = daemon.pidfile + # The configuration file should look like: """ [ircbot] @@ -53,31 +78,6 @@ openstack-dev: - ^stable/(newton|ocata|pike) """ -import ConfigParser -import daemon -from ib3.auth import SASL -from ib3.connection import SSL -import irc.bot -import json -import logging.config -import os -import re -import sys -import threading -import time -import yaml - -import paho.mqtt.client as mqtt - -try: - import daemon.pidlockfile - pid_file_module = daemon.pidlockfile -except Exception: - # as of python-daemon 1.6 it doesn't bundle pidlockfile anymore - # instead it depends on lockfile-0.9.1 - import daemon.pidfile - pid_file_module = daemon.pidfile - # https://bitbucket.org/jaraco/irc/issue/34/ # irc-client-should-not-crash-on-failed @@ -475,7 +475,7 @@ def main(): print("Usage: %s CONFIGFILE" % sys.argv[0]) sys.exit(1) - config = ConfigParser.ConfigParser() + config = configparser.ConfigParser() config.read(sys.argv[1]) pid_path = "" diff --git a/requirements.txt b/requirements.txt index bde41b8..bbddadb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,3 @@ -pbr>=0.6,!=0.7 - gerritlib irc pyyaml diff --git a/test-requirements.txt b/test-requirements.txt index 8b0b4a6..22865b7 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,5 @@ -hacking>=0.10.0,<0.11 -sphinx!=1.6.6,!=1.6.7,<2.0.0;python_version=='2.7' # BSD -sphinx!=1.6.6,!=1.6.7,!=2.1.0;python_version>='3.4' # BSD +flake8 +sphinx>=1.6.1 os-testr>=0.8.0 # Apache-2.0 mock>=2.0.0 # BSD testtools>=1.4.0 # MIT diff --git a/tox.ini b/tox.ini index 03b5f81..21f3c04 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,10 @@ [tox] -envlist = py27,pep8 +envlist = py37,pep8 [testenv] usedevelop = True install_command = pip install {opts} {packages} +basepython = python3 setenv = VIRTUAL_ENV={envdir} PYTHONDONTWRITEBYTECODE = 1 LANGUAGE=en_US