From 2dddccc82281119a842cc70a21383eaf65bbdca0 Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Thu, 15 Feb 2024 01:48:56 -0600 Subject: [PATCH 1/3] CI #10 revise from murky package (no old versions) --- .github/workflows/pages.yml | 84 ++++++------------------------------- docs/requirements.txt | 3 ++ 2 files changed, 16 insertions(+), 71 deletions(-) create mode 100644 docs/requirements.txt diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 76350b0..0d04866 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -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" @@ -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 e -C docs clean html - name: Deploy (to gh-pages branch) only on demand uses: peaceiris/actions-gh-pages@v3 diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..da1b280 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,3 @@ +pydata-sphinx-theme +setuptools-scm +sphinx <6 \ No newline at end of file From c41483f6cbc3ddf4a364c9a2b5a9ac101172047c Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Thu, 15 Feb 2024 01:53:00 -0600 Subject: [PATCH 2/3] STY #10 linting --- docs/source/conf.py | 2 +- pysumreg/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 992a7ff..36227d6 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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 diff --git a/pysumreg/__init__.py b/pysumreg/__init__.py index 6d254aa..9b1eead 100644 --- a/pysumreg/__init__.py +++ b/pysumreg/__init__.py @@ -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 From c13a3f97da8764defc9340bbe2535f583f4a69b0 Mon Sep 17 00:00:00 2001 From: Pete R Jemian Date: Thu, 15 Feb 2024 01:53:09 -0600 Subject: [PATCH 3/3] CI #10 typo --- .github/workflows/pages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 0d04866..fc9d3ef 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -54,7 +54,7 @@ jobs: pip install --no-deps -e . -vv - name: Sphinx - run: TZ=UTC e -C docs clean html + run: TZ=UTC make -C docs clean html - name: Deploy (to gh-pages branch) only on demand uses: peaceiris/actions-gh-pages@v3