From 8a346265cc20589296a094fc6b143f579b4ce885 Mon Sep 17 00:00:00 2001 From: Bogdan Shevchenko Date: Tue, 1 Feb 2022 18:26:54 +0200 Subject: [PATCH 1/2] Added -allow-unsafe flag to pip_compile in pip_tools.py Without flag command "fab pip.sync" falling with error "setuptools" version is not fixed. https://github.com/jazzband/pip-tools/#deprecations --- .../fabric_scripts/pip_tools.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.project_slug }}/fabric_scripts/pip_tools.py b/{{ cookiecutter.project_slug }}/fabric_scripts/pip_tools.py index fe5cfa0..e4e9eaf 100644 --- a/{{ cookiecutter.project_slug }}/fabric_scripts/pip_tools.py +++ b/{{ cookiecutter.project_slug }}/fabric_scripts/pip_tools.py @@ -7,8 +7,14 @@ @task() def pip_compile(ctx): with ctx.cd(project_path("api")): - command_build = "pip-compile --upgrade --generate-hashes -o ./requirements-build.txt ./requirements-build.in" - command_dev = "pip-compile --upgrade --generate-hashes -o ./requirements-dev.txt ./requirements-dev.in" + # TODO: Remove "-allow-unsafe" flag in future versions of pip-tools (when will be enabled by default) + # https://github.com/jazzband/pip-tools/#deprecations + command_build = ( + "pip-compile --upgrade --allow-unsafe --generate-hashes -o ./requirements-build.txt ./requirements-build.in" + ) + command_dev = ( + "pip-compile --upgrade --allow-unsafe --generate-hashes -o ./requirements-dev.txt ./requirements-dev.in" + ) ctx.run(command_build, pty=True, replace_env=False) ctx.run(command_dev, pty=True, replace_env=False) From 885067b41fef5bfde952c4d6cfbc20bcda62f35b Mon Sep 17 00:00:00 2001 From: Bogdan Shevchenko Date: Wed, 2 Feb 2022 10:15:10 +0200 Subject: [PATCH 2/2] Temp pip version downgrade in git workflow Pip-tools has issue on pip version >=22.0 https://github.com/jazzband/pip-tools/issues/1558 --- .github/workflows/default.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/default.yml b/.github/workflows/default.yml index e85c6e8..2308502 100644 --- a/.github/workflows/default.yml +++ b/.github/workflows/default.yml @@ -61,7 +61,7 @@ jobs: python3 -m venv build/.env source build/.env/bin/activate cd build/awesome - pip install -U pip + pip install pip~=21.3 # TODO: Unpin version when pip-tools gets support >=22.0 (pip install -U pip) pip install fabric invoke pip-tools fab pip.compile fab pip.sync