Skip to content

Rebrand the project (forking) #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Check http://editorconfig.org for more information
# This is the main config file for this project:
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.{py, pyi}]
indent_size = 4

[*.md]
indent_size = 4
trim_trailing_whitespace = false
max_line_length = 120
35 changes: 35 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Bug report
description: Found a bug? Let us know so we can fix it!
labels: ["bug"]

body:
- type: textarea
id: bug-description
attributes:
label: Bug description
description: Describe the bug. What's wrong?
validations:
required: true

- type: textarea
id: reproduction-steps
attributes:
label: Reproduction
description: Steps to reproduce the bug. You can also include code snippets. Try to keep things as minimal as you can.

- type: textarea
id: further-info
attributes:
label: Further info
description: Any further info such as images, exception tracebacks, ...

- type: checkboxes
id: checklist
attributes:
label: Checklist
description: Make sure to tick all the following boxes.
options:
- 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.
required: true
- label: I have made sure to remove ANY sensitive information (passwords, credentials, personal details, etc.).
required: true
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Feature request
description: Got a cool idea you would like implemented? Let us know!
labels: ["feature"]

body:
- type: textarea
id: summary
attributes:
label: Summary
description: Quick summary of the feature.
validations:
required: true

- type: textarea
id: problem
attributes:
label: Why is this needed?
description: Why should this feature be implemented? What problem(s) would it solve?

- type: textarea
id: ideal-implementation
attributes:
label: Ideal implementation
description: How should this feature be implemented?
value: To be decided.

- type: checkboxes
id: checklist
attributes:
label: Checklist
description: Make sure to tick all the following boxes.
options:
- 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.
required: true
54 changes: 18 additions & 36 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,21 @@
---
name: CI
on: [push]

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

# Cancel already running workflows if new ones are scheduled
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build-os-python:
runs-on: ubuntu-latest
strategy:
max-parallel: 5
fail-fast: true
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.10", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: goanpeca/setup-miniconda@v2.2.0
with:
miniforge-version: latest
conda-version: ">=23.7.4"
conda-build-version: ">=3.26"
environment-file: environment.yml
activate-environment: mkxref-dev
python-version: ${{ matrix.python-version }}
condarc-file: github-condarc.yml
auto-activate-base: true
use-mamba: true
- name: Dev install package
run: |
conda run -n mkxref-dev pip install -e . --no-deps --no-build-isolation
- name: ruff
run: |
make ruff
- name: mypy
if: success() || failure()
run: |
make mypy
- name: Test with pytest
if: success() || failure()
run: |
make coverage-test
validation:
uses: ./.github/workflows/validation.yml

unit-tests:
uses: ./.github/workflows/unit-tests.yml
71 changes: 71 additions & 0 deletions .github/workflows/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
name: MkDocs

on:
push:
branches:
- main
pull_request:
types: # Add closed type
- opened
- reopened
- synchronize
- closed # to delete the PR preview

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: write
pull-requests: write

env:
PYTHON_VERSION: "3.14"

jobs:
deploy-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: "${{ github.token }}"
# Fetch the entire git history (all branches + tags)
# We do this because the docs use git describe, which requires having all
# the commits up to the latest version tag.
# We also need the gh-pages branch to push the docs to.
fetch-depth: 0

- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
version: "latest"
python-version: ${{ env.PYTHON_VERSION }}
enable-cache: true
cache-suffix: "docs-py${{ env.python-version }}"

- name: Install dependencies
run: |
uv sync --no-default-groups --group docs

- name: Build the documentation (mkdocs - PR preview)
if: ${{ github.event_name == 'pull_request' }}
run: mkdocs build

- name: Deploy docs - PR preview
if: ${{ github.event_name == 'pull_request' }}
uses: rossjrw/pr-preview-action@v1
with:
source-dir: ./site
preview-branch: gh-pages
umbrella-dir: pr-preview
token: ${{ github.token }}

- name: Build the documentation (mike)
if: ${{ github.event_name == 'push' }}
run: mike deploy latest

- name: Deploy docs - latest
if: ${{ github.event_name == 'push' }}
run: git push origin gh-pages
83 changes: 83 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Publish to PyPI / GitHub

on:
push:
tags:
- "v*"

permissions:
contents: read

env:
PYTHON_VERSION: "3.14"

jobs:
build:
name: "Build the project"
runs-on: ubuntu-latest

outputs:
prerelease: ${{ steps.check-version.outputs.prerelease }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
version: "latest"
python-version: ${{ env.PYTHON_VERSION }}
enable-cache: true
cache-suffix: "publish-py${{ env.python-version }}"

- name: Install dependencies
run: |
# We only need the project dependencies, no development deps
uv sync --no-default-groups

- name: Upload build files
uses: actions/upload-artifact@v4
with:
name: "dist"
path: "dist/"
if-no-files-found: error
retention-days: 5

publish-github:
name: "Publish a GitHub release"
needs: build
runs-on: ubuntu-latest

steps:
- name: Download the distribution files from PR artifact
uses: actions/download-artifact@v4
with:
name: "dist"
path: "dist/"

- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "dist/*"
bodyFile: changelog.txt
draft: false

publish-pypi:
name: "Publish to PyPI"
needs: build
runs-on: ubuntu-latest
permissions:
# Used to authenticate to PyPI via OIDC.
id-token: write

steps:
- name: Download the distribution files from PR artifact
uses: actions/download-artifact@v4
with:
name: "dist"
path: "dist/"

# This uses PyPI's trusted publishing, so no token is required
- name: Release to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
54 changes: 54 additions & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
name: Unit-Tests

on: workflow_call

jobs:
unit-tests:
strategy:
fail-fast: false # Allows for matrix sub-jobs to fail without cancelling the rest
matrix:
platform: [ubuntu-latest, windows-latest]
python-version: ["3.9", "3.14"]

runs-on: ${{ matrix.platform }}

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup uv
uses: astral-sh/setup-uv@v5
with:
version: "latest"
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-suffix: "test-py${{ matrix.python-version }}"

- name: Install dependencies
run: |
uv sync --no-default-groups --group test

- name: Run pytest
shell: bash
run: pytest -vv

# This job is used purely to provide a workflow status, which we can mark as a
# required action in branch protection rules. This is a better option than marking
# the unit-tests jobs manually, since their names change as the supported python
# versions change. This job provides an easy single action that can be marked required.
tests-done:
needs: [unit-tests]
if: always() && !cancelled()
runs-on: ubuntu-latest

steps:
- name: Set status based on required jobs
env:
RESULTS: ${{ join(needs.*.result, ' ') }}
run: |
for result in $RESULTS; do
if [ "$result" != "success" ]; then
exit 1
fi
done
Loading
Loading