Skip to content

Commit

Permalink
Fix linter configs
Browse files Browse the repository at this point in the history
  • Loading branch information
asvetlov committed Dec 6, 2021
1 parent 6af8bf4 commit c7e10db
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 37 deletions.
21 changes: 6 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,14 @@ jobs:
restore-keys: |
pip-lint-
- name: Install dependencies
uses: py-actions/py-dependency-install@v2
with:
path: requirements.txt
- name: Install itself
run: |
python setup.py install
make install
- name: Run linter
run: |
make lint
- name: Prepare twine checker
run: |
pip install -U twine wheel
python setup.py sdist bdist_wheel
- name: Run twine checker
run: |
twine check dist/*
make check
test:
name: Test
Expand Down Expand Up @@ -81,9 +73,8 @@ jobs:
restore-keys: |
pip-ci-${{ runner.os }}-${{ matrix.pyver }}-
- name: Install dependencies
uses: py-actions/py-dependency-install@v2
with:
path: requirements.txt
run: |
make install
- name: Run unittests
env:
COLOR: 'yes'
Expand All @@ -109,8 +100,8 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v2
- name: Install dependencies
run:
python -m pip install -U pip wheel twine build
run: |
make install
- name: Make dists
run:
python -m build
Expand Down
31 changes: 12 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,28 +1,21 @@
SOURCES = setup.py async_timeout tests

test: lint
pytest tests


lint: mypy check black flake8


mypy:
lint: fmt
mypy


black:
isort -c $(SOURCES)
black --check $(SOURCES)

flake8:
flake8 $(SOURCES)


fmt:
isort $(SOURCES)
black $(SOURCES)
ifdef CI
pre-commit run --all-files --show-diff-on-failure
else
pre-commit run --all-files
endif


check:
python setup.py check -rms
python -m build
twine check dist/*

install:
pip install -U pip
pip install -r requirements.txt
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
-e .
black==21.11b1; implementation_name=="cpython"
build==0.7.0
docutils==0.18.1
flake8==4.0.1
isort==5.10.1
mypy==0.910; implementation_name=="cpython"
pre-commit==2.16.0
pytest==6.2.5
pytest-asyncio==0.16.0
pytest-cov==3.0.0
twine==3.7.0

0 comments on commit c7e10db

Please sign in to comment.