Skip to content

Commit 9128a6c

Browse files
authored
Merge pull request #9 from d-chris:develop
Update pre-commit configuration and add frontmatter parser
2 parents 798a4ea + 9b825bf commit 9128a6c

24 files changed

+1012
-587
lines changed

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
day: "friday"
8+
branch: "develop"

.github/workflows/publish.yml

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
11
name: poetry-publish
2-
32
on:
4-
release:
5-
types: [released]
6-
3+
release:
4+
types: [released]
75
jobs:
86
publish:
97
runs-on: ubuntu-latest
108
steps:
11-
- uses: actions/checkout@v4
12-
- name: Set up Python
13-
uses: actions/setup-python@v5
14-
with:
15-
python-version: 3.11
16-
- name: Install dependencies
17-
run: |
18-
python -m pip install --upgrade pip
19-
pip install poetry
20-
poetry install --only-root
21-
- name: Build and publish
22-
env:
23-
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
24-
run: |
25-
poetry version $(git describe --tags)
26-
poetry build
27-
poetry publish
9+
- uses: actions/checkout@v4
10+
- name: Install poetry
11+
run: pipx install poetry
12+
- name: Set up Python
13+
uses: actions/setup-python@v5
14+
with:
15+
python-version: 3.12
16+
- name: Install dependencies
17+
run: |
18+
poetry install --only main
19+
- name: Build Documentation
20+
run: |
21+
poetry run python -m docs
22+
- name: Upload GH Page
23+
uses: peaceiris/actions-gh-pages@v4
24+
with:
25+
github_token: ${{ secrets.GITHUB_TOKEN }}
26+
publish_dir: ./docs/public
27+
- name: Build and publish
28+
env:
29+
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
30+
run: |
31+
poetry version $(git describe --tags)
32+
poetry publish --build

.github/workflows/pytest.yml

Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,48 @@
11
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
22
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3-
43
name: poetry-pytest
5-
64
on:
75
workflow_dispatch:
8-
96
pull_request:
10-
branches: [ "main" ]
11-
7+
branches: ["main"]
128
jobs:
139
test:
14-
1510
runs-on: ${{ matrix.os }}
1611
strategy:
1712
fail-fast: false
1813
matrix:
1914
os: [ubuntu-latest, windows-latest]
2015
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
21-
2216
steps:
23-
- uses: actions/checkout@v4
24-
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
25-
uses: actions/setup-python@v5
26-
with:
27-
python-version: ${{ matrix.python-version }}
28-
- name: Install dependencies
29-
run: |
30-
python -m pip install --upgrade pip
31-
pip install poetry
32-
poetry install --without doc
33-
- name: Test with pytest
34-
run: |
35-
poetry run pytest
17+
- uses: actions/checkout@v4
18+
- name: Install poetry
19+
run: pipx install poetry
20+
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
cache: 'poetry'
25+
- name: Install dependencies
26+
run: |
27+
poetry install --only main,test
28+
- name: Test with pytest
29+
run: |
30+
poetry run pytest
31+
- name: Save Coverage Report
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: coverage-${{ matrix.python-version }}-${{ matrix.os }}
35+
path: coverage.xml
36+
overwrite: true
37+
retention-days: 1
38+
coverage:
39+
runs-on: ubuntu-latest
40+
needs: test
41+
steps:
42+
- name: Restore all Coverage Reports
43+
uses: actions/download-artifact@v4
44+
- name: Upload Coverage Report
45+
uses: codecov/codecov-action@v4
46+
with:
47+
flags: unittests
48+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/testbuild.yml

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
11
name: poetry-testpypi
2-
32
on:
4-
release:
5-
types: [prereleased]
6-
3+
release:
4+
types: [prereleased]
75
jobs:
86
publish:
97
runs-on: ubuntu-latest
108
steps:
11-
- uses: actions/checkout@v4
12-
- name: Set up Python
13-
uses: actions/setup-python@v5
14-
with:
15-
python-version: 3.11
16-
- name: Install dependencies
17-
run: |
18-
python -m pip install --upgrade pip
19-
pip install poetry
20-
poetry install --only-root
21-
- name: Build and publish
22-
env:
23-
POETRY_PYPI_TOKEN_TESTPYPI: ${{ secrets.TESTPYPI_TOKEN }}
24-
run: |
25-
poetry version $(git describe --tags)
26-
poetry build
27-
poetry publish --repository testpypi
9+
- uses: actions/checkout@v4
10+
- name: Install poetry
11+
run: pipx install poetry
12+
- name: Set up Python
13+
uses: actions/setup-python@v5
14+
with:
15+
python-version: 3.12
16+
- name: Install dependencies
17+
run: |
18+
poetry install --only-root
19+
- name: Build and publish
20+
env:
21+
POETRY_PYPI_TOKEN_TESTPYPI: ${{ secrets.TESTPYPI_TOKEN }}
22+
run: |
23+
poetry version $(git describe --tags)
24+
poetry build
25+
poetry publish --repository testpypi

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.vscode
2-
docs/jinja2_pdoc
2+
docs/public/
33

44
# Byte-compiled / optimized / DLL files
55
__pycache__/

.pre-commit-config.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.6.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- id: check-toml
9+
- repo: https://github.com/asottile/add-trailing-comma
10+
rev: v3.1.0
11+
hooks:
12+
- id: add-trailing-comma
13+
- repo: https://github.com/tox-dev/pyproject-fmt
14+
rev: 2.2.1
15+
hooks:
16+
- id: pyproject-fmt
17+
- repo: https://github.com/tox-dev/tox-ini-fmt
18+
rev: 1.3.1
19+
hooks:
20+
- id: tox-ini-fmt
21+
- repo: https://github.com/rhysd/actionlint
22+
rev: v1.7.1
23+
hooks:
24+
- id: actionlint
25+
- repo: https://github.com/psf/black
26+
rev: 24.8.0
27+
hooks:
28+
- id: black
29+
- repo: https://github.com/adamchainz/blacken-docs
30+
rev: "1.18.0"
31+
hooks:
32+
- id: blacken-docs
33+
files: pathlibutil/
34+
- repo: https://github.com/pycqa/isort
35+
rev: 5.13.2
36+
hooks:
37+
- id: isort
38+
- repo: https://github.com/python-poetry/poetry
39+
rev: 1.8.0
40+
hooks:
41+
- id: poetry-check
42+
- id: poetry-lock
43+
- repo: https://github.com/google/yamlfmt
44+
rev: v0.13.0
45+
hooks:
46+
- id: yamlfmt
47+
- repo: https://github.com/PyCQA/flake8
48+
rev: 7.1.1
49+
hooks:
50+
- id: flake8
51+
args: ["--max-line-length", "88"]

.pre-commit-hook.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- id: jinja2pdoc
2+
name: render jinja2pdoc
3+
description: render jinja2 templates to embedd python code directly from module using pdoc.
4+
entry: jinja2pdoc
5+
language: python

0 commit comments

Comments
 (0)