-
Notifications
You must be signed in to change notification settings - Fork 287
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
automate docs discovery of iris and python versions #3981
Conversation
Did you intend some use of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks ok to me, question inline
docs/src/conf.py
Outdated
# Create a variable that can be insterted in the rst "|copyright_years|". | ||
# You can add more vairables here if needed | ||
# Create a variable that can be inserted in the rst "|copyright_years|". | ||
# You can add more variables here if needed. | ||
rst_epilog = """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason for using format strings in the .format
method, rather than having a single format string
f"""
|copyright_years| replace:: 2010 - {upper_copy_year}
[...etc]
"""
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, could do, thanks.
I was lazily following what was there before... I'll tidy it up 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Nice, that's way tidier, thanks.
@trexfeathers The As part of #3976, I was forced to make the decision to only build the documentation for the latest supported version of python for iris i.e., 3.8, simply due to changes in some doc-tests output which differs based on the python version. This poses a problem, as we don't want to be in the situation of having different doc-tests based on the underlying python version. To keep this simple we should only build and publish the latest supported version of python for Iris. In doing so, we should make it clear to users what version of python the documentation is built against, hence the need for @tkknight will push a follow-on PR to propose how we highlight this information. |
docs/src/conf.py
Outdated
build_date=f"({datetime.datetime.now().strftime('%d %b %Y')})", | ||
) | ||
rst_epilog = f""" | ||
.. |copyright_years| replace:: {2010 - upper_copy_year} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should probably be: 2010 - {upper_copy_year}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oopsie... good spot 👀
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me 👍
* master: (23 commits) Added text to state the Python version used to build the docs. (SciTools#3989) add nox session conda list (SciTools#3990) Add abstract cube summary (SciTools#3987) automate docs discovery of iris and python versions (SciTools#3981) corrected syntax (SciTools#3980) core dev whatsnew entry (SciTools#3978) moved docs dir and updated references to it (SciTools#3975) Fix test_incompatible_dimensions test (SciTools#3977) remove explicit URLs for core dev names from latest.rst (SciTools#3973) document that iris.coords.Coord is an ABC (SciTools#3971) reorganise docs common links + add core devs (SciTools#3972) Docs whatsnew add dropdowns to the template (SciTools#3969) Docs whatsnew enumerated lists (SciTools#3970) Merge back v3p0p1 (SciTools#3966) Captilise installation heading - align SciTools#3958 content with SciTools#3940. (SciTools#3963) Merge back v3p0p0 (SciTools#3960) Extended the installation description (SciTools#3958) Put cube data on the x axis if plotting just a cube against a vertical or y coordinate (SciTools#3906) remove stock_mdi_arrays.npz (SciTools#3913) Gallery: update seasonal ensemble example (SciTools#3933) ...
🚀 Pull Request
Description
This PR automates the discovery of the
iris
version for thewhatsnew
, and also thepython
version used to build the documentation via thesphinx
rst_epilog.These are available in all
rst
files via|iris_version|
and|python_version|
directives.The rendered version of the
whatsnew
generated by this PR is available here.The rendered version of the
release
documentation changes from this PR are available here.P.S. the
|build_date|
directive is now also available to automate thewhatsnew
release/build date.Consult Iris pull request check list