PyOptik 1.9.8.9__tar.gz → 1.9.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/.github/workflows/deploy_PyPi.yml +1 -1
- pyoptik-1.9.9/.github/workflows/deploy_documentation.yml +65 -0
- pyoptik-1.9.9/.github/workflows/static.yml +113 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/.gitignore +7 -4
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PKG-INFO +4 -3
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/_version.py +2 -2
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik.egg-info/PKG-INFO +4 -3
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik.egg-info/SOURCES.txt +2 -1
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/README.rst +3 -2
- pyoptik-1.9.8.9/.github/workflows/create_documentation.yml +0 -102
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/.flake8 +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/.github/dependabot.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/.github/workflows/deploy_anaconda.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/.github/workflows/deploy_coverage.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/.readthedocs.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/LICENSE +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/__init__.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/__main__.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/__init__.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/sellmeier/BAK1.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/sellmeier/BK7.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/sellmeier/SF5.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/sellmeier/ZBLAN.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/sellmeier/air.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/sellmeier/argon.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/sellmeier/crown.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/sellmeier/flint.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/sellmeier/fused_silica.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/sellmeier/germanium.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/sellmeier/lithium_niobate.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/sellmeier/polystyren.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/sellmeier/silicon.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/sellmeier/soda_lime_glass.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/sellmeier/water.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/tabulated/aluminium.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/tabulated/calcium.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/tabulated/copper.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/tabulated/gold.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/tabulated/iron.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/tabulated/nickel.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/tabulated/silver.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/tabulated/sodium.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/data/tabulated/zinc.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/directories.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/libraries/__init__.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/libraries/classics.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/libraries/dielectrics.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/libraries/metals.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/libraries/minimal.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/libraries/organics.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/libraries/others.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/libraries/polymers.yml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/material/__init__.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/material/base_class.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/material/sellmeier_class.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/material/tabulated_class.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/material_bank.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/material_type.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/units.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik/utils.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik.egg-info/dependency_links.txt +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik.egg-info/requires.txt +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/PyOptik.egg-info/top_level.txt +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/development/dev_0.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/Makefile +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/examples/README.rst +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/examples/sellmeier/README.rst +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/examples/sellmeier/plot_bk7.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/examples/sellmeier/plot_silica.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/examples/sellmeier/plot_water.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/examples/tabulated/README.rst +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/examples/tabulated/plot_sf5.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/examples/tabulated/plot_silver.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/examples/utils/README.rst +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/examples/utils/build_library.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/examples/utils/create_sellmeier_file.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/examples/utils/create_tabulated_file.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/examples/utils/download_yml_file.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/images/example_bk7.png +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/images/logo.png +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/make.bat +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/source/_static/default.css +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/source/_static/thumbnail.png +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/source/code.rst +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/source/conf.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/source/gallery/index.rst +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/source/index.rst +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/docs/source/references.rst +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/meta.yaml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/pyproject.toml +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/setup.cfg +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/tests/__init__.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/tests/test_sellmeier.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/tests/test_tabulated.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/tests/test_usual_material.py +0 -0
- {pyoptik-1.9.8.9 → pyoptik-1.9.9}/tests/test_utils.py +0 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# .github/workflows/deploy_documentation.yml
|
|
2
|
+
name: Documentation
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
push:
|
|
6
|
+
branches: [ "master" ]
|
|
7
|
+
tags:
|
|
8
|
+
- '*'
|
|
9
|
+
pull_request:
|
|
10
|
+
branches: [ "master" ]
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
documentation:
|
|
14
|
+
name: Run the documentation building tools
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
permissions:
|
|
17
|
+
pull-requests: write
|
|
18
|
+
contents: write
|
|
19
|
+
|
|
20
|
+
steps:
|
|
21
|
+
- name: "Set-up: Python 3.11"
|
|
22
|
+
uses: actions/setup-python@v5
|
|
23
|
+
id: cp311
|
|
24
|
+
with:
|
|
25
|
+
python-version: 3.11
|
|
26
|
+
|
|
27
|
+
- name: Set up Git user
|
|
28
|
+
run: |
|
|
29
|
+
git config --global user.name "GitHub Actions"
|
|
30
|
+
git config --global user.email "actions@github.com"
|
|
31
|
+
|
|
32
|
+
- name: "Install: Dependencies for headless server"
|
|
33
|
+
shell: bash
|
|
34
|
+
run: |
|
|
35
|
+
sudo apt-get update
|
|
36
|
+
sudo apt-get install -y xvfb jq
|
|
37
|
+
|
|
38
|
+
- name: "Checkout requirements and files for testing"
|
|
39
|
+
uses: actions/checkout@v4
|
|
40
|
+
with:
|
|
41
|
+
fetch-depth: 0
|
|
42
|
+
submodules: true
|
|
43
|
+
ref: master
|
|
44
|
+
|
|
45
|
+
- name: Install everything, run the tests, produce the .coverage file
|
|
46
|
+
run: |
|
|
47
|
+
python -m pip install wheel build
|
|
48
|
+
python -m build --wheel
|
|
49
|
+
python -m pip install .[documentation]
|
|
50
|
+
|
|
51
|
+
- name: Get current tag
|
|
52
|
+
id: get_tag
|
|
53
|
+
run: |
|
|
54
|
+
git fetch --tags
|
|
55
|
+
echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
|
|
56
|
+
|
|
57
|
+
- name: "Sphinx build"
|
|
58
|
+
run: |
|
|
59
|
+
sphinx-build docs/source documentation_build
|
|
60
|
+
|
|
61
|
+
- name: "Upload Documentation Artifact"
|
|
62
|
+
uses: actions/upload-artifact@v4
|
|
63
|
+
with:
|
|
64
|
+
name: documentation_build
|
|
65
|
+
path: documentation_build
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Simple workflow for deploying static content to GitHub Pages
|
|
2
|
+
name: Deploy static content to Pages
|
|
3
|
+
|
|
4
|
+
on:
|
|
5
|
+
workflow_run:
|
|
6
|
+
workflows: ["Documentation"] # This references the name of the first workflow
|
|
7
|
+
types:
|
|
8
|
+
- completed # Run when the Documentation workflow is completed successfully
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
|
12
|
+
permissions:
|
|
13
|
+
contents: write
|
|
14
|
+
pages: write
|
|
15
|
+
id-token: write
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
deploy:
|
|
19
|
+
environment:
|
|
20
|
+
name: github-pages
|
|
21
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
|
|
24
|
+
steps:
|
|
25
|
+
- name: Checkout
|
|
26
|
+
uses: actions/checkout@v4
|
|
27
|
+
with:
|
|
28
|
+
fetch-depth: 0
|
|
29
|
+
ref: documentation_page
|
|
30
|
+
|
|
31
|
+
- name: Set up Git user
|
|
32
|
+
run: |
|
|
33
|
+
git config --global user.name "GitHub Actions"
|
|
34
|
+
git config --global user.email "actions@github.com"
|
|
35
|
+
|
|
36
|
+
- name: Download artifact
|
|
37
|
+
id: download-artifact
|
|
38
|
+
uses: dawidd6/action-download-artifact@v6
|
|
39
|
+
with:
|
|
40
|
+
workflow: deploy_documentation.yml
|
|
41
|
+
name: documentation_build
|
|
42
|
+
path: ./documentation_build
|
|
43
|
+
|
|
44
|
+
- name: Get current tag
|
|
45
|
+
id: get_tag
|
|
46
|
+
run: |
|
|
47
|
+
# Fetch all tags to ensure we have all relevant history
|
|
48
|
+
git fetch --tags
|
|
49
|
+
|
|
50
|
+
TAG=$(git describe --tags --abbrev=0 || echo "0.0.0.0")
|
|
51
|
+
echo "tag=$TAG" >> $GITHUB_ENV
|
|
52
|
+
echo "Tag found or default: $TAG"
|
|
53
|
+
|
|
54
|
+
- name: Update new documentation version
|
|
55
|
+
run: |
|
|
56
|
+
rm -rf docs/${{ env.tag }}
|
|
57
|
+
mv documentation_build docs/${{ env.tag }}
|
|
58
|
+
|
|
59
|
+
- name: Scan, sort versions, and update version_switcher.json
|
|
60
|
+
run: |
|
|
61
|
+
# Define the path to version_switcher.json
|
|
62
|
+
json_file="version_switcher.json"
|
|
63
|
+
rm $json_file
|
|
64
|
+
docs_path="docs"
|
|
65
|
+
base_url="https://martinpdes.github.io/PyOptik"
|
|
66
|
+
|
|
67
|
+
# Start the JSON array
|
|
68
|
+
echo "[" > $json_file
|
|
69
|
+
|
|
70
|
+
# Get sorted version directories in descending order
|
|
71
|
+
version_dirs=$(ls -v $docs_path | sort -V -r)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
# Loop over sorted versions and add to JSON file
|
|
75
|
+
first_entry=true
|
|
76
|
+
for version in $version_dirs; do
|
|
77
|
+
version_url="${base_url}/${docs_path}/${version}"
|
|
78
|
+
|
|
79
|
+
# Add a comma if it's not the first entry
|
|
80
|
+
if [ "$first_entry" = true ]; then
|
|
81
|
+
first_entry=false
|
|
82
|
+
else
|
|
83
|
+
echo "," >> $json_file
|
|
84
|
+
fi
|
|
85
|
+
|
|
86
|
+
# Append each version as a JSON entry
|
|
87
|
+
jq -n \
|
|
88
|
+
--arg name "$version" \
|
|
89
|
+
--arg version "$version" \
|
|
90
|
+
--arg url "$version_url" \
|
|
91
|
+
'{name: $name, version: $version, url: $url}' >> $json_file
|
|
92
|
+
done
|
|
93
|
+
|
|
94
|
+
# End the JSON array
|
|
95
|
+
echo "]" >> $json_file
|
|
96
|
+
|
|
97
|
+
# Add and commit the updated version_switcher.json
|
|
98
|
+
git add $json_file
|
|
99
|
+
echo $json_file
|
|
100
|
+
git commit --allow-empty -m "Update version_switcher.json"
|
|
101
|
+
git push origin HEAD
|
|
102
|
+
|
|
103
|
+
- name: Setup Pages
|
|
104
|
+
uses: actions/configure-pages@v5
|
|
105
|
+
|
|
106
|
+
- name: Upload artifact
|
|
107
|
+
uses: actions/upload-pages-artifact@v3
|
|
108
|
+
with:
|
|
109
|
+
path: '.'
|
|
110
|
+
|
|
111
|
+
- name: Deploy to GitHub Pages
|
|
112
|
+
id: deployment
|
|
113
|
+
uses: actions/deploy-pages@v4
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# General patterns
|
|
4
2
|
*.DS_store
|
|
5
3
|
*.ipynb_checkpoints*
|
|
6
4
|
*__pycache__*
|
|
@@ -19,7 +17,12 @@ install_manifest.txt
|
|
|
19
17
|
cmake_install.cmake
|
|
20
18
|
wheelhouse
|
|
21
19
|
|
|
20
|
+
# Docs-specific patterns
|
|
22
21
|
docs/source/gallery/*
|
|
23
22
|
!docs/source/gallery/index.rst
|
|
24
23
|
PyOptik/data/**/test*
|
|
25
|
-
PyOptik/data/**/example*
|
|
24
|
+
PyOptik/data/**/example*
|
|
25
|
+
|
|
26
|
+
# Override for documentation_build
|
|
27
|
+
!documentation_build
|
|
28
|
+
!documentation_build/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyOptik
|
|
3
|
-
Version: 1.9.
|
|
3
|
+
Version: 1.9.9
|
|
4
4
|
Summary: A package for refractive index values.
|
|
5
5
|
Author-email: Martin Poinsinet de Sivry-Houle <martin.poinsinet.de.sivry@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -102,8 +102,9 @@ To install PyOptik, simply use `pip` or `conda`:
|
|
|
102
102
|
|
|
103
103
|
.. code:: bash
|
|
104
104
|
|
|
105
|
-
pip install PyOptik
|
|
106
|
-
|
|
105
|
+
pip install PyOptik (using PyPi package manager)
|
|
106
|
+
|
|
107
|
+
conda install --channels martinpdes pyoptik (using anaconda environment manager)
|
|
107
108
|
|
|
108
109
|
Building the Material Library
|
|
109
110
|
*****************************
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyOptik
|
|
3
|
-
Version: 1.9.
|
|
3
|
+
Version: 1.9.9
|
|
4
4
|
Summary: A package for refractive index values.
|
|
5
5
|
Author-email: Martin Poinsinet de Sivry-Houle <martin.poinsinet.de.sivry@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -102,8 +102,9 @@ To install PyOptik, simply use `pip` or `conda`:
|
|
|
102
102
|
|
|
103
103
|
.. code:: bash
|
|
104
104
|
|
|
105
|
-
pip install PyOptik
|
|
106
|
-
|
|
105
|
+
pip install PyOptik (using PyPi package manager)
|
|
106
|
+
|
|
107
|
+
conda install --channels martinpdes pyoptik (using anaconda environment manager)
|
|
107
108
|
|
|
108
109
|
Building the Material Library
|
|
109
110
|
*****************************
|
|
@@ -6,10 +6,11 @@ README.rst
|
|
|
6
6
|
meta.yaml
|
|
7
7
|
pyproject.toml
|
|
8
8
|
.github/dependabot.yml
|
|
9
|
-
.github/workflows/create_documentation.yml
|
|
10
9
|
.github/workflows/deploy_PyPi.yml
|
|
11
10
|
.github/workflows/deploy_anaconda.yml
|
|
12
11
|
.github/workflows/deploy_coverage.yml
|
|
12
|
+
.github/workflows/deploy_documentation.yml
|
|
13
|
+
.github/workflows/static.yml
|
|
13
14
|
PyOptik/__init__.py
|
|
14
15
|
PyOptik/__main__.py
|
|
15
16
|
PyOptik/_version.py
|
|
@@ -41,8 +41,9 @@ To install PyOptik, simply use `pip` or `conda`:
|
|
|
41
41
|
|
|
42
42
|
.. code:: bash
|
|
43
43
|
|
|
44
|
-
pip install PyOptik
|
|
45
|
-
|
|
44
|
+
pip install PyOptik (using PyPi package manager)
|
|
45
|
+
|
|
46
|
+
conda install --channels martinpdes pyoptik (using anaconda environment manager)
|
|
46
47
|
|
|
47
48
|
Building the Material Library
|
|
48
49
|
*****************************
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
# .github/workflows/deploy_documentation.yml
|
|
2
|
-
name: Documentation
|
|
3
|
-
|
|
4
|
-
on:
|
|
5
|
-
push:
|
|
6
|
-
branches: [ "master" ]
|
|
7
|
-
tags:
|
|
8
|
-
- '*'
|
|
9
|
-
pull_request:
|
|
10
|
-
branches: [ "master" ]
|
|
11
|
-
|
|
12
|
-
jobs:
|
|
13
|
-
documentation:
|
|
14
|
-
name: Run the documentation building tools
|
|
15
|
-
runs-on: ubuntu-latest
|
|
16
|
-
permissions:
|
|
17
|
-
pull-requests: write
|
|
18
|
-
contents: write
|
|
19
|
-
|
|
20
|
-
steps:
|
|
21
|
-
- name: "Set-up: Python 3.11"
|
|
22
|
-
uses: actions/setup-python@v5
|
|
23
|
-
id: cp311
|
|
24
|
-
with:
|
|
25
|
-
python-version: 3.11
|
|
26
|
-
|
|
27
|
-
- name: "Install: Dependencies for headless server"
|
|
28
|
-
shell: bash
|
|
29
|
-
run: |
|
|
30
|
-
sudo apt-get update
|
|
31
|
-
sudo apt-get install -y xvfb jq
|
|
32
|
-
|
|
33
|
-
- name: "Checkout requirements and files for testing"
|
|
34
|
-
uses: actions/checkout@v4
|
|
35
|
-
with:
|
|
36
|
-
fetch-depth: 0
|
|
37
|
-
submodules: true
|
|
38
|
-
|
|
39
|
-
- name: Install everything, run the tests, produce the .coverage file
|
|
40
|
-
run: |
|
|
41
|
-
python -m pip install wheel build
|
|
42
|
-
python -m build --wheel
|
|
43
|
-
python -m pip install .[documentation]
|
|
44
|
-
|
|
45
|
-
- name: Get current tag
|
|
46
|
-
id: get_tag
|
|
47
|
-
run: |
|
|
48
|
-
git fetch --tags
|
|
49
|
-
echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
|
|
50
|
-
|
|
51
|
-
- name: Sphinx build
|
|
52
|
-
run: |
|
|
53
|
-
sphinx-build docs/source _build
|
|
54
|
-
git checkout documentation_page
|
|
55
|
-
git branch documentation_page_temp
|
|
56
|
-
cd docs
|
|
57
|
-
git checkout master -- _build
|
|
58
|
-
mv _build ${{ env.tag }}"
|
|
59
|
-
cd ..
|
|
60
|
-
|
|
61
|
-
- name: Scan, sort versions, and update version_switcher.json
|
|
62
|
-
run: |
|
|
63
|
-
# Define the path to version_switcher.json
|
|
64
|
-
json_file="version_switcher.json"
|
|
65
|
-
docs_path="docs"
|
|
66
|
-
base_url="https://martinpdes.github.io/PyOptik"
|
|
67
|
-
|
|
68
|
-
# Start the JSON array
|
|
69
|
-
echo "[" > $json_file
|
|
70
|
-
|
|
71
|
-
# Get sorted version directories in descending order
|
|
72
|
-
version_dirs=$(ls -v $docs_path | sort -V -r)
|
|
73
|
-
|
|
74
|
-
# Loop over sorted versions and add to JSON file
|
|
75
|
-
first_entry=true
|
|
76
|
-
for version in $version_dirs; do
|
|
77
|
-
version_url="${base_url}/${docs_path}/${version}"
|
|
78
|
-
|
|
79
|
-
# Add a comma if it's not the first entry
|
|
80
|
-
if [ "$first_entry" = true ]; then
|
|
81
|
-
first_entry=false
|
|
82
|
-
else
|
|
83
|
-
echo "," >> $json_file
|
|
84
|
-
fi
|
|
85
|
-
|
|
86
|
-
# Append each version as a JSON entry
|
|
87
|
-
jq -n \
|
|
88
|
-
--arg name "$version" \
|
|
89
|
-
--arg version "$version" \
|
|
90
|
-
--arg url "$version_url" \
|
|
91
|
-
'{name: $name, version: $version, url: $url}' >> $json_file
|
|
92
|
-
done
|
|
93
|
-
|
|
94
|
-
# End the JSON array
|
|
95
|
-
echo "]" >> $json_file
|
|
96
|
-
|
|
97
|
-
- name: Merge to Trigger Pages Build
|
|
98
|
-
run: |
|
|
99
|
-
# Merge the changes from documentation_page_temp to documentation_page
|
|
100
|
-
git checkout documentation_page
|
|
101
|
-
git merge documentation_page_temp --no-ff
|
|
102
|
-
git push origin documentation_page
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|