From ce4ddf73364d5e6877917f26a93890195bbe89e0 Mon Sep 17 00:00:00 2001 From: "Mikhail f. Shiryaev" Date: Mon, 30 Sep 2024 23:43:36 +0200 Subject: [PATCH] Ignore system packages in pipdeptree --- docker/reqgenerator.py | 6 +++++- docker/test/integration/runner/requirements.txt | 2 -- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docker/reqgenerator.py b/docker/reqgenerator.py index f7846f3e842..3d6ab2136db 100644 --- a/docker/reqgenerator.py +++ b/docker/reqgenerator.py @@ -13,7 +13,11 @@ def build_docker_deps(image_name: str, imagedir: str) -> None: "pip install pipdeptree 2>/dev/null 1>/dev/null && pipdeptree --freeze " "--warn silence --exclude pipdeptree" ) - cmd = rf"""docker run --rm --entrypoint "/bin/bash" {image_name} -c "{pip_cmd} | sed '/=/!d;s/\s//g' | sort -u" > {imagedir}/requirements.txt""" + # /=/!d - remove dependencies without pin + # ubuntu - ignore system packages + # \s - remove spaces + sed = r"sed '/==/!d; /==.*+ubuntu/d; s/\s//g'" + cmd = rf"""docker run --rm --entrypoint "/bin/bash" {image_name} -c "{pip_cmd} | {sed} | sort -u" > {imagedir}/requirements.txt""" print("Running the command:", cmd) subprocess.check_call(cmd, shell=True) diff --git a/docker/test/integration/runner/requirements.txt b/docker/test/integration/runner/requirements.txt index 8e1d596ea15..7ece526a580 100644 --- a/docker/test/integration/runner/requirements.txt +++ b/docker/test/integration/runner/requirements.txt @@ -29,7 +29,6 @@ delta-spark==2.3.0 deltalake==0.16.0 dict2xml==1.7.4 dicttoxml==1.7.16 -distro-info==1.1+ubuntu0.2 docker==6.1.3 exceptiongroup==1.2.1 execnet==2.1.1 @@ -82,7 +81,6 @@ pytest-reportlog==0.4.0 pytest-timeout==2.2.0 pytest-xdist==3.5.0 pytest==7.4.4 -python-apt==2.4.0+ubuntu3 python-dateutil==2.9.0.post0 pytz==2023.3.post1 redis==5.0.1