From 61348f95409a49283ee53824d3e7c5f6f6eb3d45 Mon Sep 17 00:00:00 2001 From: Aric Gardner Date: Wed, 30 Oct 2019 12:20:00 -0400 Subject: [PATCH] Drop support for python2.7 and 3.4(EOL) Drop support for python2.7 and python3.4(EOL) lftools now requires python >= 3.6 This allows us to remove remaining pins, and to move from glob2 to builtin glob Signed-off-by: Aric Gardner Change-Id: I48ffc27376e3a7b56f0627e8eaeb9ac3dff908dc --- .coafile | 1 - lftools/deploy.py | 8 ++++---- releasenotes/notes/lftools-python-85ad1e90d01c51fb.yaml | 6 ++++++ requirements.txt | 3 +-- 4 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 releasenotes/notes/lftools-python-85ad1e90d01c51fb.yaml diff --git a/.coafile b/.coafile index be307c43..642cfe3b 100644 --- a/.coafile +++ b/.coafile @@ -37,7 +37,6 @@ known_first_party_imports = lftools known_third_party_imports = defusedxml, email_validator, - glob2, httplib2, jenkins, jsonschema, diff --git a/lftools/deploy.py b/lftools/deploy.py index 9e2fa2d8..ea56bedc 100755 --- a/lftools/deploy.py +++ b/lftools/deploy.py @@ -26,7 +26,7 @@ import tempfile import zipfile from defusedxml.minidom import parseString -import glob2 # Switch to glob when Python < 3.5 support is dropped +import glob import requests import six @@ -47,7 +47,7 @@ def _compress_text(dir): paths = [] for _type in compress_types: search = os.path.join(dir, _type) - paths.extend(glob2.glob(search, recursive=True)) + paths.extend(glob.glob(search, recursive=True)) for _file in paths: with open(_file, 'rb') as src, gzip.open('{}.gz'.format(_file), 'wb') as dest: @@ -253,7 +253,7 @@ def copy_archives(workspace, pattern=None): continue search = os.path.join(workspace, p) - paths.extend(glob2.glob(search, recursive=True)) + paths.extend(glob.glob(search, recursive=True)) log.debug('Files found: {}'.format(paths)) no_dups_paths = _remove_duplicates_and_sort(paths) @@ -635,7 +635,7 @@ def deploy_nexus(nexus_repo_url, deploy_dir, snapshot=False): file_list = [] previous_dir = os.getcwd() os.chdir(deploy_dir) - files = glob2.glob('**/*') + files = glob.glob('**/*', recursive=True) for file in files: if os.path.isfile(file): base_name = os.path.basename(file) diff --git a/releasenotes/notes/lftools-python-85ad1e90d01c51fb.yaml b/releasenotes/notes/lftools-python-85ad1e90d01c51fb.yaml new file mode 100644 index 00000000..448ad878 --- /dev/null +++ b/releasenotes/notes/lftools-python-85ad1e90d01c51fb.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + Drop support for python2.7 and python3.4(EOL) + lftools now requires python >= 3.6 This allows us to remove + remaining pins, and to move from glob2 to builtin glob diff --git a/requirements.txt b/requirements.txt index 6495603c..8923e6c9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,5 @@ click docker -glob2 # Needed for Python < 3.5 recursive glob support defusedxml # Needed due to tox complains on parseString not safe jsonschema requests @@ -9,7 +8,7 @@ setuptools>=36.5.0 six python-jenkins tqdm -xdg~=3.0.0;python_version>='3' # xdg requires Python '>=3.6,<4.0' but the running Python is 3.5.7 +xdg pygithub httplib2 email_validator -- 2.16.6