diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 2e031e595..7bd763518 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -18,23 +18,29 @@ build: - SHELL=/bin/bash /bin/bash /tmp/micromamba-install.sh # Override the create_environment step (undocumented feature) to create - # multiple environments. + # a single environment instead of multiple environments. create_environment: - # Pin micromamba - - /bin/bash --login -c "micromamba self-update --version 2.0.7" - # Create the isolated env for building JupyterGIS - - /bin/bash --login -c "micromamba create -n jupytergis-build -c conda-forge nodejs hatch pip python=3.13" - - /bin/bash --login -c "micromamba run -n jupytergis-build pip install 'jupyterlab==4.3' 'datamodel-code-generator>=0.23.0'" - # Build JupyterGIS Javascript packages; required for building the docs env - - /bin/bash --login -c "micromamba run -n jupytergis-build jlpm install" - - /bin/bash --login -c "micromamba run -n jupytergis-build jlpm build" - - /bin/bash --login -c "micromamba run -n jupytergis-build jlpm build:packages" - # Create the env for building the docs - - /bin/bash --login -c "micromamba env create -n jupytergis-docs -f docs/environment-docs.yml" + # Pin micromamba + - /bin/bash --login -c "micromamba self-update --version 2.0.7" + # Create the environment using the updated environment-docs.yml + - /bin/bash --login -c "micromamba env create -n jupytergis-docs -f docs/environment-docs.yml" - # Override the install step to do nothing - we already created the envs + # Override the install step to do nothing - we already created the env install: - - "echo 'Skipping! We already have the environments we need.'" + - "echo 'Skipping! We already have the environment we need.'" + + # Before building the docs, build JupyterGIS in its environment, + # then install the wheels into the same environment. + pre_build: + - /bin/bash --login -c "micromamba run -n jupytergis-docs jlpm install" + - /bin/bash --login -c "micromamba run -n jupytergis-docs jlpm build" + - /bin/bash --login -c "micromamba run -n jupytergis-docs jlpm build:packages" + - |- + /bin/bash --login -c "micromamba run -n jupytergis-docs \ + python -m pip install \ + $(ls ./python/jupytergis_core/dist/jupytergis*.whl) \ + $(ls ./python/jupytergis_lab/dist/jupytergis*.whl) \ + $(ls ./python/jupytergis_qgis/dist/jupytergis*.whl)" build: html: diff --git a/docs/environment-docs.yml b/docs/environment-docs.yml index 18d61dcf8..9c118cc40 100644 --- a/docs/environment-docs.yml +++ b/docs/environment-docs.yml @@ -1,10 +1,12 @@ -name: jupytergis-docs +name: jupytergis channels: - conda-forge - nodefaults dependencies: - python=3.12 - + - pip + - nodejs + - hatch # Build docs & JupyterLite - jupyterlite-core - jupyterlite-xeus>=3.1.3,<4 @@ -18,8 +20,9 @@ dependencies: - myst-parser - xeus-python # TODO: Do we need this? - - pip - pip: + - jupyterlab==4.3 + - datamodel-code-generator>=0.23.0 # Install JupyterGIS so we can autodoc. # IMPORTANT: You must do `jlpm build` at the root of the repo before this can work. # See: https://github.com/geojupyter/jupytergis/issues/585