Merge pull request #120874 from rmcgibbo/astropy

python3Packages.astropy: unbreak multiple modules
This commit is contained in:
Fabian Affolter 2021-05-05 21:56:25 +02:00 committed by GitHub
commit 37c75aaf3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 66 additions and 42 deletions

View file

@ -3,25 +3,42 @@
, fetchPypi , fetchPypi
, numpy , numpy
, astropy , astropy
, astropy-helpers , astropy-extension-helpers
, setuptools-scm
, pytestCheckHook
, pytest-doctestplus
, hypothesis
}: }:
buildPythonPackage rec { buildPythonPackage rec {
pname = "astropy-healpix"; pname = "astropy-healpix";
version = "0.6"; version = "0.6";
doCheck = false; # tests require pytest-astropy
src = fetchPypi { src = fetchPypi {
inherit pname version; inherit version;
pname = lib.replaceStrings ["-"] ["_"] pname;
sha256 = "409a6621c383641456c074f0f0350a24a4a58e910eaeef14e9bbce3e00ad6690"; sha256 = "409a6621c383641456c074f0f0350a24a4a58e910eaeef14e9bbce3e00ad6690";
}; };
propagatedBuildInputs = [ numpy astropy astropy-helpers ]; nativeBuildInputs = [
astropy-extension-helpers
setuptools-scm
];
# Disable automatic update of the astropy-helper module propagatedBuildInputs = [
postPatch = '' numpy
substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False" astropy
];
checkInputs = [
pytestCheckHook
pytest-doctestplus
hypothesis
];
# tests must be run in the build directory
preCheck = ''
cd build/lib*
''; '';
meta = with lib; { meta = with lib; {

View file

@ -2,10 +2,10 @@
, buildPythonPackage , buildPythonPackage
, fetchFromGitHub , fetchFromGitHub
, numpy , numpy
, python
, scikitimage , scikitimage
, openjpeg , openjpeg
, procps , procps
, pytestCheckHook
, contextlib2 , contextlib2
, mock , mock
, importlib-resources , importlib-resources
@ -14,13 +14,13 @@
buildPythonPackage rec { buildPythonPackage rec {
pname = "glymur"; pname = "glymur";
version = "0.8.18"; version = "0.9.3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "quintusdias"; owner = "quintusdias";
repo = pname; repo = pname;
rev = "v${version}"; rev = "v${version}";
sha256 = "1zbghzw1q4fljb019lsrhka9xrnn4425qnxrjbmbv7dssgkkywd7"; sha256 = "1xlpax56qg5qqh0s19xidgvv2483sc684zj7rh6zw1m1z9m37drr";
}; };
propagatedBuildInputs = [ propagatedBuildInputs = [
@ -30,16 +30,21 @@ buildPythonPackage rec {
checkInputs = [ checkInputs = [
scikitimage scikitimage
procps procps
pytestCheckHook
]; ];
postConfigure = '' postConfigure = ''
substituteInPlace glymur/config.py \ 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 = '' disabledTestPaths = [
${python.interpreter} -m unittest discover # 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; { meta = with lib; {
description = "Tools for accessing JPEG2000 files"; description = "Tools for accessing JPEG2000 files";

View file

@ -4,7 +4,9 @@
, isPy27 , isPy27
, six , six
, pytest , pytest
, pytestCheckHook
, numpy , numpy
, setuptools_scm
}: }:
buildPythonPackage rec { buildPythonPackage rec {
@ -17,7 +19,12 @@ buildPythonPackage rec {
sha256 = "6fe747418461d7b202824a3486ba8f4fa17a9bd0b1eddc743ba1d6d87f03391a"; sha256 = "6fe747418461d7b202824a3486ba8f4fa17a9bd0b1eddc743ba1d6d87f03391a";
}; };
buildInputs = [ pytest ]; nativeBuildInputs = [
setuptools_scm
];
buildInputs = [
pytest
];
propagatedBuildInputs = [ propagatedBuildInputs = [
six six
@ -25,14 +32,9 @@ buildPythonPackage rec {
]; ];
checkInputs = [ checkInputs = [
pytest pytestCheckHook
]; ];
# check_distribution incorrectly pulls pytest version
checkPhase = ''
pytest -k 'not check_distribution'
'';
meta = with lib; { meta = with lib; {
description = "Pytest plugin with advanced doctest features"; description = "Pytest plugin with advanced doctest features";
homepage = "https://astropy.org"; homepage = "https://astropy.org";

View file

@ -2,9 +2,8 @@
, fetchPypi , fetchPypi
, buildPythonPackage , buildPythonPackage
, astropy , astropy
, pytest , pytestCheckHook
, pytest-astropy , pytest-doctestplus
, astropy-helpers
, scipy , scipy
}: }:
@ -13,25 +12,18 @@ buildPythonPackage rec {
version = "0.3.3"; version = "0.3.3";
src = fetchPypi { src = fetchPypi {
inherit pname version; inherit version;
pname = "radio-beam";
sha256 = "e34902d91713ccab9f450b9d3e82317e292cf46a30bd42f9ad3c9a0519fcddcd"; sha256 = "e34902d91713ccab9f450b9d3e82317e292cf46a30bd42f9ad3c9a0519fcddcd";
}; };
propagatedBuildInputs = [ astropy ]; propagatedBuildInputs = [ astropy ];
nativeBuildInputs = [ astropy-helpers ]; checkInputs = [ pytestCheckHook pytest-doctestplus scipy ];
# Disable automatic update of the astropy-helper module
postPatch = ''
substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
'';
checkInputs = [ pytest pytest-astropy scipy ];
# Tests must be run in the build directory # Tests must be run in the build directory
checkPhase = '' preCheck = ''
cd build/lib cd build/lib
pytest
''; '';
meta = { meta = {

View file

@ -1,11 +1,12 @@
{ lib { lib
, fetchPypi , fetchPypi
, fetchpatch
, buildPythonPackage , buildPythonPackage
, aplpy , aplpy
, joblib , joblib
, astropy , astropy
, radio_beam , radio_beam
, pytest , pytestCheckHook
, pytest-astropy , pytest-astropy
, astropy-helpers , astropy-helpers
}: }:
@ -20,13 +21,18 @@ buildPythonPackage rec {
sha256 = "17zisr26syfb8kn89xj17lrdycm0hsmy5yp5zrn236wgd8rjriki"; 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 ]; nativeBuildInputs = [ astropy-helpers ];
propagatedBuildInputs = [ astropy radio_beam joblib ]; propagatedBuildInputs = [ astropy radio_beam joblib ];
checkInputs = [ aplpy pytest pytest-astropy ]; checkInputs = [ pytestCheckHook aplpy pytest-astropy ];
checkPhase = ''
pytest spectral_cube
'';
meta = { meta = {
description = "Library for reading and analyzing astrophysical spectral data cubes"; description = "Library for reading and analyzing astrophysical spectral data cubes";

View file

@ -11,6 +11,7 @@
, beautifulsoup4 , beautifulsoup4
, drms , drms
, glymur , glymur
, h5netcdf
, hypothesis , hypothesis
, matplotlib , matplotlib
, numpy , numpy
@ -50,6 +51,7 @@ buildPythonPackage rec {
pandas pandas
astropy astropy
astropy-helpers astropy-helpers
h5netcdf
parfive parfive
sqlalchemy sqlalchemy
scikitimage scikitimage