From bd0fdd94cc3771d1a22c9299d141fd8d5d9bbe5b Mon Sep 17 00:00:00 2001 From: Orfeas Kourkakis Date: Wed, 4 Dec 2024 11:04:04 +0200 Subject: [PATCH] fix: Update tox update-requirements environment (#104) Ref canonical/bundle-kubeflow#1177 Ref canonical/kubeflow-ci#59 --- tox.ini | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tox.ini b/tox.ini index 565de92..299101d 100644 --- a/tox.ini +++ b/tox.ini @@ -30,12 +30,12 @@ allowlist_externals = bash find pip-compile - xargs commands = -; uses 'bash -c' because piping didn't work in regular tox commands - pip-compile requirements.in - pip-compile requirements-fmt.in - bash -c 'find . -type f -name "requirements*.in" | xargs --replace=\{\} pip-compile --resolver=backtracking \{\}' + ; we must preserve the order of compilation, since each *.in file depends on some *.txt file. + ; For example, requirements-unit.in depends on requirements.txt and we must compile first + ; requirements.txt to ensure that requirements-unit.txt get the same dependency as the requirements.txt + bash -c 'for pattern in "requirements.in" "requirements-fmt.in" "requirements*.in"; do find . -type f -name "$pattern" -exec bash -c "cd \$(dirname "{}") && pip-compile --resolver=backtracking \$(basename "{}")" \;; done' + deps = pip-tools description = Update requirements files by executing pip-compile on all requirements*.in files, including those in subdirs.