Skip to content

Commit 0ea1e3a

Browse files
authored
Merge pull request #4 from PrivateAIM/update-template
Update Python template
2 parents 4deb6c5 + ab38085 commit 0ea1e3a

File tree

5 files changed

+288
-160
lines changed

5 files changed

+288
-160
lines changed

.github/workflows/lint.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Lint
2+
3+
env:
4+
DEFAULT_PYTHON_VERSION: "3.13"
5+
DEFAULT_POETRY_VERSION: "2.1.0"
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
pull_request:
12+
types:
13+
- opened
14+
- synchronize
15+
16+
jobs:
17+
lint:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Install Poetry
22+
run: pipx install poetry==${{ env.DEFAULT_POETRY_VERSION }}
23+
- name: Set up Python
24+
uses: actions/setup-python@v5
25+
with:
26+
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
27+
cache: "poetry"
28+
- name: Install dependencies
29+
run: poetry install --with dev
30+
- name: Lint
31+
run: poetry run ruff check .
32+
33+
check-format:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v4
37+
- name: Install Poetry
38+
run: pipx install poetry==${{ env.DEFAULT_POETRY_VERSION }}
39+
- name: Set up Python
40+
uses: actions/setup-python@v5
41+
with:
42+
python-version: ${{ env.DEFAULT_PYTHON_VERSION }}
43+
cache: "poetry"
44+
- name: Install dependencies
45+
run: poetry install --with dev
46+
- name: Lint
47+
run: poetry run ruff format --check .

.github/workflows/test.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Test
2+
3+
env:
4+
DEFAULT_POETRY_VERSION: "2.1.0"
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
types:
12+
- opened
13+
- synchronize
14+
15+
jobs:
16+
test:
17+
runs-on: ubuntu-latest
18+
strategy:
19+
matrix:
20+
python-version:
21+
- "3.13"
22+
- "3.12"
23+
- "3.11"
24+
- "3.10"
25+
fail-fast: false
26+
steps:
27+
- uses: actions/checkout@v4
28+
- name: Install Poetry
29+
run: pipx install poetry==${{ env.DEFAULT_POETRY_VERSION }}
30+
- name: Set up Python
31+
uses: actions/setup-python@v5
32+
with:
33+
python-version: ${{ matrix.python-version }}
34+
cache: "poetry"
35+
- name: Install dependencies
36+
run: poetry install --with dev
37+
- name: Test
38+
run: poetry run pytest -vra

.pre-commit-config.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,23 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.5.0
5+
rev: v5.0.0
66
hooks:
77
- id: check-added-large-files
88
- id: check-toml
99
- id: check-yaml
1010
args: [ --unsafe ]
1111
- id: end-of-file-fixer
1212
- id: trailing-whitespace
13+
args: [ --markdown-linebreak-ext=md ]
1314
- repo: https://github.com/astral-sh/ruff-pre-commit
14-
rev: v0.1.8
15+
rev: v0.9.6
1516
hooks:
1617
- id: ruff
1718
args: [ --fix ]
1819
- id: ruff-format
1920
- repo: https://github.com/compilerla/conventional-pre-commit
20-
rev: v3.0.0
21+
rev: v4.0.0
2122
hooks:
2223
- id: conventional-pre-commit
2324
stages: [ commit-msg ]

0 commit comments

Comments
 (0)