git.iko.soy/typeable/nixpkgs
on master help sign in
pythonPackages.astropy: add checkPhase
commitee6c007fccc0e8ed1768dcf317bdd33aa4deea5b authorSébastien Maret <sebastien.maret@icloud.com> dateTue 23 Jul 2019, 11:50 (7 years ago) parent2dabd05
1 file changed+23−4
pkgs/development/python-modules/astropy/default.nix+23−4
pkgs/development/python-modules/astropy/default.nix+23−4
@@ -3,7 +3,10 @@
33, buildPythonPackage
44, isPy3k
55, numpy
6−, pytest }:
6+, pytest
7+, pytest-astropy
8+, astropy-helpers
9+}:
710
811buildPythonPackage rec {
912 pname = "astropy";
@@ -11,14 +14,30 @@ buildPythonPackage rec {
1114
1215 disabled = !isPy3k; # according to setup.py
1316
14− doCheck = false; #Some tests are failing. More importantly setup.py hangs on completion. Needs fixing with a proper shellhook.
15−
1617 src = fetchPypi {
1718 inherit pname version;
1819 sha256 = "706c0457789c78285e5464a5a336f5f0b058d646d60f4e5f5ba1f7d5bf424b28";
1920 };
2021
21− propagatedBuildInputs = [ pytest numpy ]; # yes it really has pytest in install_requires
22+ nativeBuildInputs = [ astropy-helpers ];
23+
24+ propagatedBuildInputs = [ numpy pytest ]; # yes it really has pytest in install_requires
25+
26+ checkInputs = [ pytest pytest-astropy ];
27+
28+ # Disable automatic update of the astropy-helper module
29+ postPatch = ''
30+ substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
31+ '';
32+
33+ # Tests must be run from the build directory. astropy/samp tests
34+ # require a network connection, so we ignore them. For some reason
35+ # pytest --ignore does not work, so we delete the tests instead.
36+ checkPhase = ''
37+ cd build/lib.*
38+ rm -f astropy/samp/tests/*
39+ pytest
40+ '';
2241
2342 meta = {
2443 description = "Astronomy/Astrophysics library for Python";