@@ -1,20 +1,30 @@
1−{ stdenv, buildPythonPackage, fetchPypi, numpy, pandas, pytz, six, pytest }:
1+{ stdenv, buildPythonPackage, fetchFromGitHub, numpy, pandas, pytz, six
2+, pytest, mock, pytest-mock }:
23
34buildPythonPackage rec {
45 pname = "pvlib";
56 version = "0.6.1";
67
7− src = fetchPypi {
8− inherit pname version;
9− sha256 = "56e70747add2e50846dd8bbef9a4735e82c1224ce630d1db7590b96bd59dd3f7";
8+ # Use GitHub because PyPI release tarball doesn't contain the tests. See:
9+ # https://github.com/pvlib/pvlib-python/issues/473
10+ src = fetchFromGitHub{
11+ owner = "pvlib";
12+ repo = "pvlib-python";
13+ rev = "v${version}";
14+ sha256 = "17h7vz9s829qxnl4byr8458gzgiismrbrn5gl0klhfhwvc5kkdfh";
1015 };
1116
12− checkInputs = [ pytest ];
17+ checkInputs = [ pytest mock pytest-mock ];
1318 propagatedBuildInputs = [ numpy pandas pytz six ];
1419
15− # Currently, the PyPI tarball doesn't contain the tests. When that has been
16− # fixed, enable testing. See: https://github.com/pvlib/pvlib-python/issues/473
17− doCheck = false;
20+ # Skip a few tests that try to access some URLs
21+ checkPhase = ''
22+ runHook preCheck
23+ pushd pvlib/test
24+ pytest . -k "not test_read_srml_dt_index and not test_read_srml_month_from_solardata"
25+ popd
26+ runHook postCheck
27+ '';
1828
1929 meta = with stdenv.lib; {
2030 homepage = http://pvlib-python.readthedocs.io;