default.nix (1096B)
1 { 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 python3Packages, 6 cmake, 7 which, 8 revtok, 9 }: 10 11 python3Packages.buildPythonPackage rec { 12 pname = "pytorchtext"; 13 version = "0.10.1"; 14 pyproject = true; 15 16 src = fetchFromGitHub { 17 owner = "pytorch"; 18 repo = "text"; 19 tag = "v${version}"; 20 hash = "sha256-UCH/12jVeUY+h3Qop/RPtjIeXdddA1upsWIiwAs8+bc="; 21 fetchSubmodules = true; 22 }; 23 24 build-system = with python3Packages; [ setuptools ]; 25 26 nativeBuildInputs = [ 27 cmake 28 which 29 ]; 30 31 buildInputs = with python3Packages; [ pybind11 ]; 32 33 dependencies = with python3Packages; [ 34 defusedxml 35 nltk 36 pytorch 37 requests 38 revtok 39 sacremoses 40 spacy 41 tqdm 42 ]; 43 44 nativeCheckInputs = with python3Packages; [ pytestCheckHook ]; 45 46 dontUseCmakeConfigure = true; 47 48 doCheck = false; 49 50 pythonImportsCheck = [ "torchtext" ]; 51 52 meta = { 53 description = "Text utilities and datasets for PyTorch"; 54 homepage = "https://github.com/pytorch/text"; 55 license = lib.licenses.bsd3; 56 maintainers = [ lib.maintainers.sikmir ]; 57 broken = true; # spacy is broken 58 }; 59 }