-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Project Setup
- Loading branch information
Showing
13 changed files
with
319 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# This pipeline builds the documentation. | ||
name: docs | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
cache: "pip" | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
version: "1.3.2" | ||
- name: Cache dependencies | ||
id: cache-deps | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: pydeps-${{ hashFiles('**/poetry.lock') }} | ||
- name: Install the dependencies | ||
run: poetry install --no-interaction --no-root --with dev | ||
if: steps.cache-deps.outputs.cache-hit != 'true' | ||
- name: Install the module | ||
run: poetry install --with dev --no-interaction | ||
- name: Generate the documentation | ||
run: poetry run mkdocs gh-deploy --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# This pipeline checks whether the package | ||
# installs properly, passes unit tests and whether | ||
# the code formatting is right. | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
python-version: ["3.12"] | ||
poetry-version: ["1.8.3"] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Run black formatting check | ||
uses: psf/black@stable | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: "pip" | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
version: ${{ matrix.poetry-version }} | ||
- name: Cache dependencies | ||
id: cache-deps | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: pydeps-${{ hashFiles('**/poetry.lock') }} | ||
- name: Install the dependencies | ||
run: poetry install --no-interaction --no-root --with dev | ||
if: steps.cache-deps.outputs.cache-hit != 'true' | ||
- name: Install the module | ||
run: poetry install --with dev --no-interaction | ||
- name: Run unit tests | ||
run: poetry run pytest | ||
- name: Run Ruff | ||
run: poetry run ruff check . | ||
- name: Run interrogate | ||
run: poetry run interrogate src | ||
- name: Run Pyright (type checking) | ||
run: poetry run pyright |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
.DS_Store | ||
*.lock | ||
poetry.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
repos: | ||
- repo: https://github.com/python-poetry/poetry | ||
rev: '1.8.3' | ||
hooks: | ||
- id: poetry-check | ||
- id: poetry-lock | ||
- id: poetry-export | ||
args: ["-f", "requirements.txt", "-o", "requirements.txt"] | ||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: 'v0.0.245' | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] | ||
- repo: https://github.com/psf/black | ||
rev: 23.1.0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/econchick/interrogate | ||
rev: 1.5.0 | ||
hooks: | ||
- id: interrogate | ||
args: [--quiet, --fail-under=95] | ||
- repo: local | ||
hooks: | ||
- id: pyright | ||
name: pyright | ||
entry: poetry run pyright | ||
language: node | ||
pass_filenames: true | ||
types: [python] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# API |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Contributing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Tutorial |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Workflows |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
site_name: usefulgnom | ||
theme: | ||
name: material | ||
features: | ||
- navigation.tabs | ||
- navigation.sections | ||
- toc.integrate | ||
- search.suggest | ||
- search.highlight | ||
- content.tabs.link | ||
- content.code.annotation | ||
- content.code.copy | ||
language: en | ||
palette: | ||
- scheme: default | ||
toggle: | ||
icon: material/toggle-switch-off-outline | ||
name: Switch to dark mode | ||
primary: teal | ||
accent: purple | ||
- scheme: slate | ||
toggle: | ||
icon: material/toggle-switch | ||
name: Switch to light mode | ||
primary: teal | ||
accent: lime | ||
|
||
repo_name: usefulgnom | ||
repo_url: https://github.com/gordonkoehn/usefulgnom | ||
|
||
plugins: | ||
- search | ||
- mkdocstrings: | ||
default_handler: python | ||
handlers: | ||
python: | ||
options: | ||
show_source: false | ||
show_root_heading: true | ||
|
||
nav: | ||
- Home: index.md | ||
- Contributing: contributing.md | ||
- Tutorial: tutorial/index.md | ||
- API: api/index.md | ||
- Workflows: workflows/index.md | ||
|
||
watch: | ||
- src/usefulgnom | ||
|
||
extra: | ||
social: | ||
- icon: fontawesome/brands/github-alt | ||
link: https://github.com/gordonkoehn/usefulgnom | ||
|
||
markdown_extensions: | ||
- pymdownx.highlight: | ||
anchor_linenums: true | ||
- pymdownx.inlinehilite | ||
- pymdownx.snippets | ||
- admonition | ||
- pymdownx.arithmatex: | ||
generic: true | ||
- footnotes | ||
- pymdownx.details | ||
- pymdownx.superfences | ||
- pymdownx.mark | ||
- attr_list | ||
# TODO (Gordon): cannot get this packages to be found my mkdocs | ||
# - pymdownx.emoji: | ||
# emoji_index: !!python/name:materialx.emoji.twemoji | ||
# emoji_generator: !!python/name:materialx.emoji.to_svg | ||
|
||
|
||
extra_javascript: | ||
- javascripts/mathjax.js | ||
- https://polyfill.io/v3/polyfill.min.js?features=es6 | ||
- https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js |
Oops, something went wrong.