Merge pull request #107770 from rmcgibbo/astropy

python3Packages.astropy: unbreak
This commit is contained in:
Jörg Thalheim 2020-12-30 12:40:11 +00:00 committed by GitHub
commit c461a5d969
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 180 additions and 126 deletions

View file

@ -1,6 +1,7 @@
{ lib
, buildPythonPackage
, fetchPypi
, fetchpatch
, numpy
, astropy
, astropy-helpers
@ -18,6 +19,7 @@
buildPythonPackage rec {
pname = "aplpy";
version = "2.0.3";
format = "pyproject";
src = fetchPypi {
pname = "APLpy";
@ -25,6 +27,15 @@ buildPythonPackage rec {
sha256 = "239f3d83635ca4251536aeb577df7c60df77fc4d658097b92094719739aec3f3";
};
patches = [ (fetchpatch {
# Can be removed in next release after 2.0.3
url = "https://github.com/aplpy/aplpy/pull/448.patch";
sha256 = "1pnzh7ykjc8hwahzbzyryrzv5a8fddgd1bmzbhagkrn6lmvhhpvq";
excludes = [ "tox.ini" "azure-pipelines.yml" ".circleci/config.yml" "MANIFEST.in" ".gitignore"
"setup.cfg" "appveyor.yml" "readthedocs.yml" "CHANGES.rst" ".gitmodules" ".travis.yml" "astropy_helpers" ];
})
];
propagatedBuildInputs = [
numpy
astropy
@ -38,18 +49,10 @@ buildPythonPackage rec {
];
nativeBuildInputs = [ astropy-helpers ];
checkInputs = [ pytest pytest-astropy ];
# 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
checkPhase = ''
cd build/lib
pytest
OPENMP_EXPECTED=0 pytest aplpy
'';
meta = with lib; {

View file

@ -17,18 +17,13 @@ buildPythonPackage rec {
pname = "asdf";
version = "2.7.1";
disabled = isPy27;
format = "pyproject";
src = fetchPypi {
inherit pname version;
sha256 = "4ba2e31cb24b974a10dfae3edee23db2e6bea2d00608604d062366aa3af6e81a";
};
postPatch = ''
substituteInPlace setup.cfg \
--replace "semantic_version>=2.3.1,<=2.6.0" "semantic_version>=2.3.1" \
--replace "doctest_plus = enabled" ""
'';
checkInputs = [
pytest-astropy
astropy
@ -45,7 +40,7 @@ buildPythonPackage rec {
];
checkPhase = ''
pytest
PY_IGNORE_IMPORTMISMATCH=1 pytest
'';
meta = with lib; {

View file

@ -0,0 +1,31 @@
{ lib
, buildPythonPackage
, fetchPypi
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "extension-helpers";
version = "0.1";
format = "pyproject";
src = fetchPypi {
inherit pname version;
sha256 = "10iqjzmya2h4sk765dlm1pbqypwlqyh8rw59a5m9i63d3klnz2mc";
};
patches = [ ./permissions.patch ];
checkInputs = [ pytestCheckHook ];
pythonImportsCheck = [
"extension_helpers"
];
meta = with lib; {
description = "Utilities for building and installing packages in the Astropy ecosystem";
homepage = "https://github.com/astropy/extension-helpers";
license = licenses.bsd3;
maintainers = [ maintainers.rmcgibbo ];
};
}

View file

@ -0,0 +1,20 @@
diff --git a/extension_helpers/_setup_helpers.py b/extension_helpers/_setup_helpers.py
index ec3e547..e2419f7 100644
--- a/extension_helpers/_setup_helpers.py
+++ b/extension_helpers/_setup_helpers.py
@@ -79,8 +79,13 @@ def get_extensions(srcdir='.'):
if len(ext_modules) > 0:
main_package_dir = min(packages, key=len)
src_path = os.path.join(os.path.dirname(__file__), 'src')
- shutil.copy(os.path.join(src_path, 'compiler.c'),
- os.path.join(srcdir, main_package_dir, '_compiler.c'))
+ a = os.path.join(src_path, 'compiler.c')
+ b = os.path.join(srcdir, main_package_dir, '_compiler.c')
+ try:
+ os.unlink(b)
+ except OSError:
+ pass
+ shutil.copy(a, b)
ext = Extension(main_package_dir + '.compiler_version',
[os.path.join(main_package_dir, '_compiler.c')])
ext_modules.append(ext)

View file

@ -1,5 +1,6 @@
{ lib
, fetchPypi
, setuptools_scm
, buildPythonPackage
, isPy3k
, cython
@ -8,11 +9,14 @@
, pytest
, pytest-astropy
, astropy-helpers
, astropy-extension-helpers
, pyerfa
}:
buildPythonPackage rec {
pname = "astropy";
version = "4.2";
format = "pyproject";
disabled = !isPy3k; # according to setup.py
@ -21,15 +25,12 @@ buildPythonPackage rec {
sha256 = "2c194f8a429b8399de64a413a06881ea49f0525cabaa2d78fc132b9e970adc6a";
};
nativeBuildInputs = [ astropy-helpers cython jinja2 ];
propagatedBuildInputs = [ numpy pytest ]; # yes it really has pytest in install_requires
nativeBuildInputs = [ setuptools_scm astropy-helpers astropy-extension-helpers cython jinja2 ];
propagatedBuildInputs = [ numpy pyerfa ];
checkInputs = [ pytest pytest-astropy ];
# Disable automatic update of the astropy-helper module
postPatch = ''
substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
preBuild = ''
export SETUPTOOLS_SCM_PRETEND_VERSION="${version}"
'';
# Tests must be run from the build directory. astropy/samp tests
@ -42,15 +43,14 @@ buildPythonPackage rec {
'';
# 368 failed, 10889 passed, 978 skipped, 69 xfailed in 196.24s
# doCheck = false;
doCheck = false;
meta = {
meta = with lib; {
description = "Astronomy/Astrophysics library for Python";
homepage = "https://www.astropy.org";
license = lib.licenses.bsd3;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ kentjames ];
license = licenses.bsd3;
platforms = platforms.all;
maintainers = [ maintainers.kentjames ];
};
}

View file

@ -15,6 +15,7 @@
buildPythonPackage rec {
pname = "astroquery";
version = "0.4.1";
format = "pyproject";
src = fetchPypi {
inherit pname version;
@ -31,11 +32,6 @@ buildPythonPackage rec {
doCheck = false;
checkInputs = [ pytest pytest-astropy ];
# 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. The tests create files
# in $HOME/.astropy so we need to set HOME to $TMPDIR.
checkPhase = ''

View file

@ -4,13 +4,15 @@
, numpy
, pandas
, six
, pytest
, python
, astropy
, pytestCheckHook
, pytest-doctestplus
}:
buildPythonPackage rec {
pname = "drms";
version = "0.6.0";
format = "pyproject";
src = fetchPypi {
inherit pname version;
@ -24,13 +26,11 @@ buildPythonPackage rec {
];
checkInputs = [
pytest
astropy
pytestCheckHook
pytest-doctestplus
];
checkPhase = ''
${python.interpreter} -m drms.tests
'';
meta = with lib; {
description = "Access HMI, AIA and MDI data with Python";
homepage = "https://github.com/sunpy/drms";

View file

@ -1,41 +0,0 @@
{ lib
, buildPythonPackage
, fetchPypi
, isPy27
, pytestCheckHook
, setuptools_scm
}:
buildPythonPackage rec {
pname = "extension-helpers";
version = "0.1";
disabled = isPy27;
src = fetchPypi {
inherit pname version;
sha256 = "10iqjzmya2h4sk765dlm1pbqypwlqyh8rw59a5m9i63d3klnz2mc";
};
nativeBuildInputs = [
setuptools_scm
];
propagatedBuildInputs = [
pytestCheckHook
];
# avoid importing local module
preCheck = ''
cd extension_helpers
'';
# assumes setup.py is in pwd
disabledTests = [ "compiler_module" ];
meta = with lib; {
description = "Helpers to assist with building packages with compiled C/Cython extensions";
homepage = "https://github.com/astropy/extension-helpers";
license = licenses.bsd3;
maintainers = [ ];
};
}

View file

@ -0,0 +1,42 @@
{ lib
, buildPythonPackage
, fetchPypi
, isPy3k
, liberfa
, packaging
, numpy
}:
buildPythonPackage rec {
pname = "pyerfa";
format = "pyproject";
version = "1.7.1.1";
doCheck = false;
src = fetchPypi {
inherit pname version;
sha256 = "09i2qcsvxd3q04a5yaf6fwzg79paaslpksinan9d8smj7viql15i";
};
nativeBuildInputs = [ packaging ];
propagatedBuildInputs = [ liberfa numpy ];
preBuild = ''
export PYERFA_USE_SYSTEM_LIBERFA=1
'';
meta = with lib; {
description = "Python bindings for ERFA routines";
longDescription = ''
PyERFA is the Python wrapper for the ERFA library (Essential Routines
for Fundamental Astronomy), a C library containing key algorithms for
astronomy, which is based on the SOFA library published by the
International Astronomical Union (IAU). All C routines are wrapped as
Numpy universal functions, so that they can be called with scalar or
array inputs.
'';
homepage = "https://github.com/liberfa/pyerfa";
license = licenses.bsd3;
maintainers = [ maintainers.rmcgibbo ];
};
}

View file

@ -1,21 +1,36 @@
{ lib
, buildPythonPackage
, fetchPypi
, fetchpatch
, pytest
, pytestcov
, pytestCheckHook
, numpy
, astropy
, scipy
, h5py
, scikitimage
}:
buildPythonPackage rec {
pname = "pytest-astropy-header";
version = "0.1.2";
format = "pyproject";
src = fetchPypi {
inherit pname version;
sha256 = "1y87agr324p6x5gvhziymxjlw54pyn4gqnd49papbl941djpkp5g";
};
patches = [ (fetchpatch {
url = "https://github.com/astropy/pytest-astropy-header/pull/16.patch";
sha256 = "11ln63zq0kgsdx1jw3prlzpcdbxmc99p9cwr18s0x6apy0k6df31";
})
(fetchpatch {
url = "https://github.com/astropy/pytest-astropy-header/pull/29.patch";
sha256 = "18l434c926r5z1iq3b6lpnp0lrssszars9y1y9hs6216r60jgjpl";
})
];
propagatedBuildInputs = [
pytest
@ -25,6 +40,9 @@ buildPythonPackage rec {
pytestCheckHook
pytestcov
numpy
scipy
h5py
scikitimage
astropy
];

View file

@ -6,7 +6,7 @@
, astropy
, astropy-healpix
, astropy-helpers
, extension-helpers
, astropy-extension-helpers
, scipy
, pytest
, pytest-astropy
@ -23,15 +23,16 @@ buildPythonPackage rec {
sha256 = "1jsc3ad518vyys5987fr1achq8qvnz8rm80zp5an9qxlwr4zmh4m";
};
patches = [ (fetchpatch {
# Can be removed in next release after 0.7.1
# See https://github.com/astropy/reproject/issues/246
url = "https://github.com/astropy/reproject/pull/243.patch";
sha256 = "0dq3ii39hsrks0b9v306dlqf07dx0hqad8rwajmzw6rfda9m3c2a";
})
];
propagatedBuildInputs = [ numpy astropy astropy-healpix astropy-helpers scipy ];
nativeBuildInputs = [ astropy-helpers cython extension-helpers setuptools_scm ];
# Disable automatic update of the astropy-helper module
postPatch = ''
substituteInPlace setup.cfg --replace "auto_use = True" "auto_use = False"
'';
nativeBuildInputs = [ astropy-helpers cython astropy-extension-helpers setuptools_scm ];
checkInputs = [ pytest pytest-astropy ];
# Tests must be run in the build directory

View file

@ -1,7 +1,8 @@
{ lib
, fetchFromGitHub
, fetchPypi
, buildPythonPackage
, aplpy
, joblib
, astropy
, radio_beam
, pytest
@ -11,31 +12,20 @@
buildPythonPackage rec {
pname = "spectral-cube";
version = "0.4.5";
version = "0.5.0";
format = "pyproject";
# Fetch from GitHub instead of PyPi, as 0.4.5 isn't available in PyPi
src = fetchFromGitHub {
owner = "radio-astro-tools";
repo = pname;
rev = "v${version}";
sha256 = "1xc1m6vpl0bm600fx9vypa7zcvwg7yvhgn0w89y6v9d1vl0qcs7z";
src = fetchPypi {
inherit pname version;
sha256 = "17zisr26syfb8kn89xj17lrdycm0hsmy5yp5zrn236wgd8rjriki";
};
propagatedBuildInputs = [ astropy radio_beam ];
nativeBuildInputs = [ astropy-helpers ];
propagatedBuildInputs = [ astropy radio_beam joblib ];
checkInputs = [ aplpy pytest pytest-astropy ];
# 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
checkPhase = ''
cd build/lib
pytest
pytest spectral_cube
'';
meta = {

View file

@ -1,12 +1,12 @@
{ stdenv
, lib
, buildPythonPackage
, fetchFromGitHub
, fetchPypi
, pythonOlder
, asdf
, astropy
, astropy-helpers
, astropy-extension-helpers
, beautifulsoup4
, drms
, glymur
@ -29,16 +29,18 @@
buildPythonPackage rec {
pname = "sunpy";
version = "1.0.6";
version = "2.0.6";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "sunpy";
repo = pname;
rev = "v${version}";
sha256 = "0j2yfhfxgi95rig8cfp9lvszb7694gq90jvs0xrb472hwnzgh2sk";
src = fetchPypi {
inherit pname version;
sha256 = "109flghca42yhsm2w5xicqhyx1mc8c3vlwvadbn65fz3lhysqj67";
};
nativeBuildInputs = [
astropy-extension-helpers
];
propagatedBuildInputs = [
numpy
scipy
@ -66,16 +68,11 @@ buildPythonPackage rec {
pytest-mock
];
preBuild = ''
export SETUPTOOLS_SCM_PRETEND_VERSION="${version}"
export HOME=$(mktemp -d)
'';
# darwin has write permission issues
doCheck = stdenv.isLinux;
# ignore documentation tests
checkPhase = ''
pytest sunpy -k 'not rst'
PY_IGNORE_IMPORTMISMATCH=1 HOME=$(mktemp -d) pytest sunpy -k 'not rst'
'';
meta = with lib; {

View file

@ -421,6 +421,8 @@ in {
astropy-helpers = callPackage ../development/python-modules/astropy-helpers { };
astropy-extension-helpers = callPackage ../development/python-modules/astropy-extension-helpers { };
astroquery = callPackage ../development/python-modules/astroquery { };
asttokens = callPackage ../development/python-modules/asttokens { };
@ -1999,8 +2001,6 @@ in {
exifread = callPackage ../development/python-modules/exifread { };
extension-helpers = callPackage ../development/python-modules/extension-helpers { };
extras = callPackage ../development/python-modules/extras { };
eyeD3 = callPackage ../development/python-modules/eyed3 { };
@ -5121,6 +5121,8 @@ in {
pyepsg = callPackage ../development/python-modules/pyepsg { };
pyerfa = callPackage ../development/python-modules/pyerfa { };
pyexcel = callPackage ../development/python-modules/pyexcel { };
pyexcelerator = callPackage ../development/python-modules/pyexcelerator { };