Skip to content

Commit 4b672f2

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

25 files changed

+637
-717
lines changed

.editorconfig

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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
20+

.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

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

.github/workflows/unit-tests.yml

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

.gitignore

+39-33
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,45 @@
1-
# MacOS
2-
.DS_Store
1+
# Python byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
.pytest_cache/
6+
.mypy_cache/
7+
8+
# Virtual environments
9+
.venv/
10+
.tox/
11+
venv/
12+
env/
13+
ENV/
14+
15+
# Python packaging files
16+
dist/
317

4-
# Make
5-
custom.mk
18+
# Pytest coverage reports
19+
htmlcov/
20+
.coverage*
21+
coverage.xml
622

7-
# Python
8-
__pycache__
9-
*.pyc
23+
# Mkdocs documentation
24+
site/
1025

11-
# Generated files
12-
*.egg-info
13-
build/
14-
dist/
15-
# ignore .eggs directory created by setup.py
16-
.eggs/
17-
.conda-built
18-
.coverage
19-
/htmlcov/
20-
/site/
21-
/pages-tmp/
22-
/public/
23-
/tests/.aws/
24-
conda-meta-data.json
25-
# stray build artifacts
26-
*.whl
27-
*.tar.bz2
28-
*.conda
29-
30-
# tox
31-
/.tox/
32-
/tox-env.yml
33-
/tox-requirements.txt
34-
35-
# git
36-
*.orig
26+
# Pyenv local version information
27+
.python-version
28+
29+
# Editor generated files
30+
.idea/
31+
.vscode/
32+
.spyproject/
33+
.spyderproject/
34+
.replit
3735

36+
# Auto-generated folder attributes for MacOS
37+
.DS_STORE
3838

39+
# Local gitignore (symlinked to .git/info/exclude)
40+
.gitignore_local
3941

42+
# Environmental, backup and personal files
43+
*.env
44+
*.bak
45+
TODO

.idea/.gitignore

-4
This file was deleted.

.idea/garpy.mkdocstrings.iml

-13
This file was deleted.

.idea/icon.svg

-1
This file was deleted.

.idea/inspectionProfiles/Project_Default.xml

-18
This file was deleted.

.idea/modules.xml

-8
This file was deleted.

0 commit comments

Comments
 (0)