From a354cd975885cfeb9f21fc727585d2b250abf3da Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 12 Feb 2025 00:31:37 +0100 Subject: [PATCH] python312Packages.datashape: cleanup & fix --- .../python-modules/datashape/default.nix | 79 +++++++++---------- 1 file changed, 36 insertions(+), 43 deletions(-) diff --git a/pkgs/development/python-modules/datashape/default.nix b/pkgs/development/python-modules/datashape/default.nix index 7077087d3587..176a3136a802 100644 --- a/pkgs/development/python-modules/datashape/default.nix +++ b/pkgs/development/python-modules/datashape/default.nix @@ -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; }; }