All modules for which code is available
-- main -
diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index bbfa3d1..356b4f7 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,4 +1,4 @@ -name: Docker Image CI +name: Docker Image Build and Push to Docker Hub on: workflow_dispatch: diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..e6c01ce --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,57 @@ +# Simple workflow for deploying static content to GitHub Pages +name: Deploy Documentation to Pages + +on: + # Runs on pushes targeting the default branch + push: + branches: [ master ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Single deploy job since we're just deploying + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install sphinx pydata-sphinx-theme myst-parser sphinx-copybutton + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Build with Sphinx + run: | + sphinx-apidoc -f -o docs . + sphinx-build -b html docs html + - name: Add .nojekyll + run: echo "" > html/.nojekyll + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: './html' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 1913d08..22fd08f 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] steps: - uses: actions/checkout@v4 @@ -37,4 +37,4 @@ jobs: flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - name: Test with pytest run: | - pytest -W error --durations=10 --durations-min=1.0 tests/ + pytest -c pytest.ini --durations=10 --durations-min=1.0 tests/ diff --git a/.python-version b/.python-version new file mode 100644 index 0000000..e4fba21 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.12 diff --git a/README.md b/README.md index 74758a2..889528b 100644 --- a/README.md +++ b/README.md @@ -17,17 +17,20 @@ A template repository for linting, testing, GUI building and dockerizing python - Replace lines 10 - 13 and write your gui in `gui/streamlit_app.py`. - Replace lines 3 - 6 and write tests in `tests/test_main.py`. - Add your requirements to `requirements.txt`. -- Document your script with [Sphinx](https://www.sphinx-doc.org/): - - Install Sphinx and the [PyData](https://github.com/pydata/pydata-sphinx-theme) theme: `pip install sphinx pydata-sphinx-theme`. - - Adjust the configuration to your needs in `docs_src/conf.py`. - - Write documentation! - - Build documentation with: - ``` - sphinx-apidoc -f -o docs_src . - sphinx-build -b html docs_src docs - ``` - - Publish documentation [optional]! - - Serving with GitHub pages needs the addition of an empty `.nojekyll` file to your `/docs`. +- Document your script using the [numpydoc style](https://numpydoc.readthedocs.io/en/latest/format.html) and [Sphinx](https://www.sphinx-doc.org/): + - Adjust the configuration to your needs in `docs/conf.py`. + - Automatically via GitHub Actions: + - In the repository go to `Settings` ➡️ `Pages` ➡️ `Build and deployment` ➡️ `Source` ➡️ `GitHub Actions`. + - Select the `gh-pages.yml` / `Deploy Documentation to Pages` workflow. + - Or build manually: + - Install Sphinx and the [PyData](https://github.com/pydata/pydata-sphinx-theme) theme: `pip install sphinx pydata-sphinx-theme`. + - Build documentation with: + ``` + sphinx-apidoc -f -o docs . + sphinx-build -b html docs html + ``` + - Publish documentation [optional]! + - Serving with GitHub pages needs the addition of an empty `.nojekyll` file to your `/html`. - Adjust this `README.md` to your needs! ## Known Issues diff --git a/docs/.buildinfo b/docs/.buildinfo deleted file mode 100644 index 7f0739e..0000000 --- a/docs/.buildinfo +++ /dev/null @@ -1,4 +0,0 @@ -# Sphinx build info version 1 -# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: 569761fd4ebc62ec02d476837fca73a4 -tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/.doctrees/environment.pickle b/docs/.doctrees/environment.pickle deleted file mode 100644 index be124ce..0000000 Binary files a/docs/.doctrees/environment.pickle and /dev/null differ diff --git a/docs/.doctrees/index.doctree b/docs/.doctrees/index.doctree deleted file mode 100644 index 7dee63b..0000000 Binary files a/docs/.doctrees/index.doctree and /dev/null differ diff --git a/docs/.doctrees/main.doctree b/docs/.doctrees/main.doctree deleted file mode 100644 index c35a8e1..0000000 Binary files a/docs/.doctrees/main.doctree and /dev/null differ diff --git a/docs/.doctrees/modules.doctree b/docs/.doctrees/modules.doctree deleted file mode 100644 index d9fa37b..0000000 Binary files a/docs/.doctrees/modules.doctree and /dev/null differ diff --git a/docs/.nojekyll b/docs/.nojekyll deleted file mode 100644 index 8b13789..0000000 --- a/docs/.nojekyll +++ /dev/null @@ -1 +0,0 @@ - diff --git a/docs/_modules/index.html b/docs/_modules/index.html deleted file mode 100644 index 349a185..0000000 --- a/docs/_modules/index.html +++ /dev/null @@ -1,403 +0,0 @@ - - - - - - -
- - -
-#!/usr/bin/env python3
-
-# SCRIPT NAME
-# 2024 (c) Micha Johannes Birklbauer
-# https://github.com/michabirklbauer/
-# micha.birklbauer@gmail.com
-
-# version tracking
-__version = "1.0.0"
-__date = "2024-03-11"
-
-# REQUIREMENTS
-# pip install pandas
-
-###### PARAMETERS #######
-
-param_1 = 1
-param_2 = 2
-
-#########################
-
-docs = \
-"""
-DESCRIPTION:
-A description of the script [multiplies two integers].
-USAGE:
-main.py [-f1 --factor1]
- [-f2 --factor2]
-required arguments:
- -f1 int, --factor1 int
- First factor of multiplication.
-optional arguments:
- -f2 int, --factor2
- Second factor of multiplication.
- Default: 2
- -h, --help
- Show this help message and exit.
- --version
- Show program's version number and exit.
-"""
-
-#########################
-
-# import packages
-import argparse
-import pandas as pd
-
-####### FUNCTIONS #######
-
-
-[docs]
-def my_product(x: int, y: int) -> int:
- """Returns the product of two integer numbers.
-
- Parameters
- ----------
- x : int
- The first factor.
- y : int, default = 2
- The second factor.
-
- Returns
- -------
- product : int
- The product of x and y.
-
- Examples
- --------
- >>> from main import my_product
- >>> product = my_product(1, 2)
- >>> product
- 2
- """
-
- return x * y
-
-
-##### MAIN FUNCTION #####
-
-
-[docs]
-def main(argv = None) -> int:
- """Main function.
-
- Parameters
- ----------
- argv : list, default = None
- Arguments passed to argparse.
-
- Returns
- -------
- product : int
- The product of given arguments.
-
- Examples
- --------
- >>> from main import main
- >>> product = main(["-f1", "1", "-f2", "2"])
- >>> product
- 2
- >>> product = main(["-f1", "3"])
- >>> product
- 6
- """
-
- parser = argparse.ArgumentParser()
- parser.add_argument("-f1", "--factor1",
- dest = "f1",
- required = True,
- help = "First factor of multiplication.",
- type = int)
- parser.add_argument("-f2", "--factor2",
- dest = "f2",
- default = 2,
- help = "Second factor of multiplication.",
- type = int)
- args = parser.parse_args(argv)
-
- p = my_product(args.f1, args.f2)
- print(f"The product of {args.f1} * {args.f2} = {p}")
-
- return p
-
-
-######## SCRIPT #########
-
-if __name__ == "__main__":
-
- m = main()
-