package.nix (1341B)
1 { 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 python3Packages, 6 cmake, 7 ninja, 8 which, 9 revtok, 10 }: 11 12 python3Packages.buildPythonPackage rec { 13 pname = "pytorchtext"; 14 version = "0.18.0"; 15 pyproject = true; 16 17 src = fetchFromGitHub { 18 owner = "pytorch"; 19 repo = "text"; 20 tag = "v${version}"; 21 hash = "sha256-ok91rw/76ivtTTd3DkdDG7N2aZE5WqPuZE4YbbQ0pYU="; 22 fetchSubmodules = true; 23 }; 24 25 postPatch = '' 26 substituteInPlace setup.py --replace-fail "subprocess.check_call" "pass #" 27 ''; 28 29 build-system = with python3Packages; [ setuptools ]; 30 31 nativeBuildInputs = [ 32 cmake 33 ninja 34 which 35 ]; 36 37 buildInputs = with python3Packages; [ pybind11 ]; 38 39 dependencies = with python3Packages; [ 40 defusedxml 41 nltk 42 pytorch 43 requests 44 revtok 45 sacremoses 46 spacy 47 tqdm 48 ]; 49 50 nativeCheckInputs = with python3Packages; [ pytestCheckHook ]; 51 52 dontUseCmakeConfigure = true; 53 54 doCheck = false; 55 56 env.NIX_CFLAGS_COMPILE = "-Wno-error=enum-constexpr-conversion"; 57 58 pythonImportsCheck = [ "torchtext" ]; 59 60 meta = { 61 description = "Text utilities and datasets for PyTorch"; 62 homepage = "https://github.com/pytorch/text"; 63 license = lib.licenses.bsd3; 64 maintainers = [ lib.maintainers.sikmir ]; 65 broken = true; # error: implicit instantiation of undefined template 'std::char_traits' 66 }; 67 }