Skip to content

Commit

Permalink
Use pip-sync tool by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
greshilov committed Feb 20, 2021
1 parent 1ec360f commit 1b976e3
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
.gitconfig
.hash
.idea
.install-cython
.install-pip-tools
.install-deps
.installed.cfg
.mypy_cache
Expand Down
1 change: 1 addition & 0 deletions CHANGES/5470.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use the same command for dependencies installation in Makefile. Use pip-sync tool by default.
26 changes: 12 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,24 @@ endif
.SECONDARY: $(call to-hash,$(ALLS))


.install-cython: $(call to-hash,requirements/cython.txt)
pip install -r requirements/cython.txt
@touch .install-cython

aiohttp/_find_header.c: $(call to-hash,aiohttp/hdrs.py ./tools/gen.py)
./tools/gen.py

# _find_headers generator creates _headers.pyi as well
aiohttp/%.c: aiohttp/%.pyx $(call to-hash,$(CYS)) aiohttp/_find_header.c
cython -3 -o $@ $< -I aiohttp

.install-pip-tools:
@pip install pip-tools
@touch .install-pip-tools

.PHONY: cythonize
cythonize: .install-cython $(PYXS:.pyx=.c)

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

.PHONY: cythonize
cythonize: .install-deps $(PYXS:.pyx=.c) $(call to-hash,$(CYS))

.PHONY: lint
lint: fmt mypy

Expand All @@ -77,7 +76,7 @@ mypy:
mypy

.develop: .install-deps $(call to-hash,$(PYS) $(CYS) $(CS))
pip install -e .
@pip install -e .
@touch .develop

.PHONY: test
Expand Down Expand Up @@ -124,7 +123,7 @@ clean:
@rm -f .flake
@rm -rf aiohttp.egg-info
@rm -f .install-deps
@rm -f .install-cython
@rm -f .install-pip-tools

.PHONY: doc
doc:
Expand All @@ -139,13 +138,12 @@ doc-spelling:
@pip install -U 'pip'

.PHONY: compile-deps
compile-deps: .update-pip
@pip install pip-tools
compile-deps: .update-pip .install-pip-tools
@pip-compile --allow-unsafe -q requirements/dev.in

.PHONY: install
install: .update-pip
@pip install -r requirements/dev.in -c requirements/dev.txt
@pip-sync requirements/dev.txt

.PHONY: install-dev
install-dev: .develop
3 changes: 1 addition & 2 deletions requirements/cython.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
-r multidict.txt
-c dev.txt
cython==0.29.21
typing_extensions==3.7.4.3 # required for parsing aiohttp/hdrs.py by tools/gen.py
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ six==1.15.0
# virtualenv
snowballstemmer==2.0.0
# via sphinx
sphinx==3.5.0
sphinx==3.5.1
# via
# -r requirements/doc.txt
# sphinxcontrib-asyncio
Expand Down

0 comments on commit 1b976e3

Please sign in to comment.