diff --git a/pkgs/development/python-modules/datatable/default.nix b/pkgs/development/python-modules/datatable/default.nix index 345903932bd4..c5271e473e3e 100644 --- a/pkgs/development/python-modules/datatable/default.nix +++ b/pkgs/development/python-modules/datatable/default.nix @@ -1,45 +1,63 @@ { stdenv, lib, buildPythonPackage, fetchPypi, substituteAll, pythonOlder +, pipInstallHook, writeText , blessed , docutils , libcxx -, libcxxabi , llvm -, openmp -, pytest +, pytestCheckHook , typesentry }: buildPythonPackage rec { pname = "datatable"; - version = "0.10.1"; + version = "0.11.0"; disabled = pythonOlder "3.5"; src = fetchPypi { inherit pname version; - sha256 = "3ce5257c0c4afa96e2b14ca47a0aaf73add195b11de48f4adda50b5ede927436"; + sha256 = "19c602711e00f72e9ae296d8fa742d46da037c2d3a2d254bdf68f817a8da76bb"; }; + # authors seem to have created their own build system + format = "other"; - patches = lib.optionals stdenv.isDarwin [ - # Replace the library auto-detection with hardcoded paths. - (substituteAll { - src = ./hardcode-library-paths.patch; + # tarball doesn't appear to have been shipped totally ready-to-build + postPatch = '' + substituteInPlace ci/ext.py \ + --replace \ + 'shell_cmd(["git"' \ + '"0000000000000000000000000000000000000000" or shell_cmd(["git"' + echo '${version}' > VERSION.txt + ''; + DT_RELEASE = "1"; - libomp_dylib = "${lib.getLib openmp}/lib/libomp.dylib"; - libcxx_dylib = "${lib.getLib libcxx}/lib/libc++.1.dylib"; - libcxxabi_dylib = "${lib.getLib libcxxabi}/lib/libc++abi.dylib"; - }) - ]; + buildPhase = '' + python ci/ext.py wheel + ''; propagatedBuildInputs = [ typesentry blessed ]; - buildInputs = [ llvm ] ++ lib.optionals stdenv.isDarwin [ openmp ]; - checkInputs = [ docutils pytest ]; + buildInputs = [ llvm pipInstallHook ]; + checkInputs = [ docutils pytestCheckHook ]; LLVM = llvm; + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-isystem ${libcxx}/include/c++/v1"; - checkPhase = '' - mv datatable datatable.hidden - pytest - ''; + pytestFlagsArray = let + # ini file (not included in tarball) required to change python_files setting, + pytestIni = writeText "pytest.ini" '' + [pytest] + python_files = test_*.py test-*.py + ''; + in [ + "-c ${pytestIni}" + ]; + disabledTests = [ + # skip tests which are irrelevant to our installation or use way too much memory + "test_xfunction_paths" + "test_fread_from_cmd2" + "test_cast_huge_to_str" + "test_create_large_string_column" + ]; + pythonImportsCheck = [ "datatable" ]; meta = with lib; { description = "data.table for Python"; diff --git a/pkgs/development/python-modules/datatable/hardcode-library-paths.patch b/pkgs/development/python-modules/datatable/hardcode-library-paths.patch deleted file mode 100644 index 76c2f0e1dd7f..000000000000 --- a/pkgs/development/python-modules/datatable/hardcode-library-paths.patch +++ /dev/null @@ -1,43 +0,0 @@ -diff --git a/ci/setup_utils.py b/ci/setup_utils.py -index 66b385a..6255af0 100644 ---- a/ci/setup_utils.py -+++ b/ci/setup_utils.py -@@ -600,37 +600,7 @@ def find_linked_dynamic_libraries(): - them as a list of absolute paths. - """ - with TaskContext("Find the required dynamic libraries") as log: -- llvm = get_llvm() -- libs = required_link_libraries() -- resolved = [] -- for libname in libs: -- if llvm: -- fullpath = os.path.join(llvm, "lib", libname) -- if os.path.isfile(fullpath): -- resolved.append(fullpath) -- log.info("Library `%s` found at %s" % (libname, fullpath)) -- continue -- else: -- log.info("%s does not exist" % fullpath) -- # Rely on the shell `locate` command to find the dynamic libraries. -- proc = subprocess.Popen(["locate", libname], stdout=subprocess.PIPE, -- stderr=subprocess.PIPE) -- stdout, stderr = proc.communicate() -- if proc.returncode == 0: -- results = stdout.decode().strip().split("\n") -- results = [r for r in results if r] -- if results: -- results.sort(key=len) -- fullpath = results[0] -- assert os.path.isfile(fullpath), "Invalid path: %r" % (fullpath,) -- resolved.append(fullpath) -- log.info("Library `%s` found at %s" % (libname, fullpath)) -- continue -- else: -- log.fatal("Cannot locate dynamic library `%s`" % libname) -- else: -- log.fatal("`locate` command returned the following error:\n%s" -- % stderr.decode()) -+ resolved = ["@libomp_dylib@", "@libcxx_dylib@", "@libcxxabi_dylib@"] - return resolved - - diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 8bf36ea1ad23..66695effc8bc 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1459,8 +1459,9 @@ in { datashape = callPackage ../development/python-modules/datashape { }; - datatable = - callPackage ../development/python-modules/datatable { inherit (pkgs.llvmPackages) openmp libcxx libcxxabi; }; + datatable = callPackage ../development/python-modules/datatable { + inherit (pkgs.llvmPackages) libcxx; + }; dateparser = callPackage ../development/python-modules/dateparser { };