diff --git a/charms/katib-controller/tox.ini b/charms/katib-controller/tox.ini index e219ef80..b29ccbeb 100644 --- a/charms/katib-controller/tox.ini +++ b/charms/katib-controller/tox.ini @@ -31,10 +31,11 @@ allowlist_externals = find pip-compile xargs -commands = -; uses 'bash -c' because piping didn't work in regular tox commands - pip-compile requirements-fmt.in - bash -c 'find . -type f -name "requirements*.in" | xargs --replace=\{\} pip-compile --resolver=legacy \{\}' +commands = + ; 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. @@ -68,4 +69,4 @@ commands = pytest -v --tb native --asyncio-mode=auto {[vars]tst_path}integration/test_charm.py --log-cli-level=INFO -s {posargs} deps = -r requirements-integration.txt -description = Run integration tests \ No newline at end of file +description = Run integration tests diff --git a/charms/katib-db-manager/tox.ini b/charms/katib-db-manager/tox.ini index 2dfe1939..1c989b3f 100644 --- a/charms/katib-db-manager/tox.ini +++ b/charms/katib-db-manager/tox.ini @@ -31,10 +31,11 @@ allowlist_externals = find pip-compile xargs -commands = -; uses 'bash -c' because piping didn't work in regular tox commands - pip-compile requirements-fmt.in - bash -c 'find . -type f -name "requirements*.in" | xargs --replace=\{\} pip-compile --resolver=legacy \{\}' +commands = + ; 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. @@ -76,4 +77,4 @@ description = Run unit tests commands = pytest -v --tb native --asyncio-mode=auto {[vars]tst_path}integration --log-cli-level=INFO -s {posargs} deps = -r requirements-integration.txt -description = Run integration tests \ No newline at end of file +description = Run integration tests diff --git a/charms/katib-ui/tox.ini b/charms/katib-ui/tox.ini index 494b1536..1744a980 100644 --- a/charms/katib-ui/tox.ini +++ b/charms/katib-ui/tox.ini @@ -30,10 +30,11 @@ allowlist_externals = find pip-compile xargs -commands = -; uses 'bash -c' because piping didn't work in regular tox commands - pip-compile requirements-fmt.in - bash -c 'find . -type f -name "requirements*.in" | xargs --replace=\{\} pip-compile --resolver=legacy \{\}' +commands = + ; 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. @@ -60,4 +61,4 @@ commands = black --check --diff {[vars]all_path} deps = -r requirements-lint.txt -description = Check code against coding style standards \ No newline at end of file +description = Check code against coding style standards