summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorFabian Affolter <fabian@affolter-engineering.ch>2021-05-05 21:56:25 +0200
committerGitHub <noreply@github.com>2021-05-05 21:56:25 +0200
commit37c75aaf3eaa093351ee020c72d4591336b1d8fa (patch)
tree42a075b3571f17243710d2be11c5ccf938cf48c9 /pkgs/development
parentc5173fe20851def75a5676a69a0d09b9d24ae428 (diff)
parent96c4ebd54288a332f0f58c0243bdbbf85cb9c792 (diff)
downloadnixpkgs-37c75aaf3eaa093351ee020c72d4591336b1d8fa.tar
nixpkgs-37c75aaf3eaa093351ee020c72d4591336b1d8fa.tar.gz
nixpkgs-37c75aaf3eaa093351ee020c72d4591336b1d8fa.tar.bz2
nixpkgs-37c75aaf3eaa093351ee020c72d4591336b1d8fa.tar.lz
nixpkgs-37c75aaf3eaa093351ee020c72d4591336b1d8fa.tar.xz
nixpkgs-37c75aaf3eaa093351ee020c72d4591336b1d8fa.tar.zst
nixpkgs-37c75aaf3eaa093351ee020c72d4591336b1d8fa.zip
Merge pull request #120874 from rmcgibbo/astropy
python3Packages.astropy: unbreak multiple modules
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/python-modules/astropy-healpix/default.nix33
-rw-r--r--pkgs/development/python-modules/glymur/default.nix19
-rw-r--r--pkgs/development/python-modules/pytest-doctestplus/default.nix16
-rw-r--r--pkgs/development/python-modules/radio_beam/default.nix20
-rw-r--r--pkgs/development/python-modules/spectral-cube/default.nix18
-rw-r--r--pkgs/development/python-modules/sunpy/default.nix2
6 files changed, 66 insertions, 42 deletions
diff --git a/pkgs/development/python-modules/astropy-healpix/default.nix b/pkgs/development/python-modules/astropy-healpix/default.nix
index e82faba9758..80ef403b2cc 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; {
diff --git a/pkgs/development/python-modules/glymur/default.nix b/pkgs/development/python-modules/glymur/default.nix
index 9a0b1b09db6..f14245865f5 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";
diff --git a/pkgs/development/python-modules/pytest-doctestplus/default.nix b/pkgs/development/python-modules/pytest-doctestplus/default.nix
index 335846fc342..2b1ab664a13 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";
diff --git a/pkgs/development/python-modules/radio_beam/default.nix b/pkgs/development/python-modules/radio_beam/default.nix
index f1f3200bb7b..58137e3adbd 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 = {
diff --git a/pkgs/development/python-modules/spectral-cube/default.nix b/pkgs/development/python-modules/spectral-cube/default.nix
index d2f79c18348..329b225b576 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";
diff --git a/pkgs/development/python-modules/sunpy/default.nix b/pkgs/development/python-modules/sunpy/default.nix
index 65eb6abb046..2de1e3fd5ff 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