Merge pull request #120874 from rmcgibbo/astropy

python3Packages.astropy: unbreak multiple modules

authored by

Fabian Affolter and committed by
GitHub
37c75aaf c5173fe2

+66 -42
+25 -8
pkgs/development/python-modules/astropy-healpix/default.nix
··· 3 3 , fetchPypi 4 4 , numpy 5 5 , astropy 6 - , astropy-helpers 6 + , astropy-extension-helpers 7 + , setuptools-scm 8 + , pytestCheckHook 9 + , pytest-doctestplus 10 + , hypothesis 7 11 }: 8 12 9 13 buildPythonPackage rec { 10 14 pname = "astropy-healpix"; 11 15 version = "0.6"; 12 16 13 - doCheck = false; # tests require pytest-astropy 14 - 15 17 src = fetchPypi { 16 - inherit pname version; 18 + inherit version; 19 + pname = lib.replaceStrings ["-"] ["_"] pname; 17 20 sha256 = "409a6621c383641456c074f0f0350a24a4a58e910eaeef14e9bbce3e00ad6690"; 18 21 }; 19 22 20 - propagatedBuildInputs = [ numpy astropy astropy-helpers ]; 23 + nativeBuildInputs = [ 24 + astropy-extension-helpers 25 + setuptools-scm 26 + ]; 27 + 28 + propagatedBuildInputs = [ 29 + numpy 30 + astropy 31 + ]; 21 32 22 - # Disable automatic update of the astropy-helper module 23 - postPatch = '' 24 - substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False" 33 + checkInputs = [ 34 + pytestCheckHook 35 + pytest-doctestplus 36 + hypothesis 37 + ]; 38 + 39 + # tests must be run in the build directory 40 + preCheck = '' 41 + cd build/lib* 25 42 ''; 26 43 27 44 meta = with lib; {
+12 -7
pkgs/development/python-modules/glymur/default.nix
··· 2 2 , buildPythonPackage 3 3 , fetchFromGitHub 4 4 , numpy 5 - , python 6 5 , scikitimage 7 6 , openjpeg 8 7 , procps 8 + , pytestCheckHook 9 9 , contextlib2 10 10 , mock 11 11 , importlib-resources ··· 14 14 15 15 buildPythonPackage rec { 16 16 pname = "glymur"; 17 - version = "0.8.18"; 17 + version = "0.9.3"; 18 18 19 19 src = fetchFromGitHub { 20 20 owner = "quintusdias"; 21 21 repo = pname; 22 22 rev = "v${version}"; 23 - sha256 = "1zbghzw1q4fljb019lsrhka9xrnn4425qnxrjbmbv7dssgkkywd7"; 23 + sha256 = "1xlpax56qg5qqh0s19xidgvv2483sc684zj7rh6zw1m1z9m37drr"; 24 24 }; 25 25 26 26 propagatedBuildInputs = [ ··· 30 30 checkInputs = [ 31 31 scikitimage 32 32 procps 33 + pytestCheckHook 33 34 ]; 34 35 35 36 postConfigure = '' 36 37 substituteInPlace glymur/config.py \ 37 - --replace "path = read_config_file(libname)" "path = '${openjpeg}/lib' + libname + ${if stdenv.isDarwin then "'.dylib'" else "'.so'"}" 38 + --replace "path = read_config_file(libname)" "path = '${openjpeg}/lib/lib' + libname + ${if stdenv.isDarwin then "'.dylib'" else "'.so'"}" 38 39 ''; 39 40 40 - checkPhase = '' 41 - ${python.interpreter} -m unittest discover 42 - ''; 41 + disabledTestPaths = [ 42 + # this test involves glymur's different ways of finding the openjpeg path on 43 + # fsh systems by reading an .rc file and such, and is obviated by the patch 44 + # in postConfigure 45 + "tests/test_config.py" 46 + ]; 47 + 43 48 44 49 meta = with lib; { 45 50 description = "Tools for accessing JPEG2000 files";
+9 -7
pkgs/development/python-modules/pytest-doctestplus/default.nix
··· 4 4 , isPy27 5 5 , six 6 6 , pytest 7 + , pytestCheckHook 7 8 , numpy 9 + , setuptools_scm 8 10 }: 9 11 10 12 buildPythonPackage rec { ··· 17 19 sha256 = "6fe747418461d7b202824a3486ba8f4fa17a9bd0b1eddc743ba1d6d87f03391a"; 18 20 }; 19 21 20 - buildInputs = [ pytest ]; 22 + nativeBuildInputs = [ 23 + setuptools_scm 24 + ]; 25 + buildInputs = [ 26 + pytest 27 + ]; 21 28 22 29 propagatedBuildInputs = [ 23 30 six ··· 25 32 ]; 26 33 27 34 checkInputs = [ 28 - pytest 35 + pytestCheckHook 29 36 ]; 30 - 31 - # check_distribution incorrectly pulls pytest version 32 - checkPhase = '' 33 - pytest -k 'not check_distribution' 34 - ''; 35 37 36 38 meta = with lib; { 37 39 description = "Pytest plugin with advanced doctest features";
+6 -14
pkgs/development/python-modules/radio_beam/default.nix
··· 2 2 , fetchPypi 3 3 , buildPythonPackage 4 4 , astropy 5 - , pytest 6 - , pytest-astropy 7 - , astropy-helpers 5 + , pytestCheckHook 6 + , pytest-doctestplus 8 7 , scipy 9 8 }: 10 9 ··· 13 12 version = "0.3.3"; 14 13 15 14 src = fetchPypi { 16 - inherit pname version; 15 + inherit version; 16 + pname = "radio-beam"; 17 17 sha256 = "e34902d91713ccab9f450b9d3e82317e292cf46a30bd42f9ad3c9a0519fcddcd"; 18 18 }; 19 19 20 20 propagatedBuildInputs = [ astropy ]; 21 21 22 - nativeBuildInputs = [ astropy-helpers ]; 23 - 24 - # Disable automatic update of the astropy-helper module 25 - postPatch = '' 26 - substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False" 27 - ''; 28 - 29 - checkInputs = [ pytest pytest-astropy scipy ]; 22 + checkInputs = [ pytestCheckHook pytest-doctestplus scipy ]; 30 23 31 24 # Tests must be run in the build directory 32 - checkPhase = '' 25 + preCheck = '' 33 26 cd build/lib 34 - pytest 35 27 ''; 36 28 37 29 meta = {
+12 -6
pkgs/development/python-modules/spectral-cube/default.nix
··· 1 1 { lib 2 2 , fetchPypi 3 + , fetchpatch 3 4 , buildPythonPackage 4 5 , aplpy 5 6 , joblib 6 7 , astropy 7 8 , radio_beam 8 - , pytest 9 + , pytestCheckHook 9 10 , pytest-astropy 10 11 , astropy-helpers 11 12 }: ··· 20 21 sha256 = "17zisr26syfb8kn89xj17lrdycm0hsmy5yp5zrn236wgd8rjriki"; 21 22 }; 22 23 24 + patches = [ 25 + # Fix compatibility with radio_beam >= 0.3.3. Will be included 26 + # in the next release of spectral cube > 0.5.0 27 + (fetchpatch { 28 + url = "https://github.com/radio-astro-tools/spectral-cube/commit/bbe4295ebef7dfa6fe4474275a29acd6cb0cb544.patch"; 29 + sha256 = "1qddfm3364kc34yf6wd9nd6rxh4qc2v5pqilvz9adwb4a50z28bf"; 30 + }) 31 + ]; 32 + 23 33 nativeBuildInputs = [ astropy-helpers ]; 24 34 propagatedBuildInputs = [ astropy radio_beam joblib ]; 25 - checkInputs = [ aplpy pytest pytest-astropy ]; 26 - 27 - checkPhase = '' 28 - pytest spectral_cube 29 - ''; 35 + checkInputs = [ pytestCheckHook aplpy pytest-astropy ]; 30 36 31 37 meta = { 32 38 description = "Library for reading and analyzing astrophysical spectral data cubes";
+2
pkgs/development/python-modules/sunpy/default.nix
··· 11 11 , beautifulsoup4 12 12 , drms 13 13 , glymur 14 + , h5netcdf 14 15 , hypothesis 15 16 , matplotlib 16 17 , numpy ··· 50 51 pandas 51 52 astropy 52 53 astropy-helpers 54 + h5netcdf 53 55 parfive 54 56 sqlalchemy 55 57 scikitimage