diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml new file mode 100644 index 0000000..7529a55 --- /dev/null +++ b/.github/workflows/documentation.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 039b2d0..16ced19 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: workflow +name: tests on: workflow_dispatch: @@ -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 @@ -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 diff --git a/.gitignore b/.gitignore index e749c2c..fd43e5e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ __pycache__ .coverage .ipynb_checkpoints +docs/_autosummary +docs/_build +venv \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index 454d962..4d02283 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -32,7 +32,6 @@ 'nbsphinx', 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', - 'm2r2' ] # Add any paths that contain templates here, relative to this directory. @@ -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, diff --git a/docs/index.rst b/docs/index.rst index 6681071..c489d44 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -6,9 +6,10 @@ 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 @@ -16,9 +17,9 @@ Welcome to blaupause's documentation! ipynb/tutorial -API-reference +API reference ------------- - + .. autosummary:: :toctree: _autosummary :caption: API Reference diff --git a/src/blaupause/__init__.py b/src/blaupause/__init__.py index e4fbad7..05b9130 100644 --- a/src/blaupause/__init__.py +++ b/src/blaupause/__init__.py @@ -7,7 +7,6 @@ import pytest import importlib.metadata -import pkg_resources from .functions import add, subtract, multiply from .blueprint import Blueprint