Skip to content

Commit

Permalink
Added -allow-unsafe flag to pip_compile in pip_tools.py (#58)
Browse files Browse the repository at this point in the history
* 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

* Temp pip version downgrade in git workflow

Pip-tools has issue on pip version >=22.0
jazzband/pip-tools#1558
  • Loading branch information
Bogdan-Shevchenko-DS authored Feb 4, 2022
1 parent d8469cc commit 04c009d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 8 additions & 2 deletions {{ cookiecutter.project_slug }}/fabric_scripts/pip_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 04c009d

Please sign in to comment.