From 928d3fc2fb2c62d574352a9885bf1a88c6699e1b Mon Sep 17 00:00:00 2001 From: "Robert T. McGibbon" Date: Tue, 27 Apr 2021 09:58:23 -0400 Subject: [PATCH 1/6] python3Packages.pytest-doctestplus: unbreak --- .../pytest-doctestplus/default.nix | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/pytest-doctestplus/default.nix b/pkgs/development/python-modules/pytest-doctestplus/default.nix index 335846fc34255..2b1ab664a1391 100644 --- a/pkgs/development/python-modules/pytest-doctestplus/default.nix +++ b/pkgs/development/python-modules/pytest-doctestplus/default.nix @@ -4,7 +4,9 @@ , isPy27 , six , pytest +, pytestCheckHook , numpy +, setuptools_scm }: buildPythonPackage rec { @@ -17,7 +19,12 @@ buildPythonPackage rec { sha256 = "6fe747418461d7b202824a3486ba8f4fa17a9bd0b1eddc743ba1d6d87f03391a"; }; - buildInputs = [ pytest ]; + nativeBuildInputs = [ + setuptools_scm + ]; + buildInputs = [ + pytest + ]; propagatedBuildInputs = [ six @@ -25,14 +32,9 @@ buildPythonPackage rec { ]; checkInputs = [ - pytest + pytestCheckHook ]; - # check_distribution incorrectly pulls pytest version - checkPhase = '' - pytest -k 'not check_distribution' - ''; - meta = with lib; { description = "Pytest plugin with advanced doctest features"; homepage = "https://astropy.org"; From 8fa0db7b69f69079d574b9fc2116aec05b71e8b5 Mon Sep 17 00:00:00 2001 From: "Robert T. McGibbon" Date: Tue, 27 Apr 2021 09:58:39 -0400 Subject: [PATCH 2/6] python3Packages.astropy-healpix: unbreak --- .../astropy-healpix/default.nix | 33 ++++++++++++++----- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/astropy-healpix/default.nix b/pkgs/development/python-modules/astropy-healpix/default.nix index e82faba97583f..80ef403b2cc02 100644 --- a/pkgs/development/python-modules/astropy-healpix/default.nix +++ b/pkgs/development/python-modules/astropy-healpix/default.nix @@ -3,25 +3,42 @@ , fetchPypi , numpy , astropy -, astropy-helpers +, astropy-extension-helpers +, setuptools-scm +, pytestCheckHook +, pytest-doctestplus +, hypothesis }: buildPythonPackage rec { pname = "astropy-healpix"; version = "0.6"; - doCheck = false; # tests require pytest-astropy - src = fetchPypi { - inherit pname version; + inherit version; + pname = lib.replaceStrings ["-"] ["_"] pname; sha256 = "409a6621c383641456c074f0f0350a24a4a58e910eaeef14e9bbce3e00ad6690"; }; - propagatedBuildInputs = [ numpy astropy astropy-helpers ]; + nativeBuildInputs = [ + astropy-extension-helpers + setuptools-scm + ]; + + propagatedBuildInputs = [ + numpy + astropy + ]; + + checkInputs = [ + pytestCheckHook + pytest-doctestplus + hypothesis + ]; - # Disable automatic update of the astropy-helper module - postPatch = '' - substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False" + # tests must be run in the build directory + preCheck = '' + cd build/lib* ''; meta = with lib; { From df52f5afb104b107d14413cc0ca92eb774d7d284 Mon Sep 17 00:00:00 2001 From: "Robert T. McGibbon" Date: Tue, 27 Apr 2021 10:05:07 -0400 Subject: [PATCH 3/6] python3Packages.radio_beam: unbreak --- .../python-modules/radio_beam/default.nix | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/pkgs/development/python-modules/radio_beam/default.nix b/pkgs/development/python-modules/radio_beam/default.nix index f1f3200bb7b00..58137e3adbdbd 100644 --- a/pkgs/development/python-modules/radio_beam/default.nix +++ b/pkgs/development/python-modules/radio_beam/default.nix @@ -2,9 +2,8 @@ , fetchPypi , buildPythonPackage , astropy -, pytest -, pytest-astropy -, astropy-helpers +, pytestCheckHook +, pytest-doctestplus , scipy }: @@ -13,25 +12,18 @@ buildPythonPackage rec { version = "0.3.3"; src = fetchPypi { - inherit pname version; + inherit version; + pname = "radio-beam"; sha256 = "e34902d91713ccab9f450b9d3e82317e292cf46a30bd42f9ad3c9a0519fcddcd"; }; propagatedBuildInputs = [ astropy ]; - nativeBuildInputs = [ astropy-helpers ]; - - # Disable automatic update of the astropy-helper module - postPatch = '' - substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False" - ''; - - checkInputs = [ pytest pytest-astropy scipy ]; + checkInputs = [ pytestCheckHook pytest-doctestplus scipy ]; # Tests must be run in the build directory - checkPhase = '' + preCheck = '' cd build/lib - pytest ''; meta = { From 3a349a7ad395969bc6500f5fe849374867c03137 Mon Sep 17 00:00:00 2001 From: "Robert T. McGibbon" Date: Tue, 27 Apr 2021 12:30:31 -0400 Subject: [PATCH 4/6] python3Packages.glymur: 0.8.18 -> 0.9.3 --- .../python-modules/glymur/default.nix | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/glymur/default.nix b/pkgs/development/python-modules/glymur/default.nix index 9a0b1b09db68f..f14245865f591 100644 --- a/pkgs/development/python-modules/glymur/default.nix +++ b/pkgs/development/python-modules/glymur/default.nix @@ -2,10 +2,10 @@ , buildPythonPackage , fetchFromGitHub , numpy -, python , scikitimage , openjpeg , procps +, pytestCheckHook , contextlib2 , mock , importlib-resources @@ -14,13 +14,13 @@ buildPythonPackage rec { pname = "glymur"; - version = "0.8.18"; + version = "0.9.3"; src = fetchFromGitHub { owner = "quintusdias"; repo = pname; rev = "v${version}"; - sha256 = "1zbghzw1q4fljb019lsrhka9xrnn4425qnxrjbmbv7dssgkkywd7"; + sha256 = "1xlpax56qg5qqh0s19xidgvv2483sc684zj7rh6zw1m1z9m37drr"; }; propagatedBuildInputs = [ @@ -30,16 +30,21 @@ buildPythonPackage rec { checkInputs = [ scikitimage procps + pytestCheckHook ]; postConfigure = '' substituteInPlace glymur/config.py \ - --replace "path = read_config_file(libname)" "path = '${openjpeg}/lib' + libname + ${if stdenv.isDarwin then "'.dylib'" else "'.so'"}" + --replace "path = read_config_file(libname)" "path = '${openjpeg}/lib/lib' + libname + ${if stdenv.isDarwin then "'.dylib'" else "'.so'"}" ''; - checkPhase = '' - ${python.interpreter} -m unittest discover - ''; + disabledTestPaths = [ + # this test involves glymur's different ways of finding the openjpeg path on + # fsh systems by reading an .rc file and such, and is obviated by the patch + # in postConfigure + "tests/test_config.py" + ]; + meta = with lib; { description = "Tools for accessing JPEG2000 files"; From 305343359b78890bab0f307b271f89a2de7d766e Mon Sep 17 00:00:00 2001 From: "Robert T. McGibbon" Date: Tue, 27 Apr 2021 12:30:53 -0400 Subject: [PATCH 5/6] python3Packages.sunpy: add missing dependency --- pkgs/development/python-modules/sunpy/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/python-modules/sunpy/default.nix b/pkgs/development/python-modules/sunpy/default.nix index 65eb6abb04682..2de1e3fd5ffa0 100644 --- a/pkgs/development/python-modules/sunpy/default.nix +++ b/pkgs/development/python-modules/sunpy/default.nix @@ -11,6 +11,7 @@ , beautifulsoup4 , drms , glymur +, h5netcdf , hypothesis , matplotlib , numpy @@ -50,6 +51,7 @@ buildPythonPackage rec { pandas astropy astropy-helpers + h5netcdf parfive sqlalchemy scikitimage From 96c4ebd54288a332f0f58c0243bdbbf85cb9c792 Mon Sep 17 00:00:00 2001 From: "Robert T. McGibbon" Date: Tue, 27 Apr 2021 13:30:46 -0400 Subject: [PATCH 6/6] python3Packages.spectral-cube: add patch for radio_beam >= 0.3.3 --- .../python-modules/spectral-cube/default.nix | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/spectral-cube/default.nix b/pkgs/development/python-modules/spectral-cube/default.nix index d2f79c183480a..329b225b57694 100644 --- a/pkgs/development/python-modules/spectral-cube/default.nix +++ b/pkgs/development/python-modules/spectral-cube/default.nix @@ -1,11 +1,12 @@ { lib , fetchPypi +, fetchpatch , buildPythonPackage , aplpy , joblib , astropy , radio_beam -, pytest +, pytestCheckHook , pytest-astropy , astropy-helpers }: @@ -20,13 +21,18 @@ buildPythonPackage rec { sha256 = "17zisr26syfb8kn89xj17lrdycm0hsmy5yp5zrn236wgd8rjriki"; }; + patches = [ + # Fix compatibility with radio_beam >= 0.3.3. Will be included + # in the next release of spectral cube > 0.5.0 + (fetchpatch { + url = "https://github.com/radio-astro-tools/spectral-cube/commit/bbe4295ebef7dfa6fe4474275a29acd6cb0cb544.patch"; + sha256 = "1qddfm3364kc34yf6wd9nd6rxh4qc2v5pqilvz9adwb4a50z28bf"; + }) + ]; + nativeBuildInputs = [ astropy-helpers ]; propagatedBuildInputs = [ astropy radio_beam joblib ]; - checkInputs = [ aplpy pytest pytest-astropy ]; - - checkPhase = '' - pytest spectral_cube - ''; + checkInputs = [ pytestCheckHook aplpy pytest-astropy ]; meta = { description = "Library for reading and analyzing astrophysical spectral data cubes";