python312Packages.datashape: cleanup & fix

This commit is contained in:
Gaetan Lepage
2025-02-12 00:31:37 +01:00
parent 137bd86c49
commit a354cd9758
@@ -2,45 +2,30 @@
lib,
buildPythonPackage,
fetchFromGitHub,
pytest,
mock,
numpy,
multipledispatch,
python-dateutil,
# build-system
setuptools,
versioneer,
# dependencies
multipledispatch,
numpy,
python-dateutil,
# tests
pytestCheckHook,
}:
let
# Fetcher function looks similar to fetchPypi.
# Allows for easier overriding, without having to know
# how the source is actually fetched.
fetcher =
{
pname,
version,
sha256,
}:
fetchFromGitHub {
owner = "blaze";
repo = pname;
rev = version;
inherit sha256;
};
in
buildPythonPackage rec {
pname = "datashape";
version = "0.5.4";
pyproject = true;
build-system = [
setuptools
versioneer
];
src = fetcher {
inherit pname version;
sha256 = "0rhlj2kjj1vx5m73wnc5518rd6cs1zsbgpsvzk893n516k69shcf";
src = fetchFromGitHub {
owner = "blaze";
repo = "datashape";
tag = version;
hash = "sha256-jkGdzDSh2JHQ/Fvft/QPmpmWUSiFWT5OLX0HKaeQFGY=";
};
postPatch = ''
@@ -48,29 +33,37 @@ buildPythonPackage rec {
rm versioneer.py
'';
nativeCheckInputs = [
pytest
mock
build-system = [
setuptools
versioneer
];
dependencies = [
numpy
multipledispatch
numpy
python-dateutil
];
# Disable several tests
# https://github.com/blaze/datashape/issues/232
checkPhase = ''
pytest --ignore datashape/tests/test_str.py \
--ignore datashape/tests/test_user.py
'';
nativeCheckInputs = [
pytestCheckHook
];
# https://github.com/blaze/datashape/issues/238
PYTEST_ADDOPTS = "-k 'not test_record and not test_tuple'";
disabledTests = [
# AttributeError: `np.unicode_` was removed in the NumPy 2.0 release. Use `np.str_` instead.
"test_from_numpy_dtype_fails"
"test_string_from_CType_classmethod"
];
disabledTestPaths = [
# numpy incompatibilities
# https://github.com/blaze/datashape/issues/232
"datashape/tests/test_str.py"
"datashape/tests/test_user.py"
];
meta = {
homepage = "https://github.com/ContinuumIO/datashape";
description = "Data description language";
homepage = "https://github.com/ContinuumIO/datashape";
changelog = "https://github.com/blaze/datashape/releases/tag/${version}";
license = lib.licenses.bsd2;
};
}