Skip to content
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

Fix wrong version in title in Readthedocs documentation #3815

Merged
merged 4 commits into from
Nov 22, 2024

Conversation

valeriupredoi
Copy link
Contributor

@valeriupredoi valeriupredoi commented Nov 19, 2024

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.

@valeriupredoi valeriupredoi changed the title Fix wrong version in Readthedocs Fix wrong version in title in Readthedocs documentation Nov 19, 2024
@bouweandela
Copy link
Member

bouweandela commented Nov 21, 2024

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
Copy link
Member

bouweandela commented Nov 21, 2024

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
Copy link
Contributor Author

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

@valeriupredoi
Copy link
Contributor Author

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

ha love this, 'tis magic 😁

@valeriupredoi
Copy link
Contributor Author

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
Copy link
Member

This needs to be removed, you're installing twice now:

post_create_environment:
- conda run -n ${CONDA_DEFAULT_ENV} pip install . --no-deps

@valeriupredoi
Copy link
Contributor Author

agh!

@bouweandela
Copy link
Member

bouweandela commented Nov 22, 2024

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
Copy link
Contributor Author

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
Copy link
Member

$ 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!

.readthedocs.yaml Outdated Show resolved Hide resolved
@bouweandela
Copy link
Member

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.

Co-authored-by: Bouwe Andela <b.andela@esciencecenter.nl>
@valeriupredoi
Copy link
Contributor Author

ah so it was the double install that was messing things up - thanks a lot @bouweandela - just in time for Friday pub 🍺

@valeriupredoi valeriupredoi merged commit 0e1ba01 into main Nov 22, 2024
8 checks passed
@valeriupredoi valeriupredoi deleted the try_fix_version_rtd branch November 22, 2024 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Version number in documentation title on readthedocs is wrong
2 participants