From 97ca1c24c3ef8f62cb7341bbedb8857e0539a7f4 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Tue, 19 May 2020 18:05:50 +0100 Subject: [PATCH] Drop py27 and add py38 jobs - Dropping py27 as is out of support - Enable py38 testing, already default python on several distros. - removes six as a dependency as is no longer needed for pure py3 Change-Id: I1e825073abc6cd55aa2fdc363358f2701152c57b --- .zuul.yaml | 3 +-- elastic_recheck/config.py | 2 +- elastic_recheck/query_builder.py | 2 +- .../tests/functional/test_gerrit_comment.py | 2 +- elastic_recheck/tests/unit/test_bot.py | 2 +- elastic_recheck/tests/unit/test_query.py | 2 +- requirements.txt | 10 +--------- setup.cfg | 6 ++++-- tox.ini | 2 +- 9 files changed, 12 insertions(+), 19 deletions(-) diff --git a/.zuul.yaml b/.zuul.yaml index 9df099e8..d4ce9209 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -3,17 +3,16 @@ templates: - openstack-python36-jobs - openstack-python37-jobs + - openstack-python38-jobs - publish-tox-docs-infra check: jobs: - elastic-recheck-tox-queries: voting: false - openstack-tox-linters - - openstack-tox-py27 gate: jobs: - openstack-tox-linters - - openstack-tox-py27 - job: name: elastic-recheck-tox-queries diff --git a/elastic_recheck/config.py b/elastic_recheck/config.py index a81a4f24..f50d2f6d 100644 --- a/elastic_recheck/config.py +++ b/elastic_recheck/config.py @@ -14,7 +14,7 @@ import os import re -from six.moves import configparser +import configparser DEFAULT_INDEX_FORMAT = 'logstash-%Y.%m.%d' diff --git a/elastic_recheck/query_builder.py b/elastic_recheck/query_builder.py index 272f132a..bfdb9f15 100644 --- a/elastic_recheck/query_builder.py +++ b/elastic_recheck/query_builder.py @@ -19,7 +19,7 @@ by elastic recheck to talk with elastic search. """ import json -from six.moves.urllib.parse import quote as urlquote +from urllib.parse import quote as urlquote def generic(raw_query, facet=None): diff --git a/elastic_recheck/tests/functional/test_gerrit_comment.py b/elastic_recheck/tests/functional/test_gerrit_comment.py index 5c651469..65e55bd7 100644 --- a/elastic_recheck/tests/functional/test_gerrit_comment.py +++ b/elastic_recheck/tests/functional/test_gerrit_comment.py @@ -13,7 +13,7 @@ # under the License. import gerritlib -from six.moves import configparser +import configparser import testtools from elastic_recheck import elasticRecheck diff --git a/elastic_recheck/tests/unit/test_bot.py b/elastic_recheck/tests/unit/test_bot.py index 5899bed9..b2b5dab5 100644 --- a/elastic_recheck/tests/unit/test_bot.py +++ b/elastic_recheck/tests/unit/test_bot.py @@ -12,7 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. -from six.moves import configparser +import configparser import unittest import yaml diff --git a/elastic_recheck/tests/unit/test_query.py b/elastic_recheck/tests/unit/test_query.py index 48c9c63c..30e170cd 100644 --- a/elastic_recheck/tests/unit/test_query.py +++ b/elastic_recheck/tests/unit/test_query.py @@ -11,7 +11,7 @@ # under the License. import json -from six import StringIO +from io import StringIO import sys import mock diff --git a/requirements.txt b/requirements.txt index 8a695130..75eeaf1e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,23 +1,15 @@ pbr>=1.8 -six python-dateutil>=2.0 pytz pyelasticsearch<1.0 gerritlib python-daemon>=2.2.0 -# NOTE(mriedem): irc 17.0 dropped support for py2 so use a capped version in -# that case. -irc>=15.0.1,<17.0;python_version<'3.4' -irc>=17.0;python_version>='3.4' +irc>=17.0 pyyaml lockfile Babel>=0.9.6 lazr.restfulclient>=0.14.2 # LGPL httplib2>=0.12.0 # MIT License -# NOTE(mriedem): launchpadlib has an uncapped dependency on keyring which -# dropped support for python2.7 in version 19.0.0 so for py27 environments we -# have to explicitly install a capped version of keyring first. -keyring<19.0.0;python_version=='2.7' launchpadlib>=1.10.6 # LGPL Jinja2 requests diff --git a/setup.cfg b/setup.cfg index c9fbd93b..a21a7522 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,11 +13,13 @@ classifier = License :: OSI Approved :: Apache Software License Operating System :: POSIX :: Linux Programming Language :: Python - Programming Language :: Python :: 2 - Programming Language :: Python :: 2.7 Programming Language :: Python :: 3 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + +[options] +python_requires = >=3.6 [files] packages = diff --git a/tox.ini b/tox.ini index 26b1b7ef..e4059c33 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 1.6 -envlist = linters,py38,py37,py36,py27,queries,docs +envlist = linters,py38,py37,py36,queries,docs skipsdist = True [testenv]