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

Wrong version in warning banner #1445

Closed
vnmabus opened this issue Sep 15, 2023 · 8 comments · Fixed by #1446
Closed

Wrong version in warning banner #1445

vnmabus opened this issue Sep 15, 2023 · 8 comments · Fixed by #1446
Labels
impact: block-release Should block a release from happening. Only use if this is a critical problem we don't want to ship

Comments

@vnmabus
Copy link

vnmabus commented Sep 15, 2023

The version compared and displayed in the warning banner is not the "version_match" attribute, but the theme version, as a result of #1394:

const version = DOCUMENTATION_OPTIONS.theme_version;

This result in the following image (note that the version of the banner is not the package version):

imagen

@12rambau 12rambau added the impact: block-release Should block a release from happening. Only use if this is a critical problem we don't want to ship label Sep 18, 2023
@12rambau
Copy link
Collaborator

12rambau commented Sep 21, 2023

It seems something went wrong with the fix: https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html
I made a release yesterday and the stable version is referenced as "unknown version" now

@12rambau 12rambau reopened this Sep 21, 2023
@drammock
Copy link
Collaborator

drammock commented Sep 21, 2023

That is actually a different problem related to #1416. I noticed too but I'm teaching today so I can't look until Friday

@jklymak
Copy link
Contributor

jklymak commented Oct 5, 2023

This seems to be an issue at https://pydata-sphinx-theme.readthedocs.io/en/stable/ as well?

@drammock
Copy link
Collaborator

drammock commented Oct 6, 2023

This seems to be an issue at https://pydata-sphinx-theme.readthedocs.io/en/stable/ as well?

How so? The dropdown in the stable docs says "choose version" not "unknown version" nor an incorrect version string. "Choose version" is the new fallback value in case the version match cannot be determined; again, that is a different problem than the OP reported and is tracked in #1416

@jklymak
Copy link
Contributor

jklymak commented Oct 6, 2023

https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html has a banner saying this is an unknown version and switch to stable, which lands you on the same page. image

@drammock
Copy link
Collaborator

drammock commented Oct 6, 2023

ah! my apologies, I was focused on the dropdown switcher and didn't even notice the banner. Nonetheless I believe that the cause is still the problem described in #1416 --- it's difficult to debug as I haven't been able to replicate it on PR builds or local builds.

@xia-stan
Copy link

xia-stan commented Jan 4, 2024

I'm using Python 3.12, PyData Sphinx Theme 0.15.1, and Sphinx 7.2.6. I'm able to replicate this issue.
image

From what I can tell, the value unknown version is getting inserted because the generated file documentation_options.js has an empty string for VERSION:

const DOCUMENTATION_OPTIONS = {
    VERSION: '',
    LANGUAGE: 'en',
    COLLAPSE_INDEX: false,
    BUILDER: 'html',
    FILE_SUFFIX: '.html',
    LINK_SUFFIX: '.html',
    HAS_SOURCE: true,
    SOURCELINK_SUFFIX: '.txt',
    NAVIGATION_WITH_KEYS: false,
    SHOW_SEARCH_SUMMARY: true,
    ENABLE_SEARCH_SHORTCUTS: true,
};

Manually changing the VERSION to '1.0.0' and refreshing the page provides the expected message banner:
image

As to why VERSION was empty, I tracked this back to conf.py. I set the Sphinx variable version but not release. VERSION in documentation_options.js gets set to the release value and not version.

@drammock
Copy link
Collaborator

drammock commented Jan 4, 2024

As to why VERSION was empty, I tracked this back to conf.py. I set the Sphinx variable version but not release. VERSION in documentation_options.js gets set to the release value and not version.

Thanks for the report @xia-stan. Indeed we use the release value and not the version value from conf.py. We are assuming folks follow what is stated in the Sphinx docs for release:

If you don’t need the separation provided between version and release, just set them both to the same value.

I think this issue can be closed now, on the assumption that if release is properly set, the warning banner will work as intented. But the fact that folks keep stumbling around the version switcher and the warning banner suggests that either (1) what we're doing is too fragile/magic, or (2) we're not documenting it clearly enough. I'll open a new issue to focus our attention on those improvements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
impact: block-release Should block a release from happening. Only use if this is a critical problem we don't want to ship
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants