Skip to content

Commit 8ce8b8d

Browse files
committed
Add Makefile for common tasks
1 parent 97857d4 commit 8ce8b8d

File tree

4 files changed

+37
-11
lines changed

4 files changed

+37
-11
lines changed

Diff for: .github/workflows/linter.yml

+4-7
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
python-version: [3.8, 3.9]
14+
python-version: ['3.8', '3.9', '3.10', '3.11']
1515

1616
steps:
1717
- uses: actions/checkout@v2
@@ -22,10 +22,7 @@ jobs:
2222
- name: Install dependencies
2323
run: |
2424
python -m pip install --upgrade poetry
25-
poetry install
26-
- name: Lint with flake8
25+
make
26+
- name: Run linters
2727
run: |
28-
poetry run flake8 osia --max-line-length 100 --show-source --statistics
29-
- name: Check with pylint
30-
run: |
31-
poetry run pylint osia
28+
make check

Diff for: .github/workflows/python-publish.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ jobs:
2323
sudo apt install libcurl4-openssl-dev libssl-dev
2424
python -m pip install --upgrade pip
2525
pip install poetry
26-
poetry install
26+
make
2727
- name: Build and publish
2828
env:
2929
TOKEN: ${{ secrets.PYPI_TOKEN }}
3030
run: |
31-
poetry build
32-
poetry config pypi-token.pypi "${TOKEN}"
33-
poetry publish
31+
make release

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Created by https://www.gitignore.io/api/python
22
# Edit at https://www.gitignore.io/?templates=python
3+
.mk_poetry*
34

45
### Python ###
56
# Byte-compiled / optimized / DLL files

Diff for: Makefile

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
TOOL := poetry
2+
3+
all: setup_poetry
4+
5+
6+
setup_poetry: .mk_poetry
7+
8+
9+
.mk_poetry: poetry.lock
10+
poetry install
11+
touch .mk_poetry
12+
13+
update: setup_poetry
14+
poetry update
15+
16+
clean:
17+
poetry env list | cut -d' ' -f1 | xargs poetry env remove
18+
rm .mk_poetry*
19+
20+
check: setup_poetry
21+
poetry run flake8 osia --max-line-length 100 --show-source --statistics
22+
poetry run pylint osia
23+
24+
dist: setup_poetry
25+
poetry build
26+
27+
release: dist
28+
poetry release
29+
30+
.PHONY: update clean all check

0 commit comments

Comments
 (0)