-
Notifications
You must be signed in to change notification settings - Fork 93
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
get release / version info from setuptools_scm #1674
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1674 +/- ##
=======================================
Coverage 99.85% 99.85%
=======================================
Files 136 136
Lines 4690 4690
Branches 470 470
=======================================
Hits 4683 4683
Misses 3 3
Partials 4 4 ☔ View full report in Codecov by Sentry. |
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 but a couple points to clarify on the actual display
@@ -93,7 +98,10 @@ | |||
# further. For a list of options available for each theme, see the | |||
# documentation. | |||
# | |||
# html_theme_options = {} | |||
|
|||
# Show the version number in the navigation bar |
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.
Version doesn't seem to be printed anywhere in local doc build. Seems like how versioning is handled may have changed: https://stackoverflow.com/a/79192065
and in particular, that it may now be only via a version selector that is only available if docs are hosted by RTD. Guess we could merge and see if this is the case (?)
I think we want the version information printed somewhere. One option would be to manually print the version somewhere, by putting :Version: |version|
into the rst
# get the release version from the setuptools_scm | ||
try: | ||
release = get_version(root="..", relative_to=__file__) | ||
version = ".".join(release.split(".")[:2]) |
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.
What's the [:2]
intended to chop out here? (Note that I can't get the version number to display anywhere in a local docs build). But, if I run this via the REPL, I get that release == '0.2.1a2.dev65+g2d5ba65'
and version == 0.2
.
I don't think we want to chop off this much, if anything? That is, stable builds should have a nice looking version number (so no need to chop anything off). Unstable builds will have the commit hash, which looks ugly but is providing necessary information IMO (so also don't want to chop that off).
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.
yeah that's what i was intending-- that version would be version == 0.2
and release would be that blob. I've pushed a commit that manually adds a footer with all this info displayed. also I think once we merge the version selector business will appear on RTD
okay i've added a custom footer now which adds this to the bottom of the RTD pages: ![]() @nspope note that the version / release is now correct. when I showed you this earlier my feature branch did not have the tags properly fetched on to it, which is what I'm guessing that when we merge this the version selector option of the sphinx_rtd_theme will also just work, so I think this is ready to merge |
this changes the
doc/conf.py
to pull the version and release info automatically from thesetuptools_scm
interface as requested in #680will close #680