-
-
Notifications
You must be signed in to change notification settings - Fork 43
Conversation
Hi there @astrofrog 👋 - thanks for the pull request! I'm just a friendly 🤖 that checks for issues related to the changelog and making sure that this pull request is milestoned and labeled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part 😃. Everything looks good from my point of view! 👍 If there are any issues with this message, please report them here. |
1faa563
to
c00f0c6
Compare
99a2c20
to
d757d0f
Compare
@astrofrog - Just to double check, to use |
.travis.yml
Outdated
@@ -60,6 +60,9 @@ before_script: | |||
- git config --global user.name "A U Thor" | |||
- git config --global user.email "[email protected]" | |||
|
|||
# TEMP: replace by sphinx-astropy in PIP_DEPENDENCIES once installed |
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.
once installed or once released?
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.
Yep, good catch! I'll fix it before we merge.
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 all good to me!
CHANGES.rst
Outdated
@@ -6,6 +6,10 @@ astropy-helpers Changelog | |||
|
|||
- Removing deprecated test_helpers.py file. [#369] | |||
|
|||
- Remove all sphinx components from astropy-helpers. These are now replaced | |||
by the sphinx-astropy package in conjunction with the astropy-theme-sphinx, |
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.
please double backtick the package names
@@ -120,7 +120,10 @@ def run(self): | |||
build_cmd_path = os.path.abspath(build_cmd.build_lib) | |||
|
|||
ah_importer = pkgutil.get_importer('astropy_helpers') | |||
ah_path = os.path.abspath(ah_importer.path) | |||
if ah_importer is None: |
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 prompted this change?
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 was actually related to trying to build the docs with python setup.py build_docs --use-system-astropy-helpers
so isn't quite related to this PR but I found it while trying to use this PR
I really like this refactoring, but have a few questions left. Do we plan to pin sphinx-astropy's version in the helpers releases? I just wonder about scenarios when it's not safe or desired by affiliated packages to upgrade to the latest sphinx-astropy. Since having this factored out, the overall complexity of the helpers package hierarchy is growing that may cause further confusion. |
No, you can use sphinx-astropy without ever installing the helpers.
As far as I know there is no way to 'pin' sphinx-helpers in astropy-helpers as such, since astropy-helpers is never actually installed (so
Just to be clear, astropy-helpers basically knows nothing about sphinx-astropy, and you can use astropy-helpers without using sphinx-astropy (if you don't want the default astropy config) and vice-versa you can use sphinx-astropy and just build the docs with |
But those were bundled into the helpers so far, so we had some control over what to include. You're probably right though that we can have a hot fix when any issues come up. I would just like to avoid situations when the random xy package start complaining with some weird looking error that comes up at a random occasion and the solution will be that we have updated something in sphinx-astropy (but since the packages are low traffic ones, that update might have happened a while ago). |
This does raise a good point, which might have come up anyway even without this split - what if we want to change the default configuration some day? One solution since we are updating the imports anyway would be to update to versioned imports: from sphinx_astropy.conf.v1 import * this then allows us to make significant opt-in changes to the default configuration if we want in future (without requiring packages pin to a specific version) though we can just make changes to |
Yes, the approach could work, and with that we may also want to consider to backport this refactoring to the 2.0.x branch, so anyone still supporting python2 could use sphinx-astropy. Or it's already python3 only? |
Anyone can use sphinx-astropy irrespective of astropy-helpers version. This PR just removes all the code from astropy-helpers but that's just cleanup - you can use sphinx-astropy even if you are on v2.0.x, except if sphinx-astropy isn't compatible with Python 2 (which I need to check). Basically if you import |
Generally I'm 👍 to this, @astrofrog. However, two concerns: First: Am I understanding right that you are not then planning to package all the new "requirements" as helpers dependencies? If so that seems problematic because one of the main selling points of the helpers is that it's a "one stop shop" and the user of it needn't worry too much about managing all their dependencies. Is there any reason not to have the helpers Second:
Why not, at least for a time, leave the existing import in place but have it simply be a placeholder
Or similar? That lets helpers users (i.e. affiliated package devs) know that this is coming, but gives them a window to do the helpes update without it breaking immediately? |
we can do that deprecation you suggest, but I would rather include the conf change in the same automated PR that updates for the 3.1 helpers that raising any deprecation warnings to the users. On the other hand, not deprecating but having that import in the helpers sounds like a good solution to me, too. |
We can add it to There are a couple of options here as far as I can see - we could either modify
Sounds good, that's easy to do! |
@eteq - I've implemented the auto-install and the warning. The auto-install can't be tested completely yet as I need to do a release of sphinx-astropy first, but I tested it by using another package. Would something like this work for you? (this is like what we do for running tests). If you are happy with it I could do a release of sphinx-astropy to check it works properly? |
4504a0e
to
5226359
Compare
…docs does it automatically
5226359
to
d492826
Compare
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.
Minor suggestion, but other than that this LGTM. I'm a bit concerned the auto-installer trick will confuse some people about where their sphinx is coming from... but such is life - it's probably no more (and probably less) complicated than the helpers install process, anyway...
astropy_helpers/sphinx/conf.py
Outdated
|
||
from sphinx_astropy.conf import * | ||
|
||
warnings.warn("Note that astropy_helpers.sphinx.conf is deprecated - use sphinx_astropy.conf instead") |
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.
(minor) maybe "use sphinx_astropy.conf in the sphinx-astropy package"? Just so a random user who pays no attention this stuff knows what to google...
One thought which is not strictly related to this PR: should we update the astropy docs to explicitly say somewhere "got to the sphinx-astropy repo to get help/report issues/etc on the sphinx machinery"? |
@eteq - thanks for reviewing! Just a few things/clarifications based on your comments here and on slack:
This is the same as before.
So if users do run into any issues, all the information should be there to figure out what might be going on with eggs vs system installs. |
…ed docs dependencies take precedence over auto-installed eggs.
I have mixed feelings about this - if there are issues with building the astropy docs, it could be due to an issue in astropy itself, the helpers, or any of the extensions, or sphinx itself. People who understand the build process will likely report issues in the right place, and otherwise for users I think it's fine if they just open an issue in the main repository and we can dispatch as needed. |
That was a typo, my bad - I meant the sphinx plugin installs. So I'm happy as far as that is concerned.
Hmm, that worries me for us because it's hard to keep a 30,000 foot view. And I think some users get turned off by the "thanks for your input, but that should go in the Anyway, all of these are not issues, so I'm going to go ahead and merge. |
Overview
This is a more extensive alternative to #367, and it:
astropy_helpers.sphinx
to https://github.com/astropy/sphinx-astropyIt does not remove
build_docs
though.Note that the astropy-sphinx-theme and sphinx-astropy repositories contain the full history of the files in those repos, including their origins in the astropy core package. I am publishing the scripts I used to do all this here: https://github.com/astrofrog/git-workflows (note that this isn't up to date yet as I have some more changes to push).
Note that sphinx-astropy is also a meta-package in that it includes dependencies on astropy-sphinx-theme, sphinx-automodapi, numpydoc, and sphinx-gallery. I haven't published sphinx-astropy yet as I want to make sure we have a chance to discuss this here first.
Backward-compatibility
These changes will require one change in astropy core and affiliated packages (when they update to astropy-helpers next), which to change this line:
https://github.com/astropy/astropy/blob/master/docs/conf.py#L48
from:
to
Note that we can make this change automatically when updating astropy-helpers. We could optionally add a nicer error message:
This has the benefit of being super explicit in terms of what is required, which is an improvement over just the logging warning in #367.
See astropy/astropy#7139 for an example implementation in the core package.
I don't think we need to add a compatibility layer to astropy-helpers since in principle packages will be able to update their
conf.py
at the same time as the astropy-helpers submodule.Steps forward
If we agree on this, these are the steps ahead:
Fixes #338
Fixes #339
The following issue should probably be moved to sphinx-astropy, or at least resolved there then closed here: #270, #195, #211, #233, #320, https://github.com/astropy/astropy-helpers/issues/327
The following issue should probably be in sphinx-automodapi; https://github.com/astropy/astropy-helpers/issues/276