Merge pull request #255124 from doronbehar/pkg/astropy

python3.pkgs.astropy: 5.2.1 -> 5.3.3 & more
This commit is contained in:
Doron Behar 2023-09-23 10:52:17 +00:00 committed by GitHub
commit 870e72720e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 95 additions and 41 deletions

View File

@ -94,5 +94,7 @@ buildPythonPackage rec {
homepage = "https://github.com/asdf-format/asdf";
license = licenses.bsd3;
maintainers = with maintainers; [ ];
# Many tests fail, according to Hydra
broken = true;
};
}

View File

@ -1,6 +1,7 @@
{ lib
, buildPythonPackage
, fetchPypi
, fetchpatch
, findutils
, pytestCheckHook
, pythonOlder
@ -11,23 +12,31 @@
buildPythonPackage rec {
pname = "extension-helpers";
version = "1.0.0";
version = "1.1.0";
format = "pyproject";
disabled = pythonOlder "3.6";
src = fetchPypi {
inherit pname version;
sha256 = "ca1bfac67c79cf4a7a0c09286ce2a24eec31bf17715818d0726318dd0e5050e6";
hash = "sha256-SUYMeKP40fjOwXRHn16FrURZSMzEFgM8WqPm3fLFAik=";
};
patches = [
# Not needed to allow this package to build, but meant for it's dependent
# packages, like astropy. See explanation at:
# https://github.com/astropy/extension-helpers/pull/59
(fetchpatch {
url = "https://github.com/astropy/extension-helpers/commit/796f3e7831298df2d26b6d994b13fd57061a56d1.patch";
hash = "sha256-NnqK9HQq1hQ66RUJf9gTCuLyA0BVqVtL292mSXJ9860=";
})
];
nativeBuildInputs = [
setuptools-scm
wheel
];
patches = [ ./permissions.patch ];
nativeCheckInputs = [
findutils
pip

View File

@ -1,20 +0,0 @@
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
, fetchpatch
, buildPythonPackage
, pythonOlder
@ -10,6 +11,11 @@
, oldest-supported-numpy
, setuptools-scm
, wheel
# testing
, pytestCheckHook
, pytest-xdist
, pytest-astropy
, python
# runtime
, numpy
@ -18,21 +24,30 @@
, pyyaml
}:
let
buildPythonPackage rec {
pname = "astropy";
version = "5.2.1";
in
buildPythonPackage {
inherit pname version;
version = "5.3.3";
format = "pyproject";
disabled = pythonOlder "3.8"; # according to setup.cfg
src = fetchPypi {
inherit pname version;
hash = "sha256-9q4noHf46oSQPvp2x5C5hWFzQaAISw0hw5H3o/MyrCM=";
hash = "sha256-AzDfn116IlQ2fpuM9EJVuhBwsGEjGIxqcu3BgEk/k7s=";
};
patches = [
# Fixes running tests in parallel issue
# https://github.com/astropy/astropy/issues/15316. Fix from
# https://github.com/astropy/astropy/pull/15327
(fetchpatch {
url = "https://github.com/astropy/astropy/commit/1042c0fb06a992f683bdc1eea2beda0b846ed356.patch";
hash = "sha256-bApAcGBRrJ94thhByoYvdqw2e6v77+FmTfgmGcE6MMk=";
})
];
# Relax cython dependency to allow this to build, upstream only doesn't
# support cython 3 as of writing. See:
# https://github.com/astropy/astropy/issues/15315
postPatch = ''
substituteInPlace pyproject.toml \
--replace 'cython==' 'cython>='
@ -54,14 +69,28 @@ buildPythonPackage {
pyyaml
];
# infinite recursion with pytest-astropy (pytest-astropy-header depends on astropy itself)
doCheck = false;
nativeCheckInputs = [
pytestCheckHook
pytest-xdist
pytest-astropy
];
meta = with lib; {
# Not running it inside the build directory. See:
# https://github.com/astropy/astropy/issues/15316#issuecomment-1722190547
preCheck = ''
cd "$out"
export HOME="$(mktemp -d)"
export OMP_NUM_THREADS=$(( $NIX_BUILD_CORES / 4 ))
'';
pythonImportsCheck = [
"astropy"
];
meta = {
description = "Astronomy/Astrophysics library for Python";
homepage = "https://www.astropy.org";
license = licenses.bsd3;
platforms = platforms.all;
maintainers = [ maintainers.kentjames ];
license = lib.licenses.bsd3;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ kentjames doronbehar ];
};
}

View File

@ -66,6 +66,8 @@ buildPythonPackage rec {
description = "Functions and classes to access online data resources";
homepage = "https://astroquery.readthedocs.io/";
license = licenses.bsd3;
# Broken since a certain astropy update, due to API incompatibility
broken = true;
maintainers = [ maintainers.smaret ];
};
}

View File

@ -1,6 +1,7 @@
{ lib
, buildPythonPackage
, fetchPypi
, fetchpatch
, jinja2
, oldest-supported-numpy
, setuptools-scm
@ -8,20 +9,28 @@
, liberfa
, packaging
, numpy
, pytestCheckHook
, pytest-doctestplus
}:
buildPythonPackage rec {
pname = "pyerfa";
format = "pyproject";
version = "2.0.0.1";
doCheck = false;
version = "2.0.0.3";
src = fetchPypi {
inherit pname version;
hash = "sha256-L9Rjf/4sHm7edILBP1g7p8cxGdeL75AXVEjOUGoO3jA=";
hash = "sha256-13+7+lg1DBlMy5nl2TqgXTwrFNWq2LZi2Txq2f/0Hzk=";
};
patches = [
# Sort of helps maybe for https://github.com/liberfa/pyerfa/issues/112
(fetchpatch {
url = "https://github.com/liberfa/pyerfa/commit/4866342b94c5e7344711146f1186a4c3e7534da8.patch";
hash = "sha256-uPFFdLYfRweQdeEApBAw6Ulqh31NTQwwmnaU+x/M+C0=";
})
];
nativeBuildInputs = [
jinja2
oldest-supported-numpy
@ -31,14 +40,32 @@ buildPythonPackage rec {
];
propagatedBuildInputs = [
liberfa
numpy
];
buildInputs = [
liberfa
];
preBuild = ''
export PYERFA_USE_SYSTEM_LIBERFA=1
'';
# See https://github.com/liberfa/pyerfa/issues/112#issuecomment-1721197483
NIX_CFLAGS_COMPILE = "-O2";
nativeCheckInputs = [
pytestCheckHook
pytest-doctestplus
];
# Getting circular import errors without this, not clear yet why. This was mentioned to
# upstream at: https://github.com/liberfa/pyerfa/issues/112 and downstream at
# https://github.com/NixOS/nixpkgs/issues/255262
preCheck = ''
cd $out
'';
pythonImportsCheck = [
"erfa"
];
meta = with lib; {
description = "Python bindings for ERFA routines";
longDescription = ''

View File

@ -1,4 +1,5 @@
{ lib
, stdenv
, fetchpatch
, fetchPypi
, pythonOlder
@ -97,5 +98,7 @@ buildPythonPackage rec {
homepage = "https://github.com/QCoDeS/Qcodes_loop";
license = licenses.mit;
maintainers = with maintainers; [ evilmav ];
# Some tests fail on this platform
broken = stdenv.isDarwin;
};
}

View File

@ -63,5 +63,7 @@ buildPythonPackage rec {
changelog = "https://github.com/radio-astro-tools/spectral-cube/releases/tag/v${version}";
license = licenses.bsd3;
maintainers = with maintainers; [ smaret ];
# Tests fail to start, according to Hydra
broken = true;
};
}