Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requirements cleanup #6238

Merged
merged 10 commits into from
Nov 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 29 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ jobs:
path: ~/.cache/pip
restore-keys: |
pip-lint-
- name: Update pip, wheel, setuptools, build, twine
run: |
python -m pip install -U pip wheel setuptools build twine
- name: Install dependencies
uses: py-actions/py-dependency-install@v2
with:
path: requirements/lint.txt
run: |
python -m pip install -r requirements/lint.txt -c requirements/constraints.txt
- name: Install self
run: |
python -m pip install .
Expand All @@ -52,17 +54,18 @@ jobs:
- name: Run linters
run: |
make mypy
- name: Install spell checker
- name: Install libenchant-dev
run: |
sudo apt install libenchant-dev
pip install -r requirements/doc-spelling.txt
- name: Install spell checker
run: |
pip install -r requirements/doc-spelling.txt -c requirements/constraints.txt
- name: Run docs spelling
run: |
# towncrier --yes # uncomment me after publishing a release
make doc-spelling
- name: Prepare twine checker
- name: Build package
run: |
pip install -U build twine
python -m build
env:
AIOHTTP_NO_EXTENSIONS: 1
Expand Down Expand Up @@ -149,8 +152,12 @@ jobs:
path: ${{ steps.pip-cache.outputs.dir }}
restore-keys: |
pip-ci-${{ runner.os }}-${{ matrix.pyver }}-${{ matrix.no-extensions }}-
- name: Upgrade wheel # Needed for proxy.py install not to explode
run: pip install -U wheel
- name: Update pip, wheel, setuptools, build, twine
run: |
python -m pip install -U pip wheel setuptools build twine
- name: Install dependencies
run: |
python -m pip install -r requirements/test.txt -c requirements/constraints.txt
- name: Cythonize
if: ${{ matrix.no-extensions == '' }}
run: |
Expand Down Expand Up @@ -209,10 +216,12 @@ jobs:
submodules: true
- name: Setup Python
uses: actions/[email protected]
- name: Update pip, wheel, setuptools, build, twine
run: |
python -m pip install -U pip wheel setuptools build twine
- name: Install cython
uses: py-actions/py-dependency-install@v2
with:
path: requirements/cython.txt
run: |
python -m pip install -r requirements/cython.txt -c requirements/constraints.txt
- name: Restore llhttp generated files
uses: actions/download-artifact@v2
with:
Expand All @@ -223,7 +232,6 @@ jobs:
make cythonize
- name: Make sdist
run: |
python -m pip install build --user
python -m build --sdist
- name: Upload artifacts
uses: actions/upload-artifact@v2
Expand Down Expand Up @@ -268,10 +276,12 @@ jobs:
shell: bash
- name: Setup Python
uses: actions/[email protected]
- name: Update pip, wheel, setuptools, build, twine
run: |
python -m pip install -U pip wheel setuptools build twine
- name: Install cython
uses: py-actions/py-dependency-install@v2
with:
path: requirements/cython.txt
run: |
python -m pip install -r requirements/cython.txt -c requirements/constraints.txt
- name: Restore llhttp generated files
uses: actions/download-artifact@v2
with:
Expand Down Expand Up @@ -299,6 +309,9 @@ jobs:
uses: actions/[email protected]
with:
submodules: true
- name: Update pip, wheel, setuptools, build, twine
run: |
python -m pip install -U pip wheel setuptools build twine
- name: Login
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/post-dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Dependabot post-update
on:
pull_request_target:
action: [opened, synchronize, reopened]
branches:
- 'master'
- '[0-9].[0-9]+'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true

jobs:
post-update:
if: ${{ github.actor == 'dependabot[bot]' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
run: |
gh pr checkout ${{ github.event.pull_request.number }} --repo ${{ github.repository }}
- name: Setup Python
uses: actions/setup-python@v2
- name: Cache PyPI
uses: actions/[email protected]
with:
key: post-update-${{ hashFiles('requirements/*.txt') }}
path: ~/.cache/pip
restore-keys: |
post-update-
- name: Update pip, wheel, setuptools
run: |
python -m pip install -U pip wheel setuptools
- name: Install dependencies
run: |
python -m pip install -r requirements/lint.txt -c requirements/constraints.txt
- name: Run pip-compile
run: |
make compile-deps
- name: Check if compiled deps are changed
id: meta
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "::set-output name=changed::true"
else
echo "::set-output name=changed::false"
- name: Commit and push if needed
if: ${{ steps.meta.values.changed == "true" }}
run: |
git add requirements/constraints.txt
git commit -m "Update constraints"
git push
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ repos:
^docs/[^/]*\.svg$
- id: requirements-txt-fixer
exclude: >-
^requirements/(cython|dev|doc-spelling|lint).txt$
^requirements/constraints[.]txt$
- id: trailing-whitespace
- id: file-contents-sorter
files: |
Expand Down
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ CYS := $(wildcard aiohttp/*.pyx) $(wildcard aiohttp/*.pyi) $(wildcard aiohttp/*
PYXS := $(wildcard aiohttp/*.pyx)
CS := $(wildcard aiohttp/*.c)
PYS := $(wildcard aiohttp/*.py)
REQS := $(wildcard requirements/*.txt)
ALLS := $(sort $(CYS) $(CS) $(PYS) $(REQS))
IN := doc-spelling lint cython dev
REQIN := $(foreach fname,$(IN),requirements/$(fname).in)
ALLS := $(sort $(CYS) $(CS) $(PYS) $(REQS))


.PHONY: all
Expand Down Expand Up @@ -184,9 +182,10 @@ doc-spelling:
@make -C docs spelling SPHINXOPTS="-W --keep-going -n -E"

.PHONY: compile-deps
compile-deps: .update-pip
@pip install pip-tools
@$(foreach fname,$(REQIN),pip-compile --allow-unsafe -q $(fname);)
compile-deps: .update-pip $(REQS)
pip-compile --no-header --allow-unsafe -q --strip-extras \
-o requirements/constraints.txt \
requirements/constraints.in

.PHONY: install
install: .update-pip
Expand Down
4 changes: 4 additions & 0 deletions requirements/constraints.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-r cython.txt
-r dev.txt
-r doc-spelling.txt
-r lint.txt
Loading