Conversation
…changes in Astropy core.
|
This is now a little better, because I'm leaning towards a solution that involves simply not using the core package to do package discovery. Most affiliated packages are going to be a lot simpler than the core package, and it should be easy enough to define |
|
I'm glad you brought this up-- @wkerzendorf brought this to my attention last week, but I didn't have any time to say anything about it. I don't think we should bother implementing this pull request except maybe as a short term fix but really this isn't the right way to go about it--as you wrote in the PR it won't do the right things. I actually didn't realize that the setup.py for affiliated packages tries to But I don't think affiliated packages should have to I have two solutions in mind, each with plusses and minuses (and there might be a middle ground between them too). In either case, I think the first step needs to be to move The first, and my personal preference especially from the view of affiliated packages (though also potentially beneficial for the main Astropy package) is to create a separate subproject, say, "astropy-distutils" that contains all the utilities used in setting up Astropy or affiliated packages using our framework. This could potentially include all the test stuff too. This would be a much smaller and simpler package than Astropy itself, and so can easily be used with the I have some experience with this: STScI has a package I wrote called "stsci-distutils" that serves the same purpose: a common collection of build and installation tools shared by all our packages. This works rather well. A particular advantage of this is that in many cases, if a tweak is needed to the build infrastructure (say, for example, Apple changes their default C compiler again) support for that can be added simply by releasing a new "astropy-distutils", rather than having to release a whole new astropy to fix builds on the platform in question. Of course, this won't always be possible, but it would work in many cases. Another possibility would be to do something involving sub-modules, but I haven't fully explored that option yet. The middle ground might be to create a separate "astropy-distutils" distribution as already suggested. But we could also include a copy of it in the main Astropy repo as a submodule, and affiliated packages may do the same, if desired. That way when doing a git clone you would also be able to get the build tools easily without much additional effort (but "astropy-distutils" should still be included in Anyways, regardless of where we go with this the main point has to be that there should not be an |
|
@embray - thanks for your reply! I had independently reached a similar conclusion today about having a separate repository for the setup stuff. However, I'm not convinced by using My preferred solution is to have it in a separate repo, and use submodules as you suggest. This actually makes it even easier for any affiliated packages to update than currently if there are any changes in the So just to be clear, +1 to a |
I don't really know what you mean by that. If there were a separate In other words, I don't know what you mean by "vanilla python" or why that's relevant. |
|
By the way, perhaps I should clarify--while the fact that Near the top of setup.py just write:
|
|
@embray - when you run Just saw your latest comment - I think I see what you mean now. I kind of link the idea of making an |
|
hey guys, i'm against an |
|
@embray - I don't understand your comment about making astropy a namespace package? |
|
(sorry for the slow comment edits - writing this from a bus using tethering on my phone ;) |
|
@astrofrog I put a pip requirements file into my radiative transfer code (github.com/wkerzendorf/tardis) and it didn't seem to help install astropy beforehands. As far as I did understand pip, you need to specify a requirements file on disk before installing. |
|
@wkerzendorf - the original issue I'm worries about here is different though - I'm saying that if you have: in a |
|
@astrofrog I see, thx. |
|
I think @embray is saying we make On the general issue, I'm also +1 on the separate package solution, but with some caveats/concerns:
OTOH, as @wkerzendorf points out, this may be useful for people other than astropy and affiliated packages. But if so, all of my concerns above become more serious because we can't tie any of them directly to astropy. So in that case, someone will have to take charge of the package and ensure it continues forward. I'm not sure that's a good use of our resources right now. |
|
@eteq @embray - I would much prefer that this would simply be included in astropy and affiliated packages as a submodule - it basically answers all of @eteq's concerns about release cycle about namespace. There is no release cycle, we simply keep the astropy package up to date with the latest setup tools version, and affiliated packages can update the submodule when needed. Or am I missing an obvious issue with this solution? |
|
First of all I'd like to note that I think that bringing up pip specifically in this discussion is a distraction. The more fundamental problem can be stated as such:
So the solution I'm proposing is to separate the setup features out into a smallish separate package that can easily be slurped in by adding it to I like what @wkerzendorf is saying about a more general setup-helpers package for more generic scientific projects, but at the moment what we currently have still contains a number of Astropy-specific bits, especially where our configuration system is concerned, and other bits related to affiliated packages. But I agree that it's possible some of this could be refactored and generalized, but I might do that as a separate project later. Much of that point also applies to the package-template in general. So I'm on board with the whole thing in principle, but I don't think it should be the "first step". @eteq is correct about my motivation behind making it a namespace package, but is also correct that that probably can't work with all the I'm a little concerned about the submodule idea, but my concerns may be due to lack of experience with submodules. Mainly, can we set up submodules so that when one does a As for @eteq's concern about having to manage a separate release: I think it's a valid concern, but I don't think it's that big a deal. This would be a very simple package to make releases for, compared to Astropy itself. And to reiterate a point I made earlier, it has the advantage that we can address platform-specific build/installation issues simply by releasing a new |
|
@embray - I'm on board with what you are saying, and at the end of the day, if a separate package without submodules works, then I'm fine with that solution. When you say it would work with Just a couple of notes about submodules - when you git clone you then need to run: However, other projects do sometimes use them (e.g. IPython) and those packages can be pip installed, so there are solutions. However, using a separate package makes it even easier for affiliated packages because they don't need to worry about submodules. So at the end of the day I withdraw my suggestion and +1 a separate package. How do we proceed? Shall we let the list know we plan to try this in case there are any objections? Or shall we go ahead and do this and open a pull request with the setup code taken out, and a new repo with the setup code, then ask for comments? |
|
I have moved the discussion to an issue in the core package: I will close this issue since the pull request won't be useful. |
|
Just some follow-on comments in response to your last comment: Just because IPython "works" with pip doesn't mean you can do a I also wouldn't be against, if not slightly in favor of a hybrid approach, whereby we have a separate package for install utils, but we can also include the the master branch of that as a subpackage in Astropy, since I would always want to test against the latest dev version anyways. |
This is a possible fix for #31 (it also includes #30 for now). The basic problem is that we should be able to do:
in an affiliated package, and have it work if Astropy is not installed. With the current attached solution, things are still not quite right because in the egg-info directory, the SOURCES.txt file doesn't contain the full list of files, and the PKG-INFO file doesn't have quite the right version (the git string is not present). Either we decide to not care about this, or it seems we are going to have to include a copy of
setup_helpersandversion_helpersin affiliated packages (unless anyone can think of a better solution).There's a third option, which is to not do quite so much for affiliated packages from the core package. For several simple packages I've been writing, I don't really need the sophisticated functions in Astropy to give me the list of sub-packages, data, etc. so we could trim down on all the 'magic' stuff and only really use Astropy to import the custom commands (
test,build_sphinx, the custombuildandinstall, etc.). But for package discovery, we leave that up to the developer, and they shouldn't use anything from Astropy core.