Skip to content

Commit 9e6e51a

Browse files
author
Deployment Bot
committed
0 parents  commit 9e6e51a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+4387
-0
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
**Describe the bug**
10+
A clear and concise description of what the bug is.
11+
12+
**To Reproduce**
13+
Steps to reproduce the behavior:
14+
1. Go to '...'
15+
2. Click on '....'
16+
3. Scroll down to '....'
17+
4. See error
18+
19+
**Expected behavior**
20+
A clear and concise description of what you expected to happen.
21+
22+
**Screenshots**
23+
If applicable, add screenshots to help explain your problem.
24+
25+
**Traces**
26+
If applicable, provide a Python stack trace or JavaScript console log from the browser
27+
28+
**Environment**
29+
Provide information about versions of relevant software packages.
30+
31+
- Python Version (e.g. 3.8.10)
32+
- poetry version (e.g. 1.2.1)
33+
- Browser [e.g. chrome, safari] + Version
34+
35+
**Additional context**
36+
Add any other context about the problem here.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
**Is your feature request related to a problem? Please describe.**
10+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11+
12+
**Describe the solution you'd like**
13+
A clear and concise description of what you want to happen.
14+
15+
**Describe alternatives you've considered**
16+
A clear and concise description of any alternative solutions or features you've considered.
17+
18+
**Additional context**
19+
Add any other context or screenshots about the feature request here.

.github/workflows/ci.yml

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
name: CI
2+
# Main CI pipeline of the repository.
3+
#
4+
# Overview:
5+
# Lint --> test doc build -\
6+
# \-> test code ---> deploy docs (*) -> release (**)
7+
#
8+
# (*): only on push of primary branches + release tags
9+
# (**): only for release version tags (vX.Y.Z)
10+
11+
on:
12+
push:
13+
branches: [main, dev]
14+
tags: ["v*.*.*"]
15+
pull_request:
16+
types: [opened, reopened, synchronize, ready_for_review]
17+
18+
jobs:
19+
20+
lint:
21+
# run general checks that do not require installing the package
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
- uses: actions/checkout@v4
26+
- name: Install poetry
27+
run: pipx install poetry
28+
- uses: actions/setup-python@v5
29+
with:
30+
python-version: "3.10"
31+
32+
- name: Install poe, pre-commit and safety
33+
run: pip install poethepoet pre-commit safety
34+
35+
# NOTE: using custom cache, to include pre-commit linters + deps
36+
- uses: actions/cache@v4
37+
with:
38+
path: |
39+
~/.cache/pre-commit
40+
~/.cache/pip
41+
key: ${{ hashFiles('.pre-commit-config.yaml') }}-pre-commit
42+
43+
- name: Check that all static analysis tools run without errors
44+
run: poetry run poe lint --all-files
45+
46+
- name: Scan dependencies for known vulnerabilities
47+
run: safety check -r pyproject.toml
48+
49+
test-build-docs:
50+
# make sure that documentation is buildable
51+
# (better to know that before e.g. a PR is merged)
52+
needs: lint
53+
runs-on: ubuntu-latest
54+
55+
steps:
56+
- uses: actions/checkout@v4
57+
- name: Install poetry
58+
run: pipx install poetry
59+
- uses: actions/setup-python@v5
60+
with:
61+
python-version: "3.10"
62+
cache: "poetry"
63+
64+
- name: Check that documentation builds without errors
65+
run: |
66+
poetry install --with docs
67+
poetry run poe docs --verbose
68+
69+
test:
70+
# run tests with different OS and Python combinations
71+
needs: lint
72+
strategy:
73+
fail-fast: true
74+
matrix:
75+
os: [ "ubuntu-latest", "macos-latest", "windows-latest" ]
76+
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
77+
runs-on: ${{ matrix.os }}
78+
79+
steps:
80+
- uses: actions/checkout@v4
81+
- name: Install poetry
82+
run: pipx install poetry
83+
- uses: actions/setup-python@v5
84+
with:
85+
python-version: ${{ matrix.python-version }}
86+
cache: "poetry"
87+
88+
- name: Check that tests complete without errors
89+
run: |
90+
poetry install
91+
poetry run poe test
92+
93+
docs:
94+
# build + deploy documentation (only on push event for certain branches+tags)
95+
needs: [test, test-build-docs]
96+
if: github.event_name == 'push'
97+
runs-on: ubuntu-latest
98+
permissions:
99+
contents: write
100+
101+
steps:
102+
- uses: actions/checkout@v4
103+
- name: Install poetry
104+
run: pipx install poetry
105+
- uses: actions/setup-python@v5
106+
with:
107+
python-version: "3.10"
108+
cache: "poetry"
109+
110+
- name: Install project with mkdocs and plugins
111+
run: poetry install --with docs
112+
113+
- name: Configure Git user (Github Actions Bot)
114+
run: |
115+
git config --local user.name "github-actions[bot]"
116+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
117+
118+
- name: Check out or initialize gh-pages branch
119+
run: |
120+
if git fetch origin gh-pages:gh-pages
121+
then
122+
echo "Found existing gh-pages branch."
123+
else
124+
echo "Creating new gh-pages branch and initializing mike."
125+
poetry run mike deploy -u ${{ github.ref_name }} latest
126+
poetry run mike set-default latest
127+
fi
128+
129+
- name: Build and deploy documentation to gh-pages
130+
run: |
131+
SET_LATEST=""
132+
if [[ "${{ github.ref_name }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+*$ ]]; then
133+
# if a new release tag is pushed, mark the built documentation as 'latest'
134+
SET_LATEST="latest"
135+
fi
136+
poetry run mike deploy -u --push ${{ github.ref_name }} $SET_LATEST
137+
138+
publish:
139+
# if a version tag is pushed + tests + docs completed -> do release
140+
needs: docs
141+
if: startswith(github.ref, 'refs/tags/v')
142+
permissions:
143+
contents: write # for GitHub release
144+
id-token: write # for PyPI release
145+
146+
uses: "./.github/workflows/release.yml"
147+
with:
148+
to_github: true
149+
to_test_pypi: false
150+
to_pypi: false

.github/workflows/release.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Release
2+
# Release a new version to different targets in suitable ways
3+
4+
on:
5+
workflow_call: # called from ci.yml
6+
inputs:
7+
to_github:
8+
description: "Create a Github Release (repository snapshot)"
9+
type: boolean
10+
default: true
11+
12+
to_test_pypi:
13+
description: "Publish to Test PyPI."
14+
type: boolean
15+
default: false
16+
17+
to_pypi:
18+
description: "Publish to PyPI."
19+
type: boolean
20+
default: false
21+
22+
23+
jobs:
24+
25+
github:
26+
if: inputs.to_github
27+
name: Create a Github Release (repository snapshot)
28+
runs-on: ubuntu-latest
29+
permissions:
30+
contents: write # needed for creating a GH Release
31+
steps:
32+
- uses: actions/checkout@v3
33+
- uses: softprops/action-gh-release@v1
34+
35+
pypi:
36+
if: inputs.to_pypi || inputs.to_test_pypi
37+
name: Publish to PyPI (and/or compatible repositories)
38+
runs-on: ubuntu-latest
39+
permissions:
40+
id-token: write # needed for "trusted publishing" protocol
41+
steps:
42+
- uses: actions/checkout@v3
43+
44+
- name: Install poetry
45+
run: pipx install poetry
46+
47+
- uses: actions/setup-python@v4
48+
with:
49+
python-version: "3.10"
50+
cache: "poetry"
51+
52+
- name: Build the distribution package
53+
run: poetry build
54+
55+
- name: Publish package to TestPyPI
56+
if: inputs.to_test_pypi
57+
uses: pypa/gh-action-pypi-publish@release/v1
58+
with:
59+
repository-url: https://test.pypi.org/legacy/
60+
61+
- name: Publish package to PyPI
62+
if: inputs.to_pypi
63+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)