about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJaakko Luttinen <jaakko.luttinen@iki.fi>2019-03-01 21:05:35 +0200
committerRobert Schütz <rschuetz17@gmail.com>2019-03-01 20:05:35 +0100
commiteef63417d46c2b093ecce0bf07411a2ae0bbbb1e (patch)
tree59355560a3184881aa4c043b091f5c17469038c6
parentef5a166a9d4ab83d481bbb50c62888e668f71f40 (diff)
downloadnixlib-eef63417d46c2b093ecce0bf07411a2ae0bbbb1e.tar
nixlib-eef63417d46c2b093ecce0bf07411a2ae0bbbb1e.tar.gz
nixlib-eef63417d46c2b093ecce0bf07411a2ae0bbbb1e.tar.bz2
nixlib-eef63417d46c2b093ecce0bf07411a2ae0bbbb1e.tar.lz
nixlib-eef63417d46c2b093ecce0bf07411a2ae0bbbb1e.tar.xz
nixlib-eef63417d46c2b093ecce0bf07411a2ae0bbbb1e.tar.zst
nixlib-eef63417d46c2b093ecce0bf07411a2ae0bbbb1e.zip
pythonPackages.pvlib: enable tests (#56301)
-rw-r--r--pkgs/development/python-modules/pvlib/default.nix26
1 files changed, 18 insertions, 8 deletions
diff --git a/pkgs/development/python-modules/pvlib/default.nix b/pkgs/development/python-modules/pvlib/default.nix
index 8142f0acc615..91af07b49be3 100644
--- a/pkgs/development/python-modules/pvlib/default.nix
+++ b/pkgs/development/python-modules/pvlib/default.nix
@@ -1,20 +1,30 @@
-{ stdenv, buildPythonPackage, fetchPypi, numpy, pandas, pytz, six, pytest }:
+{ stdenv, buildPythonPackage, fetchFromGitHub, numpy, pandas, pytz, six
+, pytest, mock, pytest-mock }:
 
 buildPythonPackage rec {
   pname = "pvlib";
   version = "0.6.1";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "56e70747add2e50846dd8bbef9a4735e82c1224ce630d1db7590b96bd59dd3f7";
+  # Use GitHub because PyPI release tarball doesn't contain the tests. See:
+  # https://github.com/pvlib/pvlib-python/issues/473
+  src = fetchFromGitHub{
+    owner = "pvlib";
+    repo = "pvlib-python";
+    rev = "v${version}";
+    sha256 = "17h7vz9s829qxnl4byr8458gzgiismrbrn5gl0klhfhwvc5kkdfh";
   };
 
-  checkInputs = [ pytest ];
+  checkInputs = [ pytest mock pytest-mock ];
   propagatedBuildInputs = [ numpy pandas pytz six ];
 
-  # Currently, the PyPI tarball doesn't contain the tests. When that has been
-  # fixed, enable testing. See: https://github.com/pvlib/pvlib-python/issues/473
-  doCheck = false;
+  # Skip a few tests that try to access some URLs
+  checkPhase = ''
+    runHook preCheck
+    pushd pvlib/test
+    pytest . -k "not test_read_srml_dt_index and not test_read_srml_month_from_solardata"
+    popd
+    runHook postCheck
+  '';
 
   meta = with stdenv.lib; {
     homepage = http://pvlib-python.readthedocs.io;