From 9ba8ca4307882e9558b9460683ef44980760e5ec Mon Sep 17 00:00:00 2001 From: Niket <15953349+niketagrawal@users.noreply.github.com> Date: Mon, 30 Sep 2024 13:21:01 +0200 Subject: [PATCH] rrenaming env yml file can be avoided if we move it to a temporary lcoation before copying --- .readthedocs.yml | 14 ++++++++++++-- ..._unpinned.yaml => environment_readthedocs.yaml} | 0 2 files changed, 12 insertions(+), 2 deletions(-) rename docs/{environment_readthedocs_unpinned.yaml => environment_readthedocs.yaml} (100%) diff --git a/.readthedocs.yml b/.readthedocs.yml index e4e62940..88c6531f 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -18,7 +18,10 @@ build: jobs: pre_install: - LATEST_TAG=$(git describe --tags --abbrev=0) ; echo Downloading $LATEST_TAG ; - wget https://github.com/tudat-team/tudatpy/archive/refs/tags/$LATEST_TAG.zip; unzip $LATEST_TAG.zip; rm -rf docs/; LT=$(echo $LATEST_TAG | cut -c 2-); mv tudatpy-$LT/docs/ . + wget https://github.com/tudat-team/tudatpy/archive/refs/tags/$LATEST_TAG.zip; unzip $LATEST_TAG.zip; + mv docs/environment_readthedocs.yaml /tmp/environment_readthedocs.yaml; + rm -rf docs/; LT=$(echo $LATEST_TAG | cut -c 2-); mv tudatpy-$LT/docs/ .; + mv /tmp/environment_readthedocs.yaml docs/environment_readthedocs.yaml; # The pre-install step enables building the docs on the latest tag # instead of the latest commit. Since Read the Docs uses the latest # tudatpy dev conda package to find the binaries (see docs/source/conf. @@ -28,7 +31,14 @@ build: # on the latest commit. The pre-install step replaces the docs/ # directory with the docs/ directory of the latest tag. +# The pre-install step does the following: +# Download and unzip the latest tag. +# Move the current environment_readthedocs.yaml file to a temporary location. +# Remove the current docs/ folder. +# Move the docs/ folder from the latest tag to the current location. +# Move the environment_readthedocs.yaml file back to the docs/ folder. + conda: - environment: docs/environment_readthedocs_unpinned.yaml + environment: docs/environment_readthedocs.yaml diff --git a/docs/environment_readthedocs_unpinned.yaml b/docs/environment_readthedocs.yaml similarity index 100% rename from docs/environment_readthedocs_unpinned.yaml rename to docs/environment_readthedocs.yaml