Drop packaging requirement and unpin docker-py

Change-Id: I11d306be5e5bb3d5b05b50dd8ee64ac9424854a1
(cherry picked from commit 968711579f)
This commit is contained in:
Michal Nasiadka 2024-05-23 15:14:53 +02:00
parent eb23d9cc28
commit 7efe8a37f0
2 changed files with 10 additions and 12 deletions

View File

@ -113,16 +113,13 @@ def run_build():
if conf.engine == engine.Engine.DOCKER.value:
try:
import docker
import packaging
packaging.version.parse(docker.__version__)
except ImportError:
docker.__version__
except ImportError as e:
LOG.error("Error, you have set Docker as container engine, "
"but the Python library is not found."
"Try running 'pip install docker'")
"Try running 'pip install docker'\n"
"Python error: %s", e)
sys.exit(1)
except AttributeError:
LOG.error("Error, Docker Python library is too old, "
"Try running 'pip install docker --upgrade'")
if conf.squash:
squash_version = utils.get_docker_squash_version()
LOG.info('Image squash is enabled and "docker-squash" version '
@ -132,10 +129,11 @@ def run_build():
try:
import podman
podman.__version__
except ImportError:
LOG.error("Error, you have set podman as container engine, "
"but library is not found."
"Try running pip install podman")
except ImportError as e:
LOG.error("Error, you have set Podman as container engine, "
"but the Python library is not found."
"Try running 'pip install podman'\n"
"Python error: %s", e)
exit(1)
kolla = KollaWorker(conf)

View File

@ -43,7 +43,7 @@
command: "{{ virtualenv_path }}/bin/python -m pip install {{ zuul.project.src_dir }}"
- name: Install docker python library
command: "{{ virtualenv_path }}/bin/python -m pip install 'docker<7'"
command: "{{ virtualenv_path }}/bin/python -m pip install docker"
when: container_engine == "docker"
- name: Install podman python library