From 9e63627ffa8a342238ff9223f80d76b3c26104fc Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 8 Nov 2024 10:43:08 -0500 Subject: [PATCH 01/10] chore(rtd): Try installing with uv to speed up builds --- .readthedocs.yaml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 1e096e6ad..77068b5d7 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -4,10 +4,12 @@ build: os: ubuntu-lts-latest tools: python: latest - -python: - install: - - requirements: docs/requirements.txt - -sphinx: - configuration: docs/conf.py + jobs: + post_create_environment: + - asdf plugin add uv + - asdf install uv latest + - asdf global uv latest + - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install --upgrade pip setuptools + - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install --upgrade sphinx + post_install: + - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install -r docs/requirements.txt From 646cbe80a123f1d96588486ea695cbc1523cecd3 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 8 Nov 2024 10:52:33 -0500 Subject: [PATCH 02/10] chore: Try disabling pip --- .readthedocs.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 77068b5d7..4f8116a30 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,7 +9,8 @@ build: - asdf plugin add uv - asdf install uv latest - asdf global uv latest - - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install --upgrade pip setuptools + # Turn `python -m pip` into `python -c pass` + - truncate --size 0 $READTHEDOCS_VIRTUALENV_PATH/lib/python3*/site-packages/pip/__main__.py - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install --upgrade sphinx post_install: - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install -r docs/requirements.txt From 53df36d615384653d5dad27be81e7ebd017019b5 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 8 Nov 2024 11:15:07 -0500 Subject: [PATCH 03/10] Preempt virtualenv, disable global cache --- .readthedocs.yaml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 4f8116a30..b7fc85458 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -5,12 +5,15 @@ build: tools: python: latest jobs: - post_create_environment: + pre_create_environment: - asdf plugin add uv - asdf install uv latest - asdf global uv latest - # Turn `python -m pip` into `python -c pass` - - truncate --size 0 $READTHEDOCS_VIRTUALENV_PATH/lib/python3*/site-packages/pip/__main__.py - - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install --upgrade sphinx + - uv venv $READTHEDOCS_VIRTUALENV_PATH + # Turn `python -m [pip|virtualenv]` into `python -c pass` + - truncate --size 0 $READTHEDOCS_VIRTUALENV_PATH/lib/python3*/site-packages/pip.py + - truncate --size 0 $READTHEDOCS_VIRTUALENV_PATH/lib/python3*/site-packages/virtualenv.py + post_create_environment: + - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install -n --upgrade sphinx post_install: - - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install -r docs/requirements.txt + - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install -n -r docs/requirements.txt From 3e7e5ecf494dbf3735047c699fa2293a29c0103d Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 8 Nov 2024 11:17:41 -0500 Subject: [PATCH 04/10] dbg --- .readthedocs.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index b7fc85458..01d18b340 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -10,6 +10,7 @@ build: - asdf install uv latest - asdf global uv latest - uv venv $READTHEDOCS_VIRTUALENV_PATH + - ls -lR $READTHEDOCS_VIRTUALENV_PATH # Turn `python -m [pip|virtualenv]` into `python -c pass` - truncate --size 0 $READTHEDOCS_VIRTUALENV_PATH/lib/python3*/site-packages/pip.py - truncate --size 0 $READTHEDOCS_VIRTUALENV_PATH/lib/python3*/site-packages/virtualenv.py From e48681c1cff880ed47bdfc8e1d520fda95cbbd59 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 8 Nov 2024 11:19:22 -0500 Subject: [PATCH 05/10] fix --- .readthedocs.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 01d18b340..20ed86a2d 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -10,10 +10,8 @@ build: - asdf install uv latest - asdf global uv latest - uv venv $READTHEDOCS_VIRTUALENV_PATH - - ls -lR $READTHEDOCS_VIRTUALENV_PATH # Turn `python -m [pip|virtualenv]` into `python -c pass` - - truncate --size 0 $READTHEDOCS_VIRTUALENV_PATH/lib/python3*/site-packages/pip.py - - truncate --size 0 $READTHEDOCS_VIRTUALENV_PATH/lib/python3*/site-packages/virtualenv.py + - truncate --size 0 $( ls -d $READTHEDOCS_VIRTUALENV_PATH/lib/python3* )/site-packages/{pip,virtualenv}.py post_create_environment: - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install -n --upgrade sphinx post_install: From 78e0b0575b33dddc0baa6a2a5468b34da5744a50 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 8 Nov 2024 11:27:50 -0500 Subject: [PATCH 06/10] find python --- .readthedocs.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 20ed86a2d..888597d63 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -9,10 +9,12 @@ build: - asdf plugin add uv - asdf install uv latest - asdf global uv latest - - uv venv $READTHEDOCS_VIRTUALENV_PATH - # Turn `python -m [pip|virtualenv]` into `python -c pass` - - truncate --size 0 $( ls -d $READTHEDOCS_VIRTUALENV_PATH/lib/python3* )/site-packages/{pip,virtualenv}.py + # Turn `python -m virtualenv` into `python -c pass` + - truncate --size 0 $( dirname $( uv python find ) )/../lib/python3*/site-packages/virtualenv/__main__.py post_create_environment: + - uv venv $READTHEDOCS_VIRTUALENV_PATH + # Turn `python -m pip` into `python -c pass` + - truncate --size 0 $( ls -d $READTHEDOCS_VIRTUALENV_PATH/lib/python3* )/site-packages/pip.py - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install -n --upgrade sphinx post_install: - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install -n -r docs/requirements.txt From b5fba5032af2bd67bc4bdafb4a6c4ed5bcf952e9 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 8 Nov 2024 11:34:42 -0500 Subject: [PATCH 07/10] dbg --- .readthedocs.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 888597d63..5107a4ab9 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -11,6 +11,7 @@ build: - asdf global uv latest # Turn `python -m virtualenv` into `python -c pass` - truncate --size 0 $( dirname $( uv python find ) )/../lib/python3*/site-packages/virtualenv/__main__.py + - mount | grep ^/home post_create_environment: - uv venv $READTHEDOCS_VIRTUALENV_PATH # Turn `python -m pip` into `python -c pass` From 277834e42d826334cde72992f806c7098e3be5ff Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 8 Nov 2024 11:35:19 -0500 Subject: [PATCH 08/10] dbg --- .readthedocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 5107a4ab9..e5a804f88 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -11,7 +11,7 @@ build: - asdf global uv latest # Turn `python -m virtualenv` into `python -c pass` - truncate --size 0 $( dirname $( uv python find ) )/../lib/python3*/site-packages/virtualenv/__main__.py - - mount | grep ^/home + - mount post_create_environment: - uv venv $READTHEDOCS_VIRTUALENV_PATH # Turn `python -m pip` into `python -c pass` From eb973a0c46be5bc4c23a19c4f77777925540fec7 Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 8 Nov 2024 11:37:37 -0500 Subject: [PATCH 09/10] Try cache-dir inside mount --- .readthedocs.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index e5a804f88..b56a0e519 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -6,16 +6,17 @@ build: python: latest jobs: pre_create_environment: + - mount + - pwd - asdf plugin add uv - asdf install uv latest - asdf global uv latest # Turn `python -m virtualenv` into `python -c pass` - truncate --size 0 $( dirname $( uv python find ) )/../lib/python3*/site-packages/virtualenv/__main__.py - - mount post_create_environment: - uv venv $READTHEDOCS_VIRTUALENV_PATH # Turn `python -m pip` into `python -c pass` - truncate --size 0 $( ls -d $READTHEDOCS_VIRTUALENV_PATH/lib/python3* )/site-packages/pip.py - - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install -n --upgrade sphinx + - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install --cache-dir $READTHEDOCS_VIRTUALENV_PATH/.. --upgrade sphinx post_install: - - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install -n -r docs/requirements.txt + - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install --cache-dir $READTHEDOCS_VIRTUALENV_PATH/.. -r docs/requirements.txt From 9cea7c26d282fd4dbd84c31355144a62c1b87e1c Mon Sep 17 00:00:00 2001 From: Chris Markiewicz Date: Fri, 8 Nov 2024 11:40:39 -0500 Subject: [PATCH 10/10] finalize --- .readthedocs.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index b56a0e519..2923d956f 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -6,8 +6,6 @@ build: python: latest jobs: pre_create_environment: - - mount - - pwd - asdf plugin add uv - asdf install uv latest - asdf global uv latest @@ -17,6 +15,7 @@ build: - uv venv $READTHEDOCS_VIRTUALENV_PATH # Turn `python -m pip` into `python -c pass` - truncate --size 0 $( ls -d $READTHEDOCS_VIRTUALENV_PATH/lib/python3* )/site-packages/pip.py - - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install --cache-dir $READTHEDOCS_VIRTUALENV_PATH/.. --upgrade sphinx + # Use a cache dir in the same mount to halve the install time + - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install --cache-dir $READTHEDOCS_VIRTUALENV_PATH/../../uv_cache --upgrade sphinx post_install: - - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install --cache-dir $READTHEDOCS_VIRTUALENV_PATH/.. -r docs/requirements.txt + - VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install --cache-dir $READTHEDOCS_VIRTUALENV_PATH/../../uv_cache -r docs/requirements.txt