Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
998a81d
Updated pre-commit hooks
max-models Feb 3, 2026
908180b
Updated pre commit hooks
max-models Feb 3, 2026
a4dca0b
isort before black
max-models Feb 3, 2026
cffa082
Updated python versions
max-models Feb 3, 2026
80e9ebb
Moved tests into the src
max-models Feb 3, 2026
23e2f8d
Added script for setting up project
max-models Feb 3, 2026
22db63e
Rename the import
max-models Feb 3, 2026
fc469d9
Updated prints
max-models Feb 3, 2026
7c92571
Added more deps
max-models Feb 3, 2026
98fc575
Added _static
max-models Feb 3, 2026
4787fc5
Moved custom.css
max-models Feb 3, 2026
c9d68e8
Rewrote the docs a bit
max-models Feb 3, 2026
a9f08b5
Updated the docs
max-models Feb 3, 2026
d4437e7
Autosummary to gitignore
max-models Feb 3, 2026
e54c1ea
Added ruff to pre-commit
max-models Feb 3, 2026
6e514f9
Added test_docs_job
max-models Feb 3, 2026
911dadd
Adde test_docs
max-models Feb 3, 2026
56d7981
isort,black --> ruff
max-models Feb 3, 2026
82a0fff
Added rm
max-models Feb 3, 2026
c89a708
Test setup script
max-models Feb 3, 2026
9df0568
Fixes
max-models Feb 3, 2026
e8062b4
Renaming
max-models Feb 3, 2026
0dba336
Separate tutorial and pytest
max-models Feb 3, 2026
821c501
Fixed setup_project.sh
max-models Feb 3, 2026
b77cf12
Test
max-models Feb 3, 2026
9d41eba
Fixed setup_project.sh
max-models Feb 3, 2026
fdd3848
Remove the test file in the script
max-models Feb 3, 2026
8e1b100
Run everything relative to the script directory
max-models Feb 3, 2026
359cca9
Fixed docs build
max-models Feb 3, 2026
9cd1392
Removed .github/workflows/test.yml
max-models Feb 3, 2026
bd11a74
copy tutorials
max-models Feb 3, 2026
378605e
Fix publishing to pypi
max-models Feb 3, 2026
555ae61
Formatting with prettier
max-models Feb 3, 2026
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
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
*.ipynb filter=strip-notebook-output
*.ipynb filter=strip-notebook-output
40 changes: 40 additions & 0 deletions .github/actions/build-docs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: "Build Documentation"
description: "Build Sphinx documentation"
inputs:
python-version:
description: "Python version to use"
required: false
default: "3.10"
treat-warnings-as-errors:
description: "Treat warnings as errors (-W flag)"
required: false
default: "false"
runs:
using: "composite"
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}

- name: Install pandoc
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y pandoc

- name: Install Python dependencies
shell: bash
run: |
python -m pip install --upgrade pip
pip install ".[docs]"

- name: Build Sphinx docs
shell: bash
run: |
cd docs
if [ "${{ inputs.treat-warnings-as-errors }}" = "true" ]; then
sphinx-build -b html -W --keep-going source build/html
else
sphinx-build -b html source build/html
fi
21 changes: 6 additions & 15 deletions .github/workflows/docs.yml → .github/workflows/publish_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Deploy docs to GitHub Pages

on:
push:
branches: ["devel", "main"] # TODO: Set to main only after release
branches: ["devel"]
workflow_dispatch:

permissions:
Expand All @@ -25,20 +25,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- name: Install pandoc
run: |
sudo apt-get update
sudo apt-get install -y pandoc

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install ".[docs]"

- name: Build Sphinx docs
run: |
cd docs
make html
- name: Build documentation
uses: ./.github/actions/build-docs
with:
python-version: "3.10"
treat-warnings-as-errors: "false"

- name: Setup Pages
uses: actions/configure-pages@v5
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ on:
jobs:
build-and-publish:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/template-python/
permissions:
id-token: write
contents: read

steps:
- name: Checkout repository
Expand All @@ -21,15 +27,10 @@ jobs:
- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install build twine
pip install build

- name: Build the package
run: python -m build

# Uncomment to publish on pypi
#- name: Publish to PyPI
# env:
# TWINE_USERNAME: __token__ # Use API token
# TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
# run: twine upload dist/*

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
77 changes: 18 additions & 59 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,32 @@ defaults:
shell: bash

jobs:
cloc:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Download and run cloc
run: |
curl -s https://raw.githubusercontent.com/AlDanial/cloc/master/cloc > cloc
chmod +x cloc
./cloc --version
./cloc $(git ls-files)

black:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Code formatting with black
run: |
pip install black "black[jupyter]"
black --check src/
black --check tutorials/
- name: Run pre-commit
uses: pre-commit/action@v3.0.1

isort:
cloc:
runs-on: ubuntu-latest
steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Code formatting with isort
- name: Download and run cloc
run: |
pip install isort
isort --check src/
isort --check tutorials/
curl -s https://raw.githubusercontent.com/AlDanial/cloc/master/cloc > cloc
chmod +x cloc
./cloc --version
./cloc $(git ls-files)

mypy:
runs-on: ubuntu-latest
Expand All @@ -59,43 +49,12 @@ jobs:
- name: Checkout the code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Type checking with mypy
run: |
pip install mypy
mypy src/ || true

prospector:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Code analysis with prospector
run: |
pip install prospector
prospector src/ || true

ruff:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Linting with ruff
run: |
pip install ruff
ruff check src/ || true

pylint:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- name: Checkout the code
uses: actions/checkout@v4

- name: Linting with pylint
run: |
pip install pylint
pylint src/ || true
36 changes: 36 additions & 0 deletions .github/workflows/test_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Test Documentation Build

on:
push:
branches:
- main
- devel
pull_request:
branches:
- main
- devel

defaults:
run:
shell: bash

jobs:
test-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build documentation
uses: ./.github/actions/build-docs
with:
python-version: "3.10"
treat-warnings-as-errors: "true"

- name: Upload docs artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: documentation
path: docs/build/html/
retention-days: 7
41 changes: 41 additions & 0 deletions .github/workflows/test_pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Test Pytest

on:
push:
branches:
- main
- devel
pull_request:
branches:
- main
- devel

jobs:
pytest:
runs-on: ubuntu-latest

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

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install project
run: |
pip install --upgrade pip
pip install ".[test]"

- name: Run tests
run: |
pytest .
67 changes: 67 additions & 0 deletions .github/workflows/test_setup_script.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Test Setup Script

on:
push:
branches:
- main
- devel
pull_request:
branches:
- main
- devel

defaults:
run:
shell: bash

jobs:
test-setup-script:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Run setup script
run: |
bash setup_project.sh my-test-app

- name: Verify changes
run: |
# Check that src/app was moved to src/my_test_app
if [ ! -d "src/my_test_app" ]; then
echo "Error: src/my_test_app does not exist"
exit 1
fi

# Check that src/app no longer exists
if [ -d "src/app" ]; then
echo "Error: src/app still exists"
exit 1
fi

# Check that template-python was replaced in pyproject.toml
if grep -q "template-python" pyproject.toml; then
echo "Error: 'template-python' still found in pyproject.toml"
exit 1
fi

if ! grep -q "my-test-app" pyproject.toml; then
echo "Error: 'my-test-app' not found in pyproject.toml"
exit 1
fi

echo "✓ All checks passed!"

- name: Install project with new name
run: |
pip install --upgrade pip
pip install -e .

- name: Test renamed command works
run: |
my-test-app
Loading