Skip to content

Commit

Permalink
CI improvements (#243)
Browse files Browse the repository at this point in the history
* CI improvements

* typos

* fix linting, skip macos tests
  • Loading branch information
samuelcolvin authored Apr 26, 2021
1 parent 279aeae commit 8ee04f9
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 32 deletions.
55 changes: 40 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,40 @@ on:
pull_request: {}

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: set up python
uses: actions/setup-python@v1
with:
python-version: 3.9

- run: pip install -r tests/requirements-linting.txt
- run: pip install .

- run: make lint

- run: make mypy

docs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: set up python
uses: actions/setup-python@v1
with:
python-version: 3.9

- run: pip install -r docs/requirements.txt
- run: pip install .

- run: make docs

test:
name: test py${{ matrix.python-version }} on ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -38,30 +72,21 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: install dependencies
run: |
make install
pip freeze
- name: lint
run: make lint
- run: pip install -r tests/requirements-testing.txt
- run: pip install .[watch]

- name: mypy
run: make mypy
- run: make test

- name: test
run: |
make test
coverage xml
- run: coverage xml

- uses: samuelcolvin/codecov-action@env-vars
- uses: codecov/codecov-action@v1.4.1
with:
file: ./coverage.xml
env_vars: PYTHON,OS

deploy:
name: Deploy
needs: test
needs: [lint, docs, test]
if: "success() && startsWith(github.ref, 'refs/tags/')"
runs-on: ubuntu-latest

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.DEFAULT_GOAL := all
isort = isort -rc arq tests
isort = isort arq tests
black = black -S -l 120 --target-version py37 arq tests

.PHONY: install
Expand All @@ -16,7 +16,7 @@ format:
.PHONY: lint
lint:
flake8 arq/ tests/
$(isort) --check-only -df
$(isort) --check-only --df
$(black) --check

.PHONY: test
Expand Down
2 changes: 1 addition & 1 deletion arq/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ async def abort(self, *, timeout: Optional[float] = None, poll_delay: float = 0.
Abort the job.
:param timeout: maximum time to wait for the job result before raising ``TimeoutError``,
will wait forever on None
will wait forever on None
:param poll_delay: how often to poll redis for the job result
:return: True if the job aborted properly, False otherwise
"""
Expand Down
6 changes: 3 additions & 3 deletions arq/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from typing import TYPE_CHECKING, Any, Dict, Optional, Sequence, Set, Type, Union

if sys.version_info >= (3, 8):
from typing import Protocol, Literal
from typing import Literal, Protocol
else:
from typing_extensions import Protocol, Literal
from typing_extensions import Literal, Protocol

__all__ = (
'OptionType',
Expand All @@ -19,8 +19,8 @@


if TYPE_CHECKING:
from .worker import Function # noqa F401
from .cron import CronJob # noqa F401
from .worker import Function # noqa F401

OptionType = Union[None, Set[int], int]
WEEKDAYS = 'mon', 'tues', 'wed', 'thurs', 'fri', 'sat', 'sun'
Expand Down
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
-r docs/requirements.txt
-r tests/requirements.txt

pydantic==1.7
-r tests/requirements-linting.txt
-r tests/requirements-testing.txt
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ exclude_lines =

[isort]
line_length=120
known_standard_library=dataclasses
known_third_party=pytest
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
Expand Down
8 changes: 8 additions & 0 deletions tests/requirements-linting.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
black==19.10b0
flake8==3.7.9
flake8-quotes==3
isort==5.8.0
mypy==0.812
pycodestyle==2.5.0
pyflakes==2.1.1
twine==3.1.1
7 changes: 0 additions & 7 deletions tests/requirements.txt → tests/requirements-testing.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
black==19.10b0
coverage==5.1
flake8==3.7.9
flake8-quotes==3
isort==4.3.21
msgpack==0.6.1
mypy==0.812
pycodestyle==2.5.0
pyflakes==2.1.1
pytest==5.3.5
pytest-aiohttp==0.3.0
pytest-cov==2.8.1
Expand Down

0 comments on commit 8ee04f9

Please sign in to comment.