Skip to content

Commit

Permalink
[PR aio-libs#6756/72d3d4b1 backport][3.8] Fix pip reinstallation on w…
Browse files Browse the repository at this point in the history
…indows due to constraints (aio-libs#6911)

**This is a backport of PR aio-libs#6756 as merged into master
(72d3d4b).**

## What do these changes do?

Fix for constantly failing CI on windows agents.

## Description

We have pinned pip version in constraints.txt file:

https://github.com/aio-libs/aiohttp/blob/08ca779e9abdb6d558cdd1647fdca17cfe979711/requirements/constraints.txt#L260

So when you call `pip install ... -c constraints.txt` it will
downgrade/upgrade pip depending on the currently installed version. This
works fine on all platforms except windows, which forces you to
explicitly use `python -m pip install ...` when dealing with the pip
package itself.

Since `python -m pip install ...` command is a completely legit
replacement for `pip install ...` ([examples
](https://pip.pypa.io/en/latest/getting-started/)from the pip wiki), I
decided to update `Makefile` with it.

Co-authored-by: Slava <[email protected]>
  • Loading branch information
patchback[bot] and greshilov authored Sep 7, 2022
1 parent 8600322 commit 9b3f7f5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ endif
@python -m pip install --upgrade pip

.install-cython: .update-pip $(call to-hash,requirements/cython.txt)
@pip install -r requirements/cython.txt -c requirements/constraints.txt
@python -m pip install -r requirements/cython.txt -c requirements/constraints.txt
@touch .install-cython

aiohttp/_find_header.c: $(call to-hash,aiohttp/hdrs.py ./tools/gen.py)
Expand All @@ -74,7 +74,7 @@ generate-llhttp: .llhttp-gen
cythonize: .install-cython $(PYXS:.pyx=.c)

.install-deps: .install-cython $(PYXS:.pyx=.c) $(call to-hash,$(CYS) $(REQS))
@pip install -r requirements/dev.txt -c requirements/constraints.txt
@python -m pip install -r requirements/dev.txt -c requirements/constraints.txt
@touch .install-deps

.PHONY: lint
Expand All @@ -89,7 +89,7 @@ mypy:
mypy

.develop: .install-deps generate-llhttp $(call to-hash,$(PYS) $(CYS) $(CS))
pip install -e . -c requirements/constraints.txt
python -m pip install -e . -c requirements/constraints.txt
@touch .develop

.PHONY: test
Expand Down Expand Up @@ -182,7 +182,7 @@ compile-deps: .update-pip $(REQS)

.PHONY: install
install: .update-pip
@pip install -r requirements/dev.txt -c requirements/constraints.txt
@python -m pip install -r requirements/dev.txt -c requirements/constraints.txt

.PHONY: install-dev
install-dev: .develop

0 comments on commit 9b3f7f5

Please sign in to comment.