Skip to content

Commit 39ef02b

Browse files
authored
Update pre-commit config and add testing workflow (#15)
## Describe your changes Updated pre-commit configuration, package versions, and add testing workflow.
1 parent df7bf93 commit 39ef02b

File tree

6 files changed

+211
-144
lines changed

6 files changed

+211
-144
lines changed

.github/pull_request_template.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ https://success.vanillaforums.com/kb/articles/228-using-pull-requests-to-contrib
1212

1313

1414
## Checklist before requesting a review
15-
<!--- These are suggested things you could add, but what you add will be dependent on your repository's standards. --->
15+
<!---
16+
These are suggested things you could add, but what you add will be dependent on
17+
your repository's standards.
18+
--->
1619
- [ ] The code runs successfully.
1720

1821
```commandline

.github/workflows/format-and-fail.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: Format-and-Fail
22
on:
3+
push:
4+
branches: [ main ]
35
pull_request:
4-
branches:
5-
- main
6+
branches: [ main ]
67

78
jobs:
89
pre-commit:

.github/workflows/run-tests.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Run-Tests
2+
on:
3+
push:
4+
branches: [ main ]
5+
pull_request:
6+
branches: [ main ]
7+
8+
jobs:
9+
Test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/setup-python@v2
14+
with:
15+
python-version: 3.11
16+
- name: Cache Poetry install
17+
uses: actions/cache@v2
18+
with:
19+
path: ~/.local
20+
key: poetry-1.5.1
21+
- uses: snok/install-poetry@v1
22+
with:
23+
version: 1.5.1
24+
virtualenvs-create: true
25+
virtualenvs-in-project: true
26+
- name: cache deps
27+
id: cache-deps
28+
uses: actions/cache@v2
29+
with:
30+
path: .venv
31+
key: pydeps-${{ hashFiles('**/poetry.lock') }}
32+
- run: poetry install --no-interaction --no-root
33+
if: steps.cache-deps.outputs.cache-hit != 'true'
34+
- run: poetry install --no-interaction
35+
- run: poetry run pytest

.pre-commit-config.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
repos:
2+
- repo: https://github.com/nbQA-dev/nbQA
3+
rev: 1.7.1
4+
hooks:
5+
- id: nbqa-ruff
6+
exclude: data/
7+
args:
8+
- --fix
9+
- --ignore=E721,E722
10+
- id: nbqa-black
11+
exclude: data/
12+
- id: nbqa-isort
13+
exclude: data/
14+
215
- repo: https://github.com/pre-commit/pre-commit-hooks
316
rev: v4.4.0
417
hooks:

0 commit comments

Comments
 (0)