Skip to content

Commit

Permalink
Add mypy tests to workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
153957 committed Jun 5, 2023
1 parent 26fd851 commit 6cb4809
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 11 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,28 @@ jobs:
log_level: INFO
blacklist: index_footer.html index_header.html

tests:
rufftests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: 'requirements-dev.txt'
- run: make devinstall
- run: make linttest
cache-dependency-path: 'requirements-ruff.txt'
- run: make ruffinstall
- run: make rufftest

mypytests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
cache-dependency-path: |
requirements-mypy.txt
requirements.txt
- run: make mypyinstall
- run: make mypytest
19 changes: 14 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
.PHONY: devinstall
devinstall:
.PHONY: mypyinstall
mypyinstall:
pip install --upgrade pip
pip install --upgrade --upgrade-strategy eager -r requirements-dev.txt
pip install --upgrade --upgrade-strategy eager -r requirements-mypy.txt

.PHONY: ruffinstall
ruffinstall:
pip install --upgrade pip
pip install --upgrade --upgrade-strategy eager -r requirements-ruff.txt

.PHONY: install
install:
pip install --upgrade pip
pip install --upgrade --upgrade-strategy eager -r requirements.txt

.PHONY: linttest
linttest:
.PHONY: mypytest
mypytest:
mypy .

.PHONY: rufftest
rufftest:
ruff .

.PHONY: clean
Expand Down
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,18 @@ This showcases my photography and time-lapse.

## Setup

Create a new virtual env with Python 3.11 and install the requirements:
Create a new virtual environment with Python 3.11:

conda create -n website python=3.11 --yes
pip install -r requirements.txt

or

python3.11 -m venv <venv>
source <venv>/bin/activate

And install the requirements:

make install


## Make website
Expand Down
2 changes: 2 additions & 0 deletions requirements-mypy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-r requirements.txt
mypy==1.3.0
File renamed without changes.

0 comments on commit 6cb4809

Please sign in to comment.