Skip to content

Try getting rid of double mamba envs by creating a superset env #590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
34 changes: 20 additions & 14 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 6 additions & 3 deletions docs/environment-docs.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: jupytergis-docs
name: jupytergis
channels:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer to keep the name as jupytergis-docs because I already have an environment titled jupytergis on my machine and prefer to keep it :)

- conda-forge
- nodefaults
dependencies:
- python=3.12

- pip
- nodejs
- hatch
# Build docs & JupyterLite
- jupyterlite-core
- jupyterlite-xeus>=3.1.3,<4
Expand All @@ -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
Expand Down
Loading