Skip to content

Commit 8ee04f9

Browse files
authored
CI improvements (#243)
* CI improvements * typos * fix linting, skip macos tests
1 parent 279aeae commit 8ee04f9

File tree

8 files changed

+57
-32
lines changed

8 files changed

+57
-32
lines changed

.github/workflows/ci.yml

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,40 @@ on:
99
pull_request: {}
1010

1111
jobs:
12+
lint:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: set up python
19+
uses: actions/setup-python@v1
20+
with:
21+
python-version: 3.9
22+
23+
- run: pip install -r tests/requirements-linting.txt
24+
- run: pip install .
25+
26+
- run: make lint
27+
28+
- run: make mypy
29+
30+
docs:
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- uses: actions/checkout@v2
35+
36+
- name: set up python
37+
uses: actions/setup-python@v1
38+
with:
39+
python-version: 3.9
40+
41+
- run: pip install -r docs/requirements.txt
42+
- run: pip install .
43+
44+
- run: make docs
45+
1246
test:
1347
name: test py${{ matrix.python-version }} on ${{ matrix.os }}
1448
strategy:
@@ -38,30 +72,21 @@ jobs:
3872
with:
3973
python-version: ${{ matrix.python-version }}
4074

41-
- name: install dependencies
42-
run: |
43-
make install
44-
pip freeze
45-
46-
- name: lint
47-
run: make lint
75+
- run: pip install -r tests/requirements-testing.txt
76+
- run: pip install .[watch]
4877

49-
- name: mypy
50-
run: make mypy
78+
- run: make test
5179

52-
- name: test
53-
run: |
54-
make test
55-
coverage xml
80+
- run: coverage xml
5681

57-
- uses: samuelcolvin/codecov-action@env-vars
82+
- uses: codecov/codecov-action@v1.4.1
5883
with:
5984
file: ./coverage.xml
6085
env_vars: PYTHON,OS
6186

6287
deploy:
6388
name: Deploy
64-
needs: test
89+
needs: [lint, docs, test]
6590
if: "success() && startsWith(github.ref, 'refs/tags/')"
6691
runs-on: ubuntu-latest
6792

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.DEFAULT_GOAL := all
2-
isort = isort -rc arq tests
2+
isort = isort arq tests
33
black = black -S -l 120 --target-version py37 arq tests
44

55
.PHONY: install
@@ -16,7 +16,7 @@ format:
1616
.PHONY: lint
1717
lint:
1818
flake8 arq/ tests/
19-
$(isort) --check-only -df
19+
$(isort) --check-only --df
2020
$(black) --check
2121

2222
.PHONY: test

arq/jobs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ async def abort(self, *, timeout: Optional[float] = None, poll_delay: float = 0.
147147
Abort the job.
148148
149149
:param timeout: maximum time to wait for the job result before raising ``TimeoutError``,
150-
will wait forever on None
150+
will wait forever on None
151151
:param poll_delay: how often to poll redis for the job result
152152
:return: True if the job aborted properly, False otherwise
153153
"""

arq/typing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
from typing import TYPE_CHECKING, Any, Dict, Optional, Sequence, Set, Type, Union
44

55
if sys.version_info >= (3, 8):
6-
from typing import Protocol, Literal
6+
from typing import Literal, Protocol
77
else:
8-
from typing_extensions import Protocol, Literal
8+
from typing_extensions import Literal, Protocol
99

1010
__all__ = (
1111
'OptionType',
@@ -19,8 +19,8 @@
1919

2020

2121
if TYPE_CHECKING:
22-
from .worker import Function # noqa F401
2322
from .cron import CronJob # noqa F401
23+
from .worker import Function # noqa F401
2424

2525
OptionType = Union[None, Set[int], int]
2626
WEEKDAYS = 'mon', 'tues', 'wed', 'thurs', 'fri', 'sat', 'sun'

requirements.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
-r docs/requirements.txt
2-
-r tests/requirements.txt
3-
4-
pydantic==1.7
2+
-r tests/requirements-linting.txt
3+
-r tests/requirements-testing.txt

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ exclude_lines =
2525

2626
[isort]
2727
line_length=120
28-
known_standard_library=dataclasses
28+
known_third_party=pytest
2929
multi_line_output=3
3030
include_trailing_comma=True
3131
force_grid_wrap=0

tests/requirements-linting.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
black==19.10b0
2+
flake8==3.7.9
3+
flake8-quotes==3
4+
isort==5.8.0
5+
mypy==0.812
6+
pycodestyle==2.5.0
7+
pyflakes==2.1.1
8+
twine==3.1.1
Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,5 @@
1-
black==19.10b0
21
coverage==5.1
3-
flake8==3.7.9
4-
flake8-quotes==3
5-
isort==4.3.21
62
msgpack==0.6.1
7-
mypy==0.812
8-
pycodestyle==2.5.0
9-
pyflakes==2.1.1
103
pytest==5.3.5
114
pytest-aiohttp==0.3.0
125
pytest-cov==2.8.1

0 commit comments

Comments
 (0)