Skip to content

Commit

Permalink
Complete pip-tools setup (aio-libs#5486)
Browse files Browse the repository at this point in the history
  • Loading branch information
greshilov committed Mar 2, 2021
1 parent 01fdc25 commit 8a09e68
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 267 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Expand Up @@ -32,14 +32,14 @@ jobs:
- name: Cache PyPI
uses: actions/cache@v2
with:
key: pip-lint-${{ hashFiles('requirements/*.txt') }}
key: pip-lint-${{ hashFiles('requirements/pinned/*.txt') }}
path: ~/.cache/pip
restore-keys: |
pip-lint-
- name: Install dependencies
uses: py-actions/py-dependency-install@v2
with:
path: requirements/lint.txt
path: requirements/pinned/linux-lint.txt
- name: Pre-Commit hooks
uses: pre-commit/action@v2.0.0
- name: Install itself
Expand All @@ -53,7 +53,7 @@ jobs:
- name: Install spell checker
run: |
sudo apt install libenchant-dev
pip install -r requirements/doc-spelling.txt
pip install -r requirements/linux-doc-spelling.txt
- name: Run docs spelling
run: |
# towncrier --yes # uncomment me after publishing a release
Expand Down Expand Up @@ -111,7 +111,7 @@ jobs:
- name: Cache PyPI
uses: actions/cache@v2
with:
key: pip-ci-${{ runner.os }}-${{ matrix.pyver }}-${{ matrix.no-extensions }}-${{ hashFiles('requirements/*.txt') }}
key: pip-ci-${{ runner.os }}-${{ matrix.pyver }}-${{ matrix.no-extensions }}-${{ hashFiles('requirements/pinned/*.txt') }}
path: ${{ steps.pip-cache.outputs.dir }}
restore-keys: |
pip-ci-${{ runner.os }}-${{ matrix.pyver }}-${{ matrix.no-extensions }}-
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Expand Up @@ -31,7 +31,7 @@ repos:
^docs/[^/]*\.svg$
- id: requirements-txt-fixer
exclude: >-
^requirements/dev.txt$
^requirements/pinned/.*\.txt$
- id: trailing-whitespace
- id: file-contents-sorter
files: |
Expand Down
1 change: 1 addition & 0 deletions CHANGES/5486.misc
@@ -0,0 +1 @@
Complete pip-tools setup.
16 changes: 8 additions & 8 deletions Makefile
Expand Up @@ -10,6 +10,7 @@ PYS := $(wildcard aiohttp/*.py)
REQS := $(wildcard requirements/*.txt)
ALLS := $(sort $(CYS) $(CS) $(PYS) $(REQS))


.PHONY: all
all: test

Expand Down Expand Up @@ -45,9 +46,11 @@ endif
# Enumerate intermediate files to don't remove them automatically.
.SECONDARY: $(call to-hash,$(ALLS))

.update-pip:
@pip install -U 'pip'

.install-cython: $(call to-hash,requirements/cython.txt)
pip install -r requirements/cython.txt
.install-cython: .update-pip $(call to-hash,requirements/pinned/*cython.txt)
@python tools/deps.py install cython
@touch .install-cython

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

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

.PHONY: lint
Expand Down Expand Up @@ -135,17 +138,14 @@ doc:
doc-spelling:
@make -C docs spelling SPHINXOPTS="-W -E"

.update-pip:
@pip install -U 'pip'

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

.PHONY: install
install: .update-pip
@pip install -r requirements/dev.in -c requirements/dev.txt
@python tools/deps.py install dev

.PHONY: install-dev
install-dev: .develop
File renamed without changes.
2 changes: 1 addition & 1 deletion requirements/dev.in
@@ -1,4 +1,4 @@
-r lint.txt
-r lint.in
-r test.txt
-r doc.txt
cherry_picker==1.3.2; python_version>="3.6"
252 changes: 0 additions & 252 deletions requirements/dev.txt

This file was deleted.

File renamed without changes.
3 changes: 2 additions & 1 deletion requirements/lint.txt → requirements/lint.in
@@ -1,7 +1,8 @@
black==20.8b1; implementation_name=="cpython"
flake8==3.8.4
flake8-pyi==20.10.0
isort==5.6.4
importlib-metadata==3.7.0; python_version < "3.8"
isort==5.7.0
mypy==0.790; implementation_name=="cpython"
pre-commit==2.9.3
pytest==6.1.2

0 comments on commit 8a09e68

Please sign in to comment.