Skip to content

Commit 421c6f7

Browse files
authored
Update release pipeline (#294)
1 parent a572440 commit 421c6f7

3 files changed

Lines changed: 33 additions & 30 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v2
16+
- name: Install
17+
id: install
18+
run: make install
1619
- name: Lint
1720
id: lint
1821
run: |
19-
make pylint
20-
make mypy
22+
make format
23+
make lint
2124
- name: Test
2225
id: test
2326
run: make test
@@ -45,4 +48,4 @@ jobs:
4548
- uses: act10ns/slack@v1
4649
with:
4750
status: ${{ job.status }}
48-
steps: ${{ toJson(steps) }}
51+
steps: ${{ toJson(steps) }}

.pre-commit-config.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ repos:
1717
- id: debug-statements
1818
- id: double-quote-string-fixer
1919
- id: end-of-file-fixer
20-
- id: flake8
2120
- id: fix-encoding-pragma
2221
args: ['--remove']
2322
- id: pretty-format-json
@@ -26,6 +25,10 @@ repos:
2625
args: ['--django']
2726
- id: requirements-txt-fixer
2827
- id: trailing-whitespace
28+
- repo: https://gitlab.com/pycqa/flake8
29+
rev: 3.9.2
30+
hooks:
31+
- id: flake8
2932
- repo: https://github.com/asottile/pyupgrade
3033
rev: v1.27.0
3134
hooks:

Makefile

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
VENV=venv
44
PYTHON=$(VENV)/bin/python
55
PIP=$(VENV)/bin/pip --disable-pip-version-check
6-
PYLINT=$(VENV)/bin/pylint
6+
FLAKE8=$(VENV)/bin/flake8
77
MYPY=$(VENV)/bin/mypy
8-
BLACK=$(VENV)/bin/black
98
TOX=$(VENV)/bin/tox
109
PYTEST=$(VENV)/bin/pytest
10+
DOCKER_COMPOSE=docker-compose
1111
PRE_COMMIT=$(VENV)/bin/pre-commit
1212
WHEEL=$(VENV)/bin/wheel
1313
TWINE=$(VENV)/bin/twine
@@ -31,23 +31,20 @@ all: help
3131
$(PIP):
3232
python3 -m venv $(VENV)
3333

34-
$(PYLINT): $(PIP)
35-
$(PIP) install pylint
34+
$(FLAKE8): $(PIP)
35+
$(PIP) install flake8==4.0.1
3636

3737
$(MYPY): $(PIP)
38-
$(PIP) install mypy
39-
40-
$(BLACK): $(PIP)
41-
$(PIP) install black
38+
$(PIP) install mypy==0.812
4239

4340
$(TOX): $(PIP)
4441
$(PIP) install tox
4542

4643
$(PYTEST): $(PIP)
47-
$(PIP) install pytest
44+
$(PIP) install pytest==6.2.5 pytest-cov==3.0.0
4845

4946
$(PRE_COMMIT): $(PIP)
50-
$(PIP) install pre-commit
47+
$(PIP) install pre-commit==2.15.0
5148

5249
$(WHEEL): $(PIP)
5350
$(PIP) install wheel
@@ -59,19 +56,18 @@ ifdef TOXENV
5956
toxparams?=-e $(TOXENV)
6057
endif
6158

62-
## format - Code formatter.
63-
format: $(BLACK)
64-
$(BLACK) -l120 -S -v $(PROJECT)
65-
66-
## lint - Lint and type checking.
67-
lint: $(PYLINT) $(MYPY) $(BLACK)
68-
$(PYLINT) --rcfile pylintrc $(PROJECT)
69-
$(MYPY) $(PROJECT)/
70-
$(BLACK) -l120 -S --check -v $(PROJECT) || true
59+
## install - Install dependencies.
60+
install: $(PIP)
61+
$(PIP) install -r requirements.txt
7162

7263
## hooks - Run pre-commit hooks.
7364
hooks: $(PRE_COMMIT)
74-
$(PRE_COMMIT) run -a
65+
$(PRE_COMMIT) run --all-files --show-diff-on-failure
66+
67+
## lint - Lint and type checking.
68+
lint: $(FLAKE8) $(MYPY)
69+
$(FLAKE8) $(PROJECT)/
70+
$(MYPY) $(PROJECT)/
7571

7672
## test - Run all tests.
7773
test: test.unit test.integration
@@ -82,11 +78,11 @@ test.unit: $(TOX) $(PYTEST)
8278

8379
## test.integration - Run integration tests.
8480
test.integration:
85-
docker-compose -f docker-compose.ci.yaml rm --stop --force
86-
docker-compose -f docker-compose.ci.yaml pull
87-
docker-compose -f docker-compose.ci.yaml build sut
88-
docker-compose -f docker-compose.ci.yaml up --exit-code-from sut
89-
docker-compose -f docker-compose.ci.yaml rm --stop --force
81+
$(DOCKER_COMPOSE) -f docker-compose.ci.yaml rm --stop --force
82+
$(DOCKER_COMPOSE) -f docker-compose.ci.yaml pull
83+
$(DOCKER_COMPOSE) -f docker-compose.ci.yaml build sut
84+
$(DOCKER_COMPOSE) -f docker-compose.ci.yaml up --exit-code-from sut
85+
$(DOCKER_COMPOSE) -f docker-compose.ci.yaml rm --stop --force
9086

9187
## run - Run application.
9288
run:
@@ -102,7 +98,8 @@ build: $(PIP) $(WHEEL) $(PKG_SDIST) $(PKG_WHEEL)
10298

10399
$(PKG_SDIST):
104100
$(PYTHON) setup.py sdist
105-
$(PKG_WHEEL):
101+
102+
$(PKG_WHEEL): $(WHEEL)
106103
$(PYTHON) setup.py bdist_wheel
107104

108105
## upload - Upload package to PyPI.

0 commit comments

Comments
 (0)