-
-
Notifications
You must be signed in to change notification settings - Fork 573
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
Replaces astropy-helper with sphinx-astropy #2494
Conversation
.rtd-environment.yml
Outdated
@@ -61,4 +61,4 @@ dependencies: | |||
- glymur | |||
- pip: | |||
- sunpy-sphinx-theme | |||
- git+https://github.com/sphinx-gallery/sphinx-gallery |
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.
sphinx-gallery and sphinx-astropy do two different things we are going to need both 😄
@@ -29,14 +29,7 @@ | |||
import datetime | |||
import sys | |||
|
|||
ON_RTD = os.environ.get('READTHEDOCS') == 'True' |
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 we are still going to need all of this RTD stuff.
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.
Should we check if we do need this?
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.
See comment below, we are now importing it from sphinx astropy
docs/conf.py
Outdated
os.environ['HOME'] = '/home/docs/' | ||
os.environ['LANG'] = 'C' | ||
os.environ['LC_ALL'] = 'C' | ||
import astropy |
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 don't think we need this.
Fixes typo Small requested changes requested changes small changes
I think down the road we can remove sphinx-gallery since its one of the dependencies for sphinx-astropy. But since it has't had a release for a while, we still need to use master. Issue is now we have one warning in the doc build but having a quick glance, I can't find it. |
|
docs/conf.py
Outdated
@@ -174,14 +166,13 @@ | |||
napoleon_google_docstring = False | |||
|
|||
# -- Options for the edit_on_github extension ---------------------------------------- | |||
extensions.remove('astropy_helpers.extern.numpydoc') |
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.
we still need to remove this, jut from astropy_sphinx
instead. It's possible this is what's causing the doc warning.
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.
But extensions in astropy_sphinx
does not contain astropy_helpers.extern.numpydoc
, will raise an error if removed . Also numpydocs
should be removed from extensions, right ?
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.
@Cadair ping
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 in astropy_sphinx
it looks like it's just numpydoc
we need to pop (https://github.com/astropy/sphinx-astropy/blob/master/sphinx_astropy/conf/v1.py#L135)
I have just had a look through the Firstly, a quick bit of background. Sphinx imports How we organise our What would be nice to do is to look through the Then also feel free to re-format our
Also worth looking at is the Thanks! |
Thanks for the help @Cadair ,will update the |
docs/conf.py
Outdated
@@ -174,6 +172,9 @@ | |||
napoleon_google_docstring = False | |||
extensions += ['sphinx_astropy.ext.edit_on_github', 'sphinx.ext.doctest', 'sphinx.ext.githubpages'] | |||
|
|||
# Remove numpydoc |
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.
Can you put this directly above the extensions.append('sphinx.ext.napoleon')
line?
Also the napoleon config seems to be duplicated? Can you remove the one not under the "swap to napoleon" comment?
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 is very close! Just a couple of little tweaks.
CHANGELOG.rst
Outdated
@@ -42,6 +42,8 @@ Bug Fixes | |||
- Updates MapCube to access the correct properties of the namedtuple SpatialPair [#2297] | |||
- Fixed TimeSeries test failures due to missing test files [#2273] | |||
- Refactored a GOES test to avoid a Py3.6 issue [#2276] | |||
- The documentation build now uses the Sphinx configuration from sphinx-astropy | |||
rather than from astropy-helpers. |
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.
this needs the pr number in square brackets at the end.
extensions.append('sphinx.ext.napoleon') | ||
|
||
# Disable having a separate return type row | ||
napoleon_use_rtype = False | ||
# Disable google style docstrings | ||
napoleon_google_docstring = False | ||
|
||
# -- Options for the edit_on_github extension ---------------------------------------- |
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.
This comment should still be here.
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
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.
This was moved to the wrong part of the file?
requirements/docs.txt
Outdated
@@ -7,3 +7,4 @@ | |||
sphinx | |||
sunpy-sphinx-theme | |||
sphinx-gallery | |||
sphinx_astropy |
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.
the pip name is sphinx-astropy
not sphinx_astropy
.
(yes, yes it's a very confusing convention lol)
ON_TRAVIS = os.environ.get('TRAVIS') == 'true' | ||
|
||
if ON_RTD: | ||
if on_rtd: |
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.
Should be ON_RTD
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.
No, we now import this from sphinx_astropy and it's lower case.
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.
OH FAIR ENOUGH I SHOULD HAVE CHECKED
@@ -200,7 +185,7 @@ | |||
|
|||
# -- Options for the Sphinx gallery ------------------------------------------- | |||
|
|||
if ON_RTD and os.environ.get('READTHEDOCS_PROJECT').lower() != 'sunpy': | |||
if on_rtd and os.environ.get('READTHEDOCS_PROJECT').lower() != 'sunpy': |
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.
ON_RTD
@@ -902,7 +902,8 @@ def test_fetch(database, download_query, tmpdir): | |||
database.undo() | |||
assert len(database) == 0 | |||
database.redo() | |||
assert len(database) == 4 | |||
# Make this resilitent to vso changes while we chase this up with VSO 2018-03-07 | |||
assert len(database) in (2, 4) |
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.
THIS IS MAGIC, WHY DIDNT I DO THIS.
Thanks @yashkgp this is awesome! |
Solves Issue #2489