From d38c109d49c89777c2a343de87d234c3c27f4692 Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Mon, 4 Oct 2021 13:04:35 -0400 Subject: [PATCH 1/3] Update pip and setuptools --- Makefile | 2 +- requirements/requirements.in | 4 ++-- requirements/requirements.txt | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 1e8fdb5e14..3755c20aa8 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ DEVEL_IMAGE_NAME ?= $(DEV_DOCKER_TAG_BASE)/awx_devel:$(COMPOSE_TAG) SRC_ONLY_PKGS ?= cffi,pycparser,psycopg2,twilio # These should be upgraded in the AWX and Ansible venv before attempting # to install the actual requirements -VENV_BOOTSTRAP ?= pip==19.3.1 setuptools==41.6.0 wheel==0.36.2 +VENV_BOOTSTRAP ?= pip==21.2.4 setuptools==58.2.0 wheel==0.36.2 NAME ?= awx diff --git a/requirements/requirements.in b/requirements/requirements.in index 68cb3852df..6104cb3a59 100644 --- a/requirements/requirements.in +++ b/requirements/requirements.in @@ -57,8 +57,8 @@ twisted[tls]>=20.3.0 # CVE-2020-10108, CVE-2020-10109 uWSGI uwsgitop wheel -pip==19.3.1 # see UPGRADE BLOCKERs -setuptools==41.6.0 # see UPGRADE BLOCKERs +pip==21.2.4 # see UPGRADE BLOCKERs +setuptools==58.2.0 # see UPGRADE BLOCKERs # Temporarily added to use ansible-runner from git branch, to be removed # when ansible-runner moves from requirements_git.txt to here diff --git a/requirements/requirements.txt b/requirements/requirements.txt index b7e9781d4b..304b73f8a5 100644 --- a/requirements/requirements.txt +++ b/requirements/requirements.txt @@ -412,9 +412,9 @@ zope.interface==5.0.0 # via twisted # The following packages are considered to be unsafe in a requirements file: -pip==19.3.1 +pip==21.2.4 # via -r /awx_devel/requirements/requirements.in -setuptools==41.6.0 +setuptools==58.2.0 # via # -r /awx_devel/requirements/requirements.in # asciichartpy From 7bbfcbaefd0209bb25b3a9672421221fdd458802 Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Mon, 4 Oct 2021 15:28:26 -0400 Subject: [PATCH 2/3] Update dev requirements to work with setuptools 58 --- requirements/requirements_dev.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements/requirements_dev.txt b/requirements/requirements_dev.txt index 6811a16fd3..532ac920c3 100644 --- a/requirements/requirements_dev.txt +++ b/requirements/requirements_dev.txt @@ -1,6 +1,6 @@ django-debug-toolbar==1.11 django-rest-swagger -pprofile +# pprofile - re-add once https://github.com/vpelletier/pprofile/issues/41 is addressed ipython==7.21.0 unittest2 black @@ -14,9 +14,9 @@ pytest-xdist==1.34.0 # 2.0.0 broke zuul for some reason tox # for awxkit logutils jupyter -matplotlib +# matplotlib - Caused issues when bumping to setuptools 58 backports.tempfile # support in unit tests for py32+ tempfile.TemporaryDirectory -mockldap +git+https://github.com/artefactual-labs/mockldap.git@master#egg=mockldap sdb remote-pdb gprof2dot From 4aceea41fd90b45077a8ebb5a86a792122105cea Mon Sep 17 00:00:00 2001 From: Shane McDonald Date: Mon, 4 Oct 2021 17:41:48 -0400 Subject: [PATCH 3/3] Update licensce test to work with newer pip --- awx/main/tests/functional/test_licenses.py | 15 +++++++++------ .../licenses/{tacacs-plus.txt => tacacs_plus.txt} | 0 2 files changed, 9 insertions(+), 6 deletions(-) rename docs/licenses/{tacacs-plus.txt => tacacs_plus.txt} (100%) diff --git a/awx/main/tests/functional/test_licenses.py b/awx/main/tests/functional/test_licenses.py index 8ff2e72bfe..d59ec0e45f 100644 --- a/awx/main/tests/functional/test_licenses.py +++ b/awx/main/tests/functional/test_licenses.py @@ -9,6 +9,8 @@ try: except ImportError: from pip.req import parse_requirements +from pip._internal.req.constructors import parse_req_from_line + def test_python_and_js_licenses(): def index_licenses(path): @@ -53,15 +55,16 @@ def test_python_and_js_licenses(): fname = '%s/%s' % (path, req_file) for reqt in parse_requirements(fname, session=''): - name = reqt.name - version = str(reqt.specifier) + parsed_requirement = parse_req_from_line(reqt.requirement, None) + name = parsed_requirement.requirement.name + version = str(parsed_requirement.requirement.specifier) if version.startswith('=='): version = version[2:] - if reqt.link: - if str(reqt.link).startswith(('http://', 'https://')): - (name, version) = str(reqt.req).split('==', 1) + if parsed_requirement.link: + if str(parsed_requirement.link).startswith(('http://', 'https://')): + (name, version) = str(parsed_requirement.requirement).split('==', 1) else: - (name, version) = reqt.link.filename.split('@', 1) + (name, version) = parsed_requirement.link.filename.split('@', 1) if name.endswith('.git'): name = name[:-4] if name == 'receptor': diff --git a/docs/licenses/tacacs-plus.txt b/docs/licenses/tacacs_plus.txt similarity index 100% rename from docs/licenses/tacacs-plus.txt rename to docs/licenses/tacacs_plus.txt