Skip to content

Commit

Permalink
Merge c13a3f9 into d849161
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Feb 15, 2024
2 parents d849161 + c13a3f9 commit e489193
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 73 deletions.
84 changes: 13 additions & 71 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,18 @@ defaults:
jobs:

docs:
name: Publish documentation
runs-on: ubuntu-latest

steps:

- uses: actions/setup-python@v5
- name: Deploy Information
if: ${{ github.event.inputs.deploy }}
run: |
echo "The docs will be published from this workflow run."
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"

Expand All @@ -39,80 +46,15 @@ jobs:
with:
fetch-depth: 0 # otherwise, you will fail to push refs to dest repo

- name: Info
run: |
echo $(pwd)
ls -lAFgh
- name: Install package
run: |
pip install --no-deps -e . -vv
- name: Diagnostics
run: |
python -m pip list
python -c "import pysumreg; print(f'{pysumreg.__version__=}')"
- name: Install Sphinx build requirements
run: pip install -r ./docs/requirements.txt

- name: Install our package
run: |
pip install setuptools-scm "sphinx<6" pydata-sphinx-theme
echo "--------------- diagnostic pip list ---------------"
pip list
- name: Make Temporary Directory for Sphinx content
run: |
echo "SRC_DIR=$(pwd)" >> ${GITHUB_ENV}
echo "TMP_DIR=$(mktemp -d)" >> ${GITHUB_ENV}
echo "VERSION=$(./setup.py --version)" >> ${GITHUB_ENV}
- name: Show Environment variables
run: |
echo "SRC_DIR=${SRC_DIR}"
echo "TMP_DIR=${TMP_DIR}"
echo "VERSION=${VERSION}"
pip install --no-deps -e . -vv
- name: Sphinx
run: |
sphinx-build -M html ./docs/source "${TMP_DIR}/build"
- name: Re-build the master directory (contains all documentation versions)
run: |
cp .github/index.html "${TMP_DIR}"
cd "${TMP_DIR}"
mv build/html "${VERSION}"
/bin/rm -rf build
ln -s "./${VERSION}" dev
# add previous documentation (built versions)
wget https://github.com/prjemian/pysumreg/archive/refs/heads/gh-pages.zip
unzip -q gh-pages.zip
/bin/rm gh-pages.zip
source "${SRC_DIR}/.github/define_versions.sh"
echo "versions=${versions}"
for v in ${versions}
do
if [ -d "pysumreg-gh-pages/${v}" ]
then
echo "directory 'pysumreg-gh-pages/${v}' exists"
mv "pysumreg-gh-pages/${v}" ./
latest="${v}"
fi
done
echo "latest=${latest}"
ln -s "./${latest}" ./latest
/bin/rm -rf pysumreg-gh-pages
- name: Info
run: |
cd "${TMP_DIR}"
echo "pwd=$(pwd)"
ls -laFGh
echo storage space used by each item in ${TMP_DIR}
du -shc *
echo TMP_DIR: ${{ env.TMP_DIR }}
run: TZ=UTC make -C docs clean html

- name: Deploy (to gh-pages branch) only on demand
uses: peaceiris/actions-gh-pages@v3
Expand Down
3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pydata-sphinx-theme
setuptools-scm
sphinx <6
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import tomllib

sys.path.insert(0, str(pathlib.Path().absolute().parent.parent))
import pysumreg
import pysumreg # noqa

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
Expand Down
2 changes: 1 addition & 1 deletion pysumreg/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

"""Configuration of pysumreg package."""

from .sum_registers import SummationRegisters
from .sum_registers import SummationRegisters # noqa

try:
from setuptools_scm import get_version
Expand Down

0 comments on commit e489193

Please sign in to comment.