|
| 1 | +# See https://docs.readthedocs.io/en/stable/config-file/v2.html |
| 2 | +version: 2 |
| 3 | + |
| 4 | +build: |
| 5 | + os: "ubuntu-24.04" |
| 6 | + tools: |
| 7 | + nodejs: "20" |
| 8 | + jobs: |
| 9 | + # Install micromamba |
| 10 | + pre_create_environment: |
| 11 | + # The recommended syntax in the micromamba docs is process substitution. |
| 12 | + # RTD's default shell chokes on it, so we're doing it in multiple steps |
| 13 | + # instead. |
| 14 | + - curl -L micro.mamba.pm/install.sh > /tmp/micromamba-install.sh |
| 15 | + - chmod +x /tmp/micromamba-install.sh |
| 16 | + # For some reason, SHELL is not set. The install script requires it. |
| 17 | + - SHELL=/bin/bash /bin/bash /tmp/micromamba-install.sh |
| 18 | + |
| 19 | + # Override the create_environment step (undocumented feature) to create |
| 20 | + # multiple environments. |
| 21 | + create_environment: |
| 22 | + # Create the env for building the docs |
| 23 | + - /bin/bash --login -c "micromamba env create -n jupytergis-docs -f docs/environment-docs.yml" |
| 24 | + # Create the isolated env for building JupyterGIS |
| 25 | + - /bin/bash --login -c "micromamba create -n jupytergis-build -c conda-forge yarn=3 hatch pip python=3.10" |
| 26 | + - /bin/bash --login -c "micromamba run -n jupytergis-build pip install -r requirements-build.txt" |
| 27 | + |
| 28 | + # Override the install step to do nothing - we already created the envs |
| 29 | + install: |
| 30 | + - "echo 'Skipping! We already have the environments we need.'" |
| 31 | + |
| 32 | + # Before building the docs, build JupyterGIS in its isolated environment, |
| 33 | + # then install the wheels into the docs environment. |
| 34 | + pre_build: |
| 35 | + - /bin/bash --login -c "micromamba run -n jupytergis-build yarn install" |
| 36 | + - /bin/bash --login -c "micromamba run -n jupytergis-build yarn dev" |
| 37 | + - /bin/bash --login -c "micromamba run -n jupytergis-build jupyter labextension list 2>&1 | grep -ie 'jupytergis-core.*OK'" |
| 38 | + - /bin/bash --login -c "micromamba run -n jupytergis-build jupyter labextension list 2>&1 | grep -ie 'jupytergis-lab.*OK'" |
| 39 | + - /bin/bash --login -c "micromamba run -n jupytergis-build yarn build:packages" |
| 40 | + |
| 41 | + - |- |
| 42 | + /bin/bash --login -c "micromamba run -n jupytergis-docs \ |
| 43 | + python -m pip install \ |
| 44 | + $(ls ./python/jupytergis_core/dist/jupytergis*.whl) \ |
| 45 | + $(ls ./python/jupytergis_lab/dist/jupytergis*.whl) \ |
| 46 | + $(ls ./python/jupytergis_qgis/dist/jupytergis*.whl)" |
| 47 | +
|
| 48 | + build: |
| 49 | + html: |
| 50 | + - |- |
| 51 | + /bin/bash --login -c "cd docs && micromamba run -n jupytergis-docs \ |
| 52 | + python -m sphinx -T -b html -d _build/doctrees -D language=en . \ |
| 53 | + $READTHEDOCS_OUTPUT/html" |
0 commit comments