Update for python3

We're gonna build an image in the next patch, so let's fix things
up to be python3 ready.

Change-Id: Ia0e1ecf75e6593a7e7be9dc962a1e2f3dc23fe27
This commit is contained in:
Monty Taylor 2020-03-28 11:39:13 -05:00
parent e3879412b7
commit 29ff7b3bec
5 changed files with 32 additions and 34 deletions

View File

@ -2,8 +2,8 @@
check:
jobs:
- tox-pep8
- tox-py27
- tox-py37
gate:
jobs:
- tox-pep8
- tox-py27
- tox-py37

View File

@ -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 = ""

View File

@ -1,5 +1,3 @@
pbr>=0.6,!=0.7
gerritlib
irc
pyyaml

View File

@ -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

View File

@ -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