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
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
42 changes: 42 additions & 0 deletions .github/actions/build-docs/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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: |
apt-get update
apt-get install -y pandoc

- name: Check if pdflatex is available
shell: bash
run: |
which pdflatex
pdflatex --version

- 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
make html
85 changes: 0 additions & 85 deletions .github/workflows/docs.yml

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,3 @@ jobs:
TWINE_USERNAME: __token__ # Use API token
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload dist/*

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

on:
push:
branches: ["devel"]
workflow_dispatch:

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

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

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

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

- 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

- 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
36 changes: 36 additions & 0 deletions .github/workflows/publish_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish Python Package

on:
push:
branches:
- main

jobs:
build-and-publish:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/tikzpics/
permissions:
id-token: write
contents: read

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

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

- name: Install build tools
run: |
python -m pip install --upgrade pip
pip install build

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

- 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
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install pandoc
run: |
apt-get update
Expand Down Expand Up @@ -106,4 +106,3 @@ jobs:

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

39 changes: 39 additions & 0 deletions .github/workflows/test_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
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
container:
image: texlive/texlive: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
1 change: 0 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,3 @@ deploy:
stage: deploy
script: echo "Define your deployment script!"
environment: production

Loading