Merge pull request #175086 from fabaff/spacy-transformers-fix

python310Packages.spacy-transformers: relax transformers constraint

authored by

Fabian Affolter and committed by
GitHub
075bcccc 6c09a192

+63 -15
+5
pkgs/development/python-modules/spacy-transformers/default.nix
··· 33 dataclasses 34 ]; 35 36 # Test fails due to missing arguments for trfs2arrays(). 37 doCheck = false; 38
··· 33 dataclasses 34 ]; 35 36 + postPatch = '' 37 + substituteInPlace setup.cfg \ 38 + --replace "transformers>=3.4.0,<4.18.0" "transformers>=3.4.0 # ,<4.18.0" 39 + ''; 40 + 41 # Test fails due to missing arguments for trfs2arrays(). 42 doCheck = false; 43
+58 -15
pkgs/development/python-modules/transformers/default.nix
··· 1 - { buildPythonPackage 2 - , lib 3 , fetchFromGitHub 4 , pythonOlder 5 , cookiecutter ··· 10 , requests 11 , numpy 12 , packaging 13 , protobuf 14 , pyyaml 15 - , sacremoses 16 , tokenizers 17 , tqdm 18 }: ··· 20 buildPythonPackage rec { 21 pname = "transformers"; 22 version = "4.19.2"; 23 24 src = fetchFromGitHub { 25 owner = "huggingface"; 26 repo = pname; 27 rev = "refs/tags/v${version}"; 28 - sha256 = "sha256-9r/1vW7Rhv9+Swxdzu5PTnlQlT8ofJeZamHf5X4ql8w="; 29 }; 30 31 - nativeBuildInputs = [ packaging ]; 32 - 33 propagatedBuildInputs = [ 34 - cookiecutter 35 filelock 36 huggingface-hub 37 numpy 38 protobuf 39 pyyaml 40 regex 41 requests 42 - sacremoses 43 tokenizers 44 tqdm 45 - ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; 46 47 # Many tests require internet access. 48 doCheck = false; 49 50 - postPatch = '' 51 - sed -ri 's/tokenizers[=>]=[^"]+/tokenizers/g' setup.py src/transformers/dependency_versions_table.py 52 - ''; 53 - 54 - pythonImportsCheck = [ "transformers" ]; 55 56 meta = with lib; { 57 homepage = "https://github.com/huggingface/transformers"; 58 - description = "State-of-the-art Natural Language Processing for TensorFlow 2.0 and PyTorch"; 59 changelog = "https://github.com/huggingface/transformers/releases/tag/v${version}"; 60 license = licenses.asl20; 61 platforms = platforms.unix;
··· 1 + { lib 2 + , buildPythonPackage 3 , fetchFromGitHub 4 , pythonOlder 5 , cookiecutter ··· 10 , requests 11 , numpy 12 , packaging 13 + , tensorflow 14 + , sagemaker 15 + , ftfy 16 , protobuf 17 + , scikit-learn 18 + , pillow 19 , pyyaml 20 + , torch 21 , tokenizers 22 , tqdm 23 }: ··· 25 buildPythonPackage rec { 26 pname = "transformers"; 27 version = "4.19.2"; 28 + format = "setuptools"; 29 + 30 + disabled = pythonOlder "3.7"; 31 32 src = fetchFromGitHub { 33 owner = "huggingface"; 34 repo = pname; 35 rev = "refs/tags/v${version}"; 36 + hash = "sha256-9r/1vW7Rhv9+Swxdzu5PTnlQlT8ofJeZamHf5X4ql8w="; 37 }; 38 39 propagatedBuildInputs = [ 40 filelock 41 huggingface-hub 42 numpy 43 protobuf 44 + packaging 45 pyyaml 46 regex 47 requests 48 tokenizers 49 tqdm 50 + ] ++ lib.optionals (pythonOlder "3.8") [ 51 + importlib-metadata 52 + ]; 53 + 54 + passthru.optional-dependencies = { 55 + ja = [ 56 + # fugashi 57 + # ipadic 58 + # unidic_lite 59 + # unidic 60 + ]; 61 + sklearn = [ 62 + scikit-learn 63 + ]; 64 + tf = [ 65 + tensorflow 66 + # onnxconverter-common 67 + # tf2onnx 68 + ]; 69 + torch = [ 70 + torch 71 + ]; 72 + tokenizers = [ 73 + tokenizers 74 + ]; 75 + modelcreation = [ 76 + cookiecutter 77 + ]; 78 + sagemaker = [ 79 + sagemaker 80 + ]; 81 + ftfy = [ ftfy ]; 82 + onnx = [ 83 + # onnxconverter-common 84 + # tf2onnx 85 + ]; 86 + vision = [ 87 + pillow 88 + ]; 89 + }; 90 + 91 92 # Many tests require internet access. 93 doCheck = false; 94 95 + pythonImportsCheck = [ 96 + "transformers" 97 + ]; 98 99 meta = with lib; { 100 homepage = "https://github.com/huggingface/transformers"; 101 + description = "Natural Language Processing for TensorFlow 2.0 and PyTorch"; 102 changelog = "https://github.com/huggingface/transformers/releases/tag/v${version}"; 103 license = licenses.asl20; 104 platforms = platforms.unix;