Skip to content

Commit

Permalink
Merge pull request #4 from lang-m/modernise-setup
Browse files Browse the repository at this point in the history
Update webpages (part 1)
  • Loading branch information
lang-m authored Feb 6, 2025
2 parents 61494aa + e511e82 commit 093c05e
Show file tree
Hide file tree
Showing 6 changed files with 87 additions and 14 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: publish website

on:
workflow_dispatch:
push:
branches:
- master
pull_request:

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.13'

- uses: pandoc/actions/setup@v1

- name: install dependencies
run: pip install sphinx nbsphinx furo .

- name: Build website
run: sphinx-build docs docs-artifacts

- name: Upload website artifacts
uses: actions/upload-pages-artifact@v3
with:
path: docs-artifacts


deploy:
if: ${{ github.ref == 'refs/heads/master' }}

needs: build

permissions:
pages: write
id-token: write

environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}

runs-on: ubuntu-latest

steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
28 changes: 22 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: workflow
name: tests

on:
workflow_dispatch:
Expand All @@ -8,18 +8,18 @@ on:
pull_request:

jobs:
test:
style:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}

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

- name: install package
run: pip install .
- uses: actions/setup-python@v5
with:
python-version: '3.13'

# TODO move to pyproject.toml
- name: install test dependencies
Expand All @@ -28,5 +28,21 @@ jobs:
- name: style
run: pycodestyle src/blaupause

pytest:
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: install package
run: pip install .

- name: test
run: pytest
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
__pycache__
.coverage
.ipynb_checkpoints
docs/_autosummary
docs/_build
venv
3 changes: 1 addition & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
'nbsphinx',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'm2r2'
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -63,7 +62,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
html_theme = 'furo'

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down
11 changes: 6 additions & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,20 @@
Welcome to blaupause's documentation!
=====================================

.. mdinclude:: ../README.md
:start-line: 14
:end-line: 31
``blaupause`` is a sample Python-based package that can be used a tutorial for setting up a project.

Tutorials
---------

.. toctree::
:maxdepth: 2
:caption: Tutorials

ipynb/tutorial

API-reference
API reference
-------------

.. autosummary::
:toctree: _autosummary
:caption: API Reference
Expand Down
1 change: 0 additions & 1 deletion src/blaupause/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import pytest
import importlib.metadata
import pkg_resources
from .functions import add, subtract, multiply
from .blueprint import Blueprint

Expand Down

0 comments on commit 093c05e

Please sign in to comment.