-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Create a separate astropy-helpers package to contain common infrastructure code for the core and affiliated packages #1563
Conversation
Also, on a more minor level, there is the choice of name for this package - |
I few items to add from the previous issue:
|
Oh, and to address @astrofrog's comment:
I think probably the safest route forward is to do the minimal required initially (basically the three files @astrofrog mentioned). If we go any further than that we should go all the way, though. That is, move the testing, configuration, documentation tools, and |
Why not start with the name
Good point about the issues. We definitely want a separate repository IMHO (since it will have its own releases, tags, etc.) but we could consider disabling issues (but not pull requests) on that repository if we don't want things to be spread out too much.
Just to be clear, this comment relates just to the submodule idea, right? It seems to me it might be simpler for everyone if we can make it work as a normal package instead. Note that this also enables affiliated package maintainers to easily use this package without having to use the full template too.
Ok, let's go with the minimum required for now, and we can see how that works before moving ahead. Shall I give it a go and try and create a simple repo? |
Another option for a name - |
Still catching up on this, but I would like to make one comment that I also left in the package-templates issue:
|
Another bit on submodules:
I wouldn't mind writing a little "bootstrap" script for the "astropy_science_package_setuptools_utils" package or whatever we're calling it. This can be very simple actually: First it would attempt the git submodule synchronization you described, a la IPython. This would enable the "hybrid" approach I mentioned, where we still include a copy of the setup utils in the main Astropy repo as a submodule. I think this is preferable for anyone doing Astropy development. If it's not a git clone (or the repo in question simply doesn't use submodules), however, it would just use the setuptools |
Ahh, now I think I get @embray's hybrid approach idea. I like it, as it seems to combine the ease of a separate package (as suggested by @astrofrog) with a straightforward way to include it in the astropy repo. Then affiliated package devs have it easier because they don't have to synchronize, but they can if they want. So that addresses most of my concerns (aside from the issue-tracker question, and I agree with @astrofrog that it might make sense to just turn off issues there as long as it has astropy in the name). Another reason why having submodule stuff might be nice is that then we might be able to start using those tools in And on the name: @astrofrog says
because if we re-name it, then we have to have two separate projects (with different names) on pypi that are continuations of each other. In my experience, that seems to be really difficult to do without user confusion. But maybe I'm worrying too much. |
I think in this case they're still different enough. Right now we're talking only something specifically for Astropy and affiliated packages. I've had though the thought for a while now that it would be nice to make some of the stuff we've hacked together easier to use for other projects too, but if someone actually has the time and inclination to do that I think it would evolve into something different enough to warrant a different name. I don't think "we" (as in the Astropy project) need to directly support such a project. I'd be interested in helping out with something like that sometime, but I see it as a tangential endeavor. |
Good point, @embray - so in that case I'm fine with @astrofrog's suggestion of |
I'm pretty happy with |
We don't? https://github.com/astropy/astropy/wiki/APE1 On Wed, Oct 16, 2013 at 12:59 PM, Erik notifications@github.com wrote:
|/|o | . _ | | ._ ||| _ _ ._ _ |
@embray - feel free to start drafting APE2! :) |
Well for one it's incomplete and hasn't even been discussed or remotely finalized as far as I'm aware. But at least it's a start. |
APE1 seems reasonably complete, but I agree it hasn't been approved explicitly yet. |
By the way, another thought regarding this that #1785 brings to mind, is that if we have a separate package for this stuff we can also have a separate test suite for it. Now, technically we could also include tests for it in the normal Astropy test suite, but build/installer tests can be annoying to run--time consuming, and error-prone. That said, it can be done. I have test suites for d2to1 and stsci.distutils that get pretty good coverage, and I would add the same to astropy-distutils or whatever we wind up calling it. |
@embray - APE1 is accepted (https://github.com/astropy/astropy-APEs), so we can start working on the APE for the |
@embray +1 on having a separate test suite for it |
@embray - do you want to have a go at drafting APE2 or APE3 (now that APE1 is accepted) or shall I? |
I will try to take this on. This is the sort of thing that practically demands a sample implementation to go along with the APE, since otherwise it would be difficult ahead of time to figure out exactly all the issues involved. Though I will start an outline of the APE first to give a starting point. |
Coverted this into a WIP PR to support using astropy_helpers with Astropy. Right now this pulls in my fork of astropy_helpers as a submodule (see astropy/astropy-helpers#1). Before merging into master, this will be switched over to the main fork of astropy_helpers once it is ready. This PR will serve as part of the initial sample implementation to go along with the first draft of the APE. |
@embray - just a quick question (though of course I should really wait for the APE). Will packages that want to use |
@astrofrog As a matter of fact, I was just thinking about that. I could put in some try/excepts that would allow packages to exclude I do intend to address this matter in the APE. |
Also, in the interest of somewhat reducing the number of files at the root of the repo, we could move the |
@embray - ok, great that you were thinking about it too :) At the end of the day I was basically wondering what a set of instructions for affiliated packages would look like, e.g. add this sub-module and these two files, and you're all set. |
Note before merging this PR should be squashed. |
try: | ||
module = self.fspath.pyimport() | ||
# Just ignore searching modules that can't be imported when | ||
# collecting doctests |
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 #2310 is probably fixed by this.
@embray - you mentioned that the PR should be squashed before merging. As indicated in my APE4 comments, I think we should go ahead and merge this over the next day or so if there are no last-minute objections, so maybe now would be a good time to rebase and let travis have one last go at this. |
@embray - do you think it will be possible to finalize this early this coming week? Let me know if there is anything I can do to help re: affiliated packages. |
@embray - now we've merged in astropy-helpers, I think the URL can be updated here too? Did you want to squash before merging? |
Yeah, I'm going to update that URL and do some rebasing. |
…I'm adding my fork of astropy_helpers but will update the submodule to point to https://github.com/astropy/astropy_helpers.git once this is ready to merge into astropy's master. Updating submodule ref
…. Had to change all the various 'setup_package' modules to also astropy_helpers. Seems to work in basic cases. Updating pointer to astropy_helpers
… script in setup.py Update ah_bootstrap copy Update astropy_helpers submodule version Updating the version of ah_bootstrap.py Update the version of astropy_helpers to the latest, including a number of bug fixes
…y_helpers.sphinx for the doc builds. The astropy.sphinx module will still hang around for the time being for backward-compat, but can later be removed.
…' capability Update the call to get_package_info since its interface changed
…portError when trying to import it to look for tests. In particular this is needed to skip modules that require astropy_helpers, like some of the setup_package.py modules. This seems like reasonable-enough behavior anyway--if some actual problem is causing ImportErrors in some modules that will hopefully be picked up by the normal unit tests as well.
…directly from astropy_helpers.
Sorry, made a bit of a mess of things in rebasing this. But I think it's good now. |
Looks good to me! @embray - ready to merge? |
Excellent--merging then. |
Create a separate ``astropy-distutils`` package to contain common infrastructure code for the core and affiliated packages
Great! 🎆 Thanks @embray! |
astropy-distutils
package to contain common infrastructure code for the core and affiliated packagesastropy-helpers
package to contain common infrastructure code for the core and affiliated packages
astropy-helpers
package to contain common infrastructure code for the core and affiliated packages
(This conversation started in astropy/package-template#32, but I will attempt to summarize here)
At the moment, affiliated packages need to import Astropy in order to have access to infrastructure code such as code to help populate the
setup
metadata. This is a bad idea, because packages shouldn't have to import a large package such as Astropy to be able to run thesetup.py
script.@embray summarized it better than I could:
The solution we have converged to in astropy/package-template#32 is to create a separate repository containing the common infrastructure code. Again, to quote @embray:
There are some minor questions, such as:
astropy
(i.e. it would be separate, but share the namespace withastropy
), or whether it should be its own independent package/namespace.Also, we need to think which of the following it makes sense to move to this separate package - i.e. where do we stop? Do we include only what is strictly necessary for
setup.py
? For example:setup_helpers.py
version_helpers.py
utils/release.py
What about the testing framework? Or the configuration framework? (once it's refactored)
Of course, we don't want to do something so drastic before 0.3, but we should do it as soon as possible after 0.3.0 is out so that we have many months to iron out any bugs.