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

docs: Fix version warning banner #1088

Merged
merged 3 commits into from
Jan 13, 2025
Merged

docs: Fix version warning banner #1088

merged 3 commits into from
Jan 13, 2025

Conversation

thomass-dev
Copy link
Collaborator

@thomass-dev thomass-dev commented Jan 10, 2025

There is a bug in documentation when releasing a new version X.Y.Z with Z >0.
It shows the warning banner indicating that it's a development version, even if it's really a release version.

It is because, to know if the banner must be showed, the release version X.Y.Z is currently compared to the previous X.Y, instead of X.Y.Z. When Z is >0, X.Y.Z is always greater than X.Y, so sphinx consider it's a unstable version.

If the version compares greater than the preferred version (or if the version match contains the strings “dev”, “rc” or “pre”), the announcement will say they are viewing an unstable development version instead.

https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/announcements.html


This PR intends to compare current strict release with the previous strict release to know if the banner must be showed, instead of the MAJOR.MINOR.

Closes #1058.

Copy link
Contributor

Documentation preview @ e75d0a6

@thomass-dev thomass-dev marked this pull request as ready for review January 13, 2025 10:05
Copy link
Contributor

@augustebaum augustebaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a few suggestions

.github/workflows/sphinx.yml Show resolved Hide resolved
.github/workflows/sphinx.yml Show resolved Hide resolved
.github/workflows/sphinx.yml Outdated Show resolved Hide resolved
@thomass-dev thomass-dev merged commit 947eee5 into main Jan 13, 2025
3 of 7 checks passed
@thomass-dev thomass-dev deleted the doc-warning-banner branch January 13, 2025 13:46
rouk1 pushed a commit that referenced this pull request Jan 14, 2025
There is a bug in documentation when releasing a new version X.Y.Z with
Z `>0`.
It shows the warning banner indicating that it's a development version,
even if it's really a release version.

It is because, to know if the banner must be showed, the release version
X.Y.Z is currently compared to the previous X.Y, instead of X.Y.Z. When
Z is `>0`, X.Y.Z is always greater than X.Y, so sphinx consider it's a
unstable version.

> If the version compares greater than the preferred version (or if the
version match contains the strings “dev”, “rc” or “pre”), the
announcement will say they are viewing an unstable development version
instead.


https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/announcements.html

---

This PR intends to compare current strict release with the previous
strict release to know if the banner must be showed, instead of the
MAJOR.MINOR.

Closes #1058.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs: Fix version warning banner on tags with a bugfix version other than zero
2 participants