diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4cda816..4df3b37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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' @@ -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 diff --git a/Makefile b/Makefile index 01e3639..eb7c0ba 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/requirements.txt b/requirements.txt index fd30c4c..8b0db19 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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