Skip to content

Commit d9975bf

Browse files
committed
Rebrand the project (forking)
1 parent b0f9e78 commit d9975bf

Some content is hidden

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

59 files changed

+2923
-1187
lines changed

.editorconfig

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Check http://editorconfig.org for more information
2+
# This is the main config file for this project:
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
indent_style = space
10+
indent_size = 2
11+
trim_trailing_whitespace = true
12+
13+
[*.{py, pyi}]
14+
indent_size = 4
15+
16+
[*.md]
17+
indent_size = 4
18+
trim_trailing_whitespace = false
19+
max_line_length = 120

.github/ISSUE_TEMPLATE/bug_report.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Bug report
2+
description: Found a bug? Let us know so we can fix it!
3+
labels: ["bug"]
4+
5+
body:
6+
- type: textarea
7+
id: bug-description
8+
attributes:
9+
label: Bug description
10+
description: Describe the bug. What's wrong?
11+
validations:
12+
required: true
13+
14+
- type: textarea
15+
id: reproduction-steps
16+
attributes:
17+
label: Reproduction
18+
description: Steps to reproduce the bug. You can also include code snippets. Try to keep things as minimal as you can.
19+
20+
- type: textarea
21+
id: further-info
22+
attributes:
23+
label: Further info
24+
description: Any further info such as images, exception tracebacks, ...
25+
26+
- type: checkboxes
27+
id: checklist
28+
attributes:
29+
label: Checklist
30+
description: Make sure to tick all the following boxes.
31+
options:
32+
- label: I have searched the issue tracker and have made sure it's not a duplicate. If it is a follow up of another issue, I have specified it.
33+
required: true
34+
- label: I have made sure to remove ANY sensitive information (passwords, credentials, personal details, etc.).
35+
required: true
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Feature request
2+
description: Got a cool idea you would like implemented? Let us know!
3+
labels: ["feature"]
4+
5+
body:
6+
- type: textarea
7+
id: summary
8+
attributes:
9+
label: Summary
10+
description: Quick summary of the feature.
11+
validations:
12+
required: true
13+
14+
- type: textarea
15+
id: problem
16+
attributes:
17+
label: Why is this needed?
18+
description: Why should this feature be implemented? What problem(s) would it solve?
19+
20+
- type: textarea
21+
id: ideal-implementation
22+
attributes:
23+
label: Ideal implementation
24+
description: How should this feature be implemented?
25+
value: To be decided.
26+
27+
- type: checkboxes
28+
id: checklist
29+
attributes:
30+
label: Checklist
31+
description: Make sure to tick all the following boxes.
32+
options:
33+
- label: I have searched the issue tracker and have made sure it's not a duplicate. If it is a follow up of another issue, I have specified it.
34+
required: true

.github/workflows/main.yml

+18-36
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,21 @@
1+
---
12
name: CI
2-
on: [push]
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
workflow_dispatch:
10+
11+
# Cancel already running workflows if new ones are scheduled
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
315

416
jobs:
5-
build-os-python:
6-
runs-on: ubuntu-latest
7-
strategy:
8-
max-parallel: 5
9-
fail-fast: true
10-
matrix:
11-
os: [ubuntu-latest, macos-latest, windows-latest]
12-
python-version: ["3.8", "3.10", "3.12"]
13-
steps:
14-
- uses: actions/checkout@v3
15-
- uses: goanpeca/setup-miniconda@v2.2.0
16-
with:
17-
miniforge-version: latest
18-
conda-version: ">=23.7.4"
19-
conda-build-version: ">=3.26"
20-
environment-file: environment.yml
21-
activate-environment: mkxref-dev
22-
python-version: ${{ matrix.python-version }}
23-
condarc-file: github-condarc.yml
24-
auto-activate-base: true
25-
use-mamba: true
26-
- name: Dev install package
27-
run: |
28-
conda run -n mkxref-dev pip install -e . --no-deps --no-build-isolation
29-
- name: ruff
30-
run: |
31-
make ruff
32-
- name: mypy
33-
if: success() || failure()
34-
run: |
35-
make mypy
36-
- name: Test with pytest
37-
if: success() || failure()
38-
run: |
39-
make coverage-test
17+
validation:
18+
uses: ./.github/workflows/validation.yml
19+
20+
unit-tests:
21+
uses: ./.github/workflows/unit-tests.yml

.github/workflows/mkdocs.yml

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
name: MkDocs
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
types: # Add closed type
10+
- opened
11+
- reopened
12+
- synchronize
13+
- closed # to delete the PR preview
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
18+
19+
permissions:
20+
contents: write
21+
pull-requests: write
22+
23+
env:
24+
PYTHON_VERSION: "3.14"
25+
26+
jobs:
27+
deploy-docs:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
with:
33+
token: "${{ github.token }}"
34+
# Fetch the entire git history (all branches + tags)
35+
# We do this because the docs use git describe, which requires having all
36+
# the commits up to the latest version tag.
37+
# We also need the gh-pages branch to push the docs to.
38+
fetch-depth: 0
39+
40+
- name: Setup uv
41+
uses: astral-sh/setup-uv@v5
42+
with:
43+
version: "latest"
44+
python-version: ${{ env.PYTHON_VERSION }}
45+
enable-cache: true
46+
cache-suffix: "docs-py${{ env.python-version }}"
47+
48+
- name: Install dependencies
49+
run: |
50+
uv sync --no-default-groups --group docs
51+
52+
- name: Build the documentation (mkdocs - PR preview)
53+
if: ${{ github.event_name == 'pull_request' }}
54+
run: mkdocs build
55+
56+
- name: Deploy docs - PR preview
57+
if: ${{ github.event_name == 'pull_request' }}
58+
uses: rossjrw/pr-preview-action@v1
59+
with:
60+
source-dir: ./site
61+
preview-branch: gh-pages
62+
umbrella-dir: pr-preview
63+
token: ${{ github.token }}
64+
65+
- name: Build the documentation (mike)
66+
if: ${{ github.event_name == 'push' }}
67+
run: mike deploy latest
68+
69+
- name: Deploy docs - latest
70+
if: ${{ github.event_name == 'push' }}
71+
run: git push origin gh-pages

.github/workflows/unit-tests.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
name: Unit-Tests
3+
4+
on: workflow_call
5+
6+
jobs:
7+
unit-tests:
8+
strategy:
9+
fail-fast: false # Allows for matrix sub-jobs to fail without cancelling the rest
10+
matrix:
11+
platform: [ubuntu-latest, windows-latest]
12+
python-version: ["3.9", "3.14"]
13+
14+
runs-on: ${{ matrix.platform }}
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Setup uv
21+
uses: astral-sh/setup-uv@v5
22+
with:
23+
version: "latest"
24+
python-version: ${{ matrix.python-version }}
25+
enable-cache: true
26+
cache-suffix: "test-py${{ matrix.python-version }}"
27+
28+
- name: Install dependencies
29+
run: |
30+
uv sync --no-default-groups --group test
31+
32+
- name: Run pytest
33+
shell: bash
34+
run: pytest -vv
35+
36+
# This job is used purely to provide a workflow status, which we can mark as a
37+
# required action in branch protection rules. This is a better option than marking
38+
# the unit-tests jobs manually, since their names change as the supported python
39+
# versions change. This job provides an easy single action that can be marked required.
40+
tests-done:
41+
needs: [unit-tests]
42+
if: always() && !cancelled()
43+
runs-on: ubuntu-latest
44+
45+
steps:
46+
- name: Set status based on required jobs
47+
env:
48+
RESULTS: ${{ join(needs.*.result, ' ') }}
49+
run: |
50+
for result in $RESULTS; do
51+
if [ "$result" != "success" ]; then
52+
exit 1
53+
fi
54+
done

.github/workflows/validation.yml

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Validation
2+
3+
on: workflow_call
4+
5+
env:
6+
PYTHON_VERSION: "3.14"
7+
PRE_COMMIT_HOME: "/home/runner/.cache/pre-commit"
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Setup uv
18+
uses: astral-sh/setup-uv@v5
19+
with:
20+
version: "latest"
21+
python-version: ${{ env.PYTHON_VERSION }}
22+
enable-cache: true
23+
cache-suffix: "validation-py${{ env.python-version }}"
24+
25+
- name: Install dependencies
26+
run: |
27+
# We need the test group here to allow pyright to type-check code in tests
28+
uv sync --no-default-groups --group lint --group test
29+
30+
- name: Get precommit version
31+
id: precommit_version
32+
run: |
33+
PACKAGE_VERSION=$(pip show pre-commit | grep -i "version:" | awk '{print $2}')
34+
echo "version=$PACKAGE_VERSION" >> $GITHUB_ENV
35+
36+
- name: Pre-commit Environment Caching
37+
uses: actions/cache@v4
38+
with:
39+
path: ${{ env.PRE_COMMIT_HOME }}
40+
key:
41+
"precommit-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ steps.precommit_version.outputs.version }}-\
42+
${{ hashFiles('./.pre-commit-config.yaml') }}"
43+
# Restore keys allows us to perform a cache restore even if the full cache key wasn't matched.
44+
# That way we still end up saving new cache, but we can still make use of the cache from previous
45+
# version.
46+
restore-keys: "precommit-${{ runner.os }}-${{ steps.poetry_setup.outputs-python-version}}-"
47+
48+
- name: Run pre-commit hooks
49+
run: SKIP=ruff-linter,ruff-formatter,slotscheck,basedpyright pre-commit run --all-files
50+
51+
- name: Run ruff linter
52+
run: ruff check --output-format=github --show-fixes --exit-non-zero-on-fix .
53+
54+
- name: Run ruff formatter
55+
run: ruff format --diff .
56+
57+
- name: Run basedpyright type checker
58+
run: basedpyright --warnings .
59+
60+
- name: Check UV Lockfile
61+
run: uv lock --check

0 commit comments

Comments
 (0)