Skip to content
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

Closed
wants to merge 1 commit into from
Closed

Add astropy to nixpkgs. #26444

wants to merge 1 commit into from

Conversation

KentJames
Copy link
Contributor

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
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

Sorry, something went wrong.

@KentJames KentJames changed the title Added astropy to nixpkgs. Add astropy to nixpkgs. Jun 7, 2017
@KentJames
Copy link
Contributor Author

KentJames commented Jun 7, 2017

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?

@KentJames KentJames closed this Jun 7, 2017
@KentJames KentJames reopened this Jun 7, 2017
Copy link
Member

@FRidh FRidh left a 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";
Copy link
Member

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;
Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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 ];
Copy link
Member

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.

Copy link
Contributor Author

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;
Copy link
Member

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?

Copy link
Contributor Author

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;
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indentation

@KentJames
Copy link
Contributor Author

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
Copy link
Member

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.

Copy link
Member

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
Copy link
Member

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

@KentJames
Copy link
Contributor Author

Okay I've cleaned it up. Should be good to go.

@KentJames
Copy link
Contributor Author

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.

@FRidh
Copy link
Member

FRidh commented Jun 8, 2017

Pushed 3cb5d52.

@FRidh FRidh closed this Jun 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants