ESMValGroup / ESMValTool

ESMValTool: A community diagnostic and performance metrics tool for routine evaluation of Earth system models in CMIP
https://www.esmvaltool.org
Apache License 2.0
227 stars 128 forks source link

Fix wrong version in title in Readthedocs documentation #3815

Open valeriupredoi opened 3 days ago

valeriupredoi commented 3 days ago

Description

Before you get started

Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the ๐Ÿ›  Technical or ๐Ÿงช Scientific review.

bouweandela commented 1 day ago

To see the version, you can run the command

curl -s https://esmvaltool--3815.org.readthedocs.build/en/3815/ | grep Welcome

For this branch, it shows 2.12.0.dev55+g198d16f9c.d20241119, so better than the current main which shows 0.1.0.dev50+gde43833.d20241114, but it still has the .d20241119 ending, meaning that the git repository had uncommitted changes (that readthedocs made) at the time where ESMValTool was installed.

bouweandela commented 1 day ago

Maybe see if we can copy the entire .readthedocs.yml from iris? e.g. I see they are installing differently: https://github.com/SciTools/iris/blob/2600fb9bd9a1309fa6e989c1728589aa8140fb94/.readthedocs.yml#L28-L31

valeriupredoi commented 57 minutes ago

I highly doubt that's the bit that fixes it, but yeah why not, I just plopped it in, let's see :crossed_fingers:

valeriupredoi commented 56 minutes ago

curl -s https://esmvaltool--3815.org.readthedocs.build/en/3815/ | grep Welcome

ha love this, 'tis magic :grin:

valeriupredoi commented 33 minutes ago

so I think I know what the cause is: at installation point, the pip install assigns a development version, see the raw output - much easier for me to read:

Successfully installed ESMValTool-2.12.0.dev56+gdf8d32339.d20241122

which is fine, that's the normal behaviour. But I think RTD import that version, moreover, git fetch --unshallow don't give a v2.11.0 at all - do you know why there's no 2.11?

bouweandela commented 23 minutes ago

This needs to be removed, you're installing twice now: https://github.com/ESMValGroup/ESMValTool/blob/df8d323394b425f3248055456ef15732b827df3a/.readthedocs.yaml#L24-L25

valeriupredoi commented 22 minutes ago

agh!

bouweandela commented 19 minutes ago

git fetch --unshallow don't give a v2.11.0 at all - do you know why there's no 2.11?

Because you're not building the v2.11.0 tag but this branch. The version you see on readthedocs should be the same as the one you see when running pip install --no-deps . locally. What --unshallow does is clone the full repository, including the tags, so setuptools-scm can figure out the proper version instead of 0.1.0.

The .d20241119 ending, meaning that the git repository had uncommitted changes (that readthedocs made) at the time where ESMValTool was installed, should not be there. From the raw build log, it looks like readthedocs modifies the environment.yml file. To avoid that the version ends with .d20241119, these changes need to be stashed prior to the installation of ESMValTool.

valeriupredoi commented 15 minutes ago

git fetch --unshallow don't give a v2.11.0 at all - do you know why there's no 2.11?

Because you're not building the v2.11.0 tag but this branch. The version you see on readthedocs should be the same as the one you see when running pip install --no-deps . locally. What --unshallow does is clone the full repository, including the tags, so setuptools-scm can figure out the proper version instead of 0.1.0.

The .d20241119 ending, meaning that the git repository had uncommitted changes (that readthedocs made) at the time where ESMValTool was installed, should not be there. From the raw build log, it looks like readthedocs modifies the environment.yml file. To avoid that the version ends with .d20241119, these changes need to be stashed prior to the installation of ESMValTool.

snap! That was the code change all along! But the flow runs a git stash after RTD cats the environment file, so why is it still picked up?

bouweandela commented 3 minutes ago
$ curl -s https://esmvaltool--3815.org.readthedocs.build/en/3815/ | grep Welcome | head -n 1
    <title>Welcome to ESMValToolโ€™s documentation! &#8212; ESMValTool 2.12.0.dev57+gdeacbb304 documentation</title>

Looks perfect now!

bouweandela commented 2 minutes ago

That was the code change all along! But the flow runs a git stash after RTD cats the environment file, so why is it still picked up?

It runs the stash after the conda run pip install command but before the pip install command. Now that you've removed the conda run pip install one, it looks good.