mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 23:03:40 +01:00
Merge pull request #29334 from rvl/python-textacy
pythonPackages.textacy: init at 0.4.1
This commit is contained in:
commit
e8f873671f
12 changed files with 300 additions and 38 deletions
|
@ -13,7 +13,7 @@ pythonPackages.buildPythonApplication rec {
|
|||
mopidy
|
||||
pythonPackages.requests
|
||||
pythonPackages.gmusicapi
|
||||
pythonPackages.cachetools
|
||||
pythonPackages.cachetools_1
|
||||
];
|
||||
|
||||
doCheck = false;
|
||||
|
|
18
pkgs/development/python-modules/cachetools/1.nix
Normal file
18
pkgs/development/python-modules/cachetools/1.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ stdenv, buildPythonPackage, fetchPypi, isPyPy }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
name = "${pname}-${version}";
|
||||
pname = "cachetools";
|
||||
version = "1.1.3";
|
||||
disabled = isPyPy; # a test fails
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "0js7qx5pa8ibr8487lcf0x3a7w0xml0wa17snd6hjs0857kqhn20";
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = "https://github.com/tkem/cachetools";
|
||||
license = licenses.mit;
|
||||
};
|
||||
}
|
18
pkgs/development/python-modules/cachetools/default.nix
Normal file
18
pkgs/development/python-modules/cachetools/default.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{ stdenv, buildPythonPackage, fetchPypi, isPyPy }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
name = "${pname}-${version}";
|
||||
pname = "cachetools";
|
||||
version = "2.0.1";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "0pdw2fr29pxlyn1g5fhdrrqbpn0iw062nv716ngdqvdx7hnizq7d";
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Extensible memoizing collections and decorators";
|
||||
homepage = "https://github.com/tkem/cachetools";
|
||||
license = licenses.mit;
|
||||
};
|
||||
}
|
27
pkgs/development/python-modules/cld2-cffi/default.nix
Normal file
27
pkgs/development/python-modules/cld2-cffi/default.nix
Normal file
|
@ -0,0 +1,27 @@
|
|||
{ stdenv, buildPythonPackage, fetchPypi, six, cffi, nose }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
name = "${pname}-${version}";
|
||||
pname = "cld2-cffi";
|
||||
version = "0.1.4";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "0rvcdx4fdh5yk4d2nlddq1q1r2r0xqp86hpmbdn447pdcj1r8a9s";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ six cffi ];
|
||||
checkInputs = [ nose ];
|
||||
|
||||
# gcc doesn't approve of this code, so disable -Werror
|
||||
NIX_CFLAGS_COMPILE = "-w";
|
||||
|
||||
checkPhase = "nosetests -v";
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "CFFI bindings around Google Chromium's embedded compact language detection library (CLD2)";
|
||||
homepage = "https://github.com/GregBowyer/cld2-cffi";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ rvl ];
|
||||
};
|
||||
}
|
21
pkgs/development/python-modules/ijson/default.nix
Normal file
21
pkgs/development/python-modules/ijson/default.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
{ stdenv, buildPythonPackage, fetchPypi }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
name = "${pname}-${version}";
|
||||
pname = "ijson";
|
||||
version = "2.3";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "0x7l9k2dvxzd5mjgiq15nl9b0sxcqy1cqaz744bjwkz4z5mrypzg";
|
||||
};
|
||||
|
||||
doCheck = false; # something about yajl
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Iterative JSON parser with a standard Python iterator interface";
|
||||
homepage = "https://github.com/isagalaev/ijson";
|
||||
license = licenses.bsd3;
|
||||
maintainers = with maintainers; [ rvl ];
|
||||
};
|
||||
}
|
22
pkgs/development/python-modules/pyemd/default.nix
Normal file
22
pkgs/development/python-modules/pyemd/default.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{ stdenv, buildPythonPackage, fetchPypi, numpy, cython }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
name = "${pname}-${version}";
|
||||
pname = "pyemd";
|
||||
version = "0.4.4";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "13y06y7r1697cv4r430g45fxs40i2yk9xn0dk9nqlrpddw3a0mr4";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ numpy ];
|
||||
buildInputs = [ cython ];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "A Python wrapper for Ofir Pele and Michael Werman's implementation of the Earth Mover's Distance";
|
||||
homepage = http://github.com/wmayner/pyemd;
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ rvl ];
|
||||
};
|
||||
}
|
19
pkgs/development/python-modules/pyphen/default.nix
Normal file
19
pkgs/development/python-modules/pyphen/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{ stdenv, buildPythonPackage, fetchPypi }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
name = "${pname}-${version}";
|
||||
pname = "Pyphen";
|
||||
version = "0.9.4";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "1mqb5jrigxipxzp1d8nbwkq0cfjw77pnn6hc4mp1yd2mn059mymb";
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Pure Python module to hyphenate text";
|
||||
homepage = "https://github.com/Kozea/Pyphen";
|
||||
license = with licenses; [gpl2 lgpl21 mpl20];
|
||||
maintainers = with maintainers; [ rvl ];
|
||||
};
|
||||
}
|
42
pkgs/development/python-modules/spacy/models.json
Normal file
42
pkgs/development/python-modules/spacy/models.json
Normal file
|
@ -0,0 +1,42 @@
|
|||
[{
|
||||
"pname": "es_core_web_md",
|
||||
"version": "1.0.0",
|
||||
"sha256": "0ikyakdhnj6rrfpr8k83695d1gd3z9n60a245hwwchv94jmr7r6s",
|
||||
"license": "cc-by-sa-40"
|
||||
},
|
||||
{
|
||||
"pname": "fr_depvec_web_lg",
|
||||
"version": "1.0.0",
|
||||
"sha256": "0nxmdszs1s5by2874cz37azrmwamh1ngdsiylffkfihzq6s8bhka",
|
||||
"license": "cc-by-nc-sa-40"
|
||||
},
|
||||
{
|
||||
"pname": "en_core_web_md",
|
||||
"version": "1.2.1",
|
||||
"sha256": "12prr4hcbfdaky9rcna1y1ykr417jkhkks2r8l06g8fb7am3pvp3",
|
||||
"license": "cc-by-sa-40"
|
||||
},
|
||||
{
|
||||
"pname": "en_depent_web_md",
|
||||
"version": "1.2.1",
|
||||
"sha256": "0giyr35q5lpp5drpcamyvb5gsjnhj62mk3ndfr49nm1s6d5f6m52",
|
||||
"license": "cc-by-sa-40"
|
||||
},
|
||||
{
|
||||
"pname": "en_core_web_sm",
|
||||
"version": "1.2.0",
|
||||
"sha256": "0vc4l77dcwa9lmzyqdci8ikjc0m2rhasl2zvyba547vf76qb0528",
|
||||
"license": "cc-by-sa-40"
|
||||
},
|
||||
{
|
||||
"pname": "de_core_news_md",
|
||||
"version": "1.0.0",
|
||||
"sha256": "072jz2rdi1nckny7k16avp86vjg4didfdsw816kfl9zwr88iny6g",
|
||||
"license": "cc-by-sa-40"
|
||||
},
|
||||
{
|
||||
"pname": "en_vectors_glove_md",
|
||||
"version": "1.0.0",
|
||||
"sha256": "1jbr27xnh5fdww8yphpvk2brfnzb174wfnxkzdqwv3iyi02zsin6",
|
||||
"license": "cc-by-sa-40"
|
||||
}]
|
26
pkgs/development/python-modules/spacy/models.nix
Normal file
26
pkgs/development/python-modules/spacy/models.nix
Normal file
|
@ -0,0 +1,26 @@
|
|||
{ stdenv, buildPythonPackage, fetchurl, spacy }:
|
||||
let
|
||||
buildModelPackage = { pname, version, sha256, license }: buildPythonPackage {
|
||||
name = "${pname}-${version}";
|
||||
inherit pname version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/explosion/spacy-models/releases/download/${pname}-${version}/${pname}-${version}.tar.gz";
|
||||
inherit sha256;
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ spacy ];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Models for the spaCy NLP library";
|
||||
homepage = "https://github.com/explosion/spacy-models";
|
||||
license = licenses."${license}";
|
||||
maintainers = with maintainers; [ rvl ];
|
||||
};
|
||||
};
|
||||
|
||||
makeModelSet = models: with pkgs.lib; listToAttrs (map (m: nameValuePair m.pname (buildModelPackage m)) models);
|
||||
|
||||
in makeModelSet (pkgs.lib.importJSON ./models.json)
|
||||
|
||||
# cat models.json | jq -r '.[] | @uri "https://github.com/explosion/spacy-models/releases/download/\(.pname)-\(.version)/\(.pname)-\(.version).tar.gz"' | xargs -n1 nix-prefetch-url
|
65
pkgs/development/python-modules/textacy/default.nix
Normal file
65
pkgs/development/python-modules/textacy/default.nix
Normal file
|
@ -0,0 +1,65 @@
|
|||
{ stdenv
|
||||
, buildPythonPackage
|
||||
, isPy27
|
||||
, fetchPypi
|
||||
, cachetools
|
||||
, cld2-cffi
|
||||
, cython
|
||||
, cytoolz
|
||||
, ftfy
|
||||
, ijson
|
||||
, matplotlib
|
||||
, networkx
|
||||
, numpy
|
||||
, pyemd
|
||||
, pyphen
|
||||
, python-Levenshtein
|
||||
, requests
|
||||
, scikitlearn
|
||||
, scipy
|
||||
, spacy
|
||||
, tqdm
|
||||
, unidecode
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
name = "${pname}-${version}";
|
||||
pname = "textacy";
|
||||
version = "0.4.1";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "04wf3a7zgzz83nmgkh488wkl50zm9yfdpv3sl12sm2zj685plqcz";
|
||||
};
|
||||
|
||||
disabled = isPy27; # 2.7 requires backports.csv
|
||||
|
||||
propagatedBuildInputs = [
|
||||
cachetools
|
||||
cld2-cffi
|
||||
cytoolz
|
||||
ftfy
|
||||
ijson
|
||||
matplotlib
|
||||
networkx
|
||||
numpy
|
||||
pyemd
|
||||
pyphen
|
||||
python-Levenshtein
|
||||
requests
|
||||
scikitlearn
|
||||
scipy
|
||||
spacy
|
||||
tqdm
|
||||
unidecode
|
||||
];
|
||||
|
||||
doCheck = false; # tests want to download data files
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Higher-level text processing, built on spaCy";
|
||||
homepage = "http://textacy.readthedocs.io/";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ rvl ];
|
||||
};
|
||||
}
|
23
pkgs/development/python-modules/unidecode/default.nix
Normal file
23
pkgs/development/python-modules/unidecode/default.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
{ stdenv, buildPythonPackage, fetchPypi, glibcLocales }:
|
||||
|
||||
buildPythonPackage rec {
|
||||
name = "${pname}-${version}";
|
||||
pname = "Unidecode";
|
||||
version = "0.04.21";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "0lfhp9c5xrbpjvbpr12ji52g1lx04404bzzdg6pvabhzisw6l2i8";
|
||||
};
|
||||
|
||||
LC_ALL="en_US.UTF-8";
|
||||
|
||||
buildInputs = [ glibcLocales ];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = http://pypi.python.org/pypi/Unidecode/;
|
||||
description = "ASCII transliterations of Unicode text";
|
||||
license = licenses.gpl2;
|
||||
maintainers = with maintainers; [ domenkozar ];
|
||||
};
|
||||
}
|
|
@ -2676,6 +2676,8 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
cld2-cffi = callPackage ../development/python-modules/cld2-cffi {};
|
||||
|
||||
clf = buildPythonPackage rec {
|
||||
name = "clf-${version}";
|
||||
version = "0.5.2";
|
||||
|
@ -6287,6 +6289,8 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
ijson = callPackage ../development/python-modules/ijson/default.nix {};
|
||||
|
||||
imagesize = buildPythonPackage rec {
|
||||
name = "imagesize-${version}";
|
||||
version = "0.7.0";
|
||||
|
@ -7394,6 +7398,8 @@ in {
|
|||
inherit pythonOlder;
|
||||
};
|
||||
|
||||
pyphen = callPackage ../development/python-modules/pyphen {};
|
||||
|
||||
pypoppler = buildPythonPackage rec {
|
||||
name = "pypoppler-${version}";
|
||||
version = "0.12.2";
|
||||
|
@ -14227,7 +14233,7 @@ in {
|
|||
oslo-serialization oslo-utils iso8601 oslo-log oslo-i18n webob
|
||||
];
|
||||
buildInputs = with self; [
|
||||
oslo-middleware cachetools oslo-service futurist anyjson oslosphinx
|
||||
oslo-middleware cachetools_1 oslo-service futurist anyjson oslosphinx
|
||||
testtools oslotest
|
||||
];
|
||||
|
||||
|
@ -14236,20 +14242,8 @@ in {
|
|||
};
|
||||
};
|
||||
|
||||
cachetools = buildPythonPackage rec {
|
||||
name = "cachetools-${version}";
|
||||
version = "1.1.3";
|
||||
disabled = isPyPy; # a test fails
|
||||
|
||||
src = pkgs.fetchurl {
|
||||
url = "mirror://pypi/c/cachetools/${name}.tar.gz";
|
||||
sha256 = "0js7qx5pa8ibr8487lcf0x3a7w0xml0wa17snd6hjs0857kqhn20";
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
homepage = "https://github.com/tkem/cachetools";
|
||||
};
|
||||
};
|
||||
cachetools_1 = callPackage ../development/python-modules/cachetools/1.nix {};
|
||||
cachetools = callPackage ../development/python-modules/cachetools {};
|
||||
|
||||
futurist = buildPythonPackage rec {
|
||||
name = "futurist-${version}";
|
||||
|
@ -14285,7 +14279,7 @@ in {
|
|||
propagatedBuildInputs = with self; [
|
||||
pbr oslo-config oslo-context oslo-log oslo-utils oslo-serialization
|
||||
oslo-i18n stevedore six eventlet greenlet webob pyyaml kombu_3 trollius
|
||||
aioeventlet cachetools oslo-middleware futurist redis oslo-service
|
||||
aioeventlet cachetools_1 oslo-middleware futurist redis oslo-service
|
||||
eventlet pyzmq
|
||||
];
|
||||
|
||||
|
@ -14692,7 +14686,7 @@ in {
|
|||
};
|
||||
|
||||
propagatedBuildInputs = with self; [
|
||||
pbr futures enum34 debtcollector cachetools oslo-serialization oslo-utils
|
||||
pbr futures enum34 debtcollector cachetools_1 oslo-serialization oslo-utils
|
||||
jsonschema monotonic stevedore networkx futurist pbr automaton fasteners
|
||||
];
|
||||
buildInputs = with self; [
|
||||
|
@ -24077,26 +24071,7 @@ EOF
|
|||
};
|
||||
|
||||
|
||||
unidecode = buildPythonPackage rec {
|
||||
name = "Unidecode-0.04.18";
|
||||
|
||||
src = pkgs.fetchurl {
|
||||
url = "mirror://pypi/U/Unidecode/${name}.tar.gz";
|
||||
sha256 = "12hhblqy1ajvidm38im4171x4arg83pfmziyn53nizp29p3m14gi";
|
||||
};
|
||||
|
||||
LC_ALL="en_US.UTF-8";
|
||||
|
||||
buildInputs = [ pkgs.glibcLocales ];
|
||||
|
||||
meta = {
|
||||
homepage = http://pypi.python.org/pypi/Unidecode/;
|
||||
description = "ASCII transliterations of Unicode text";
|
||||
license = licenses.gpl2;
|
||||
maintainers = with maintainers; [ domenkozar ];
|
||||
};
|
||||
};
|
||||
|
||||
unidecode = callPackage ../development/python-modules/unidecode {};
|
||||
|
||||
pyusb = buildPythonPackage rec {
|
||||
name = "pyusb-1.0.0";
|
||||
|
@ -27214,6 +27189,12 @@ EOF
|
|||
|
||||
spacy = callPackage ../development/python-modules/spacy { };
|
||||
|
||||
spacy_models = callPackage ../development/python-modules/spacy/models.nix { };
|
||||
|
||||
textacy = callPackage ../development/python-modules/textacy { };
|
||||
|
||||
pyemd = callPackage ../development/python-modules/pyemd { };
|
||||
|
||||
behave = callPackage ../development/python-modules/behave { };
|
||||
|
||||
pyhamcrest = callPackage ../development/python-modules/pyhamcrest { };
|
||||
|
|
Loading…
Reference in a new issue