WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
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
116 changes: 0 additions & 116 deletions .github/workflows/ci.yml

This file was deleted.

62 changes: 62 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Deploy docs to GitHub Pages

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

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build-and-deploy:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

steps:
- 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: Setup Pages
uses: actions/configure-pages@v5

- name: Upload built docs
uses: actions/upload-pages-artifact@v3
with:
path: docs/build/html/

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
51 changes: 0 additions & 51 deletions .github/workflows/jekyll-gh-pages.yml

This file was deleted.

62 changes: 62 additions & 0 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Static analysis

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

jobs:
static-analysis:
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)

- name: Code formatting with black
run: |
pip install black
pip install "black[jupyter]"
black --check src/
black --check tutorials/

- name: Code formatting with isort
run: |
pip install isort
isort --check src/
isort --check tutorials/

- name: Code formatting with prospector
continue-on-error: true
run: |
pip install mypy
mypy src/

- name: Code formatting with prospector
continue-on-error: true
run: |
pip install prospector
prospector src/

- name: Code formatting with ruff
continue-on-error: true
run: |
pip install ruff
ruff check src/

- name: Code formatting with pylint
continue-on-error: true
run: |
pip install pylint
pylint src/
66 changes: 66 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Tests

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

jobs:
build:
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v3

# Set up Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10' # Adjust as needed

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

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

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

- name: Check installation
run: |
template-python

- name: Run tests
run: |
pytest .

- name: Test tutorials
run: |
jupyter nbconvert --to notebook --execute tutorials/*.ipynb --output-dir=/tmp --ExecutePreprocessor.timeout=300

- name: Test docs build
run: |
pip install ".[docs]"
cd docs
make clean
make html
cd ..
ls docs/build/html/index.html
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0 # Use the latest stable version
hooks:
- id: check-added-large-files # Prevent giant files from being committed.
args: ["--maxkb=1000"]
- id: check-merge-conflict # Check for files that contain merge conflict strings.
- id: check-toml # Attempts to load all TOML files to verify syntax.
- id: check-yaml # Attempts to load all yaml files to verify syntax.
args: ["--unsafe"]

- repo: https://github.com/kynan/nbstripout
rev: 0.8.1
hooks:
- id: nbstripout # remove jupyter notebook cell output
Loading