-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
Add astropy to nixpkgs. #26444
Add astropy to nixpkgs. #26444
Conversation
I'm not sure why Travis is failing this. It seems to be more a problem with its nix download path, which I tested and works fine, looks like a networking problem on the server? |
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 modify the commit name so that its according our guidelines.
, numpy }: | ||
|
||
buildPythonPackage rec { | ||
pname = "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.
indentation
inherit pname version; | ||
sha256 = "ed093e033fcbee5a3ec122420c3376f8a80f74663214560727d3defe82170a99"; | ||
}; | ||
doCheck = false; |
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.
If you disable tests, always leave a comment with a motivation.
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.
That was an oversight. Astropy has 9000 tests so feels like you are waiting for the heat death of the universe when checking both python builds. I've re-enabled them. I'll submit the PR when they are 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.
As maintainer its your choice whether or not to enable tests. In any, just leave a comment when you disable them.
sha256 = "ed093e033fcbee5a3ec122420c3376f8a80f74663214560727d3defe82170a99"; | ||
}; | ||
doCheck = false; | ||
buildInputs = [ numpy ]; |
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 suppose it needs numpy
during runtime? Add it to propagatedBuildInputs
.
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've also added python, h5py, and scipy to propagatedBuildInputs.
Pandas and matplotlib have been left out, because I am still having problems getting them to build on Darwin.
meta = { | ||
description = "Astronomy/Astrophysics library for Python"; | ||
homepage = "http://www.astropy.org"; | ||
license = stdenv.lib.licenses.bsd3; |
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.
are you going to be the maintainer of this package?
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.
Yes. I've added myself to maintainers.nix.
description = "Astronomy/Astrophysics library for Python"; | ||
homepage = "http://www.astropy.org"; | ||
license = stdenv.lib.licenses.bsd3; | ||
}; |
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.
indentation
Okay I put the changes in. I haven't enabled tests as for some reason setup.py hangs after failing a few obscure corner cases which I'm not sure about. I need to look into it more. But I commented it, and I'll look into it more when I have time. |
{ lib | ||
, fetchPypi | ||
, stdenv | ||
, python3Packages |
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.
don't pass in the whole package set, instead pass in individual items.
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.
which you've actually done as well
@@ -0,0 +1,34 @@ | |||
{ lib | |||
, fetchPypi | |||
, stdenv |
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.
stdenv isn't used anywhere, just lib
Okay I've cleaned it up. Should be good to go. |
Okay it doesn't look like it failed Travis for any legitimate reason apart from all the dependencies being built, with tests. As each of the dependencies is massive in of itself I think Travis is choking on the enormous amount of tests for each module. |
Pushed 3cb5d52. |
Motivation for this change
I'm an astrophysicist and I usually add this to my python environments manually. Astropy is THE standard in the field and it makes a lot of sense that it is added to the nixpkgs tree.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)