Skip to content

Commit

Permalink
Update plantuml, use poetry install for docs
Browse files Browse the repository at this point in the history
Add plantuml dependency for RTD
  • Loading branch information
k-collie committed Jun 28, 2023
1 parent a6b588e commit f0f2033
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 36 deletions.
27 changes: 16 additions & 11 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,38 @@ jobs:
with:
python-version: 3.8 # should match value in .readthedocs.yml

- name: Install Poetry
uses: abatilo/[email protected]
with:
poetry-version: 1.4.2

- name: Configure poetry
shell: bash
run: python -m poetry config virtualenvs.in-project true

- name: Set up cache
uses: actions/cache@v2
id: cache
with:
path: .venv
key: venv-pip-${{ runner.os }}-${{ hashFiles('**/poetry.lock', '.github/workflows/docs.yml')}}
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}

- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
shell: bash
run: source .venv/bin/activate &&
(timeout 10s pip --version || (rm -rf .venv && echo "::set-output name=cache-bad::true"))
id: cache-checkup
run: timeout 10s python -m poetry run pip --version || rm -rf .venv

- name: Install dependencies
shell: bash
run: |
python -m poetry install
- name: Install plantuml
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y plantuml
- name: Install dependencies
shell: bash
run: python -m venv .venv &&
source .venv/bin/activate &&
pip install .[docs]
if: ${{ steps.cache-venv.ouputs.cache-hit != 'true' || steps.cache-checkup.outputs.cache-bad == 'true'}}

- name: Test docs build successfully
run: source .venv/bin/activate &&
make -C doc html SPHINXOPTS="-W --keep-going"
28 changes: 18 additions & 10 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
# .readthedocs.yml

version: 2

build:
os: "ubuntu-22.04"
apt_packages:
- plantuml
tools:
python: "3.8"
jobs:
post_create_environment:
# Install poetry
# https://python-poetry.org/docs/#installing-manually
- pip install poetry
# Tell poetry to not use a virtual environment
- poetry config virtualenvs.create false
post_install:
# Install dependencies with 'docs' dependency group
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
- poetry install --with docs --without dev

sphinx:
configuration: doc/conf.py
fail_on_warning: true

python:
version: 3.8
install:
- path: .
method: pip
extra_requirements:
- docs
system_packages: true
9 changes: 3 additions & 6 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 5 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,8 @@ scipy = "^1.6.2"
xarray = ">=2022.06.0,<2023.03.0"
matplotlib = "^3.3.0"
sal = "^1.2.2"
sphinx = {version = "^4.0.0", optional = true}
sphinx-rtd-theme = {version = "^1.0.0", optional=true}
sphinxcontrib-plantuml = {version = "^0.23", optional = true}

[tool.poetry.dev-dependencies]
[tool.poetry.group.dev.dependencies]
click = "^8.0.0"
coverage = {extras = ["toml"], version = "^5.2.1"}
hypothesis = {extras = ["numpy"], version = "^5.24.2"}
Expand All @@ -61,13 +58,12 @@ pre-commit = "^2.9.2"
pytest = "^6.0.1"
pytest-cov = "^2.10.0"
pytest-xdist = "^2.0.0"
sphinx = "^4.0.0"
sphinx-rtd-theme = "^1.0.0"
sphinxcontrib-plantuml = "^0.23"
types-setuptools = "^57.4.14"

[tool.poetry.extras]
docs = ["sphinx", "sphinx-rtd-theme", "sphinxcontrib-plantuml"]
[tool.poetry.group.docs.dependencies]
sphinx = "^4.0.0"
sphinx-rtd-theme = "^1.0.0"
sphinxcontrib-plantuml = "^0.25"

[tool.poetry.build]
generate-setup-file = false
Expand Down

0 comments on commit f0f2033

Please sign in to comment.