nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

python3Packages.unidic: init at 1.1.0 Co-authored-by: Sandro <sandro.jaeckel@gmail.com> Co-authored-by: OTABI Tomoya <contact@natsukium.com>

Laureηt e2d726c1 3f41c7d4

+77
+52
pkgs/development/python-modules/unidic/default.nix
··· 1 + { lib 2 + , buildPythonPackage 3 + , fetchFromGitHub 4 + , pythonOlder 5 + , mecab 6 + , setuptools-scm 7 + , requests 8 + , tqdm 9 + , wasabi 10 + , plac 11 + , cython 12 + , platformdirs 13 + }: 14 + 15 + buildPythonPackage rec { 16 + pname = "unidic"; 17 + version = "1.1.0"; 18 + format = "setuptools"; 19 + disabled = pythonOlder "3.7"; 20 + 21 + src = fetchFromGitHub { 22 + owner = "polm"; 23 + repo = "unidic-py"; 24 + rev = "refs/tags/v${version}"; 25 + hash = "sha256-srhQDXGgoIMhYuCbyQB3kF4LrODnoOqLbjBQMvhPieY="; 26 + }; 27 + 28 + patches = [ ./fix-download-directory.patch ]; 29 + 30 + postPatch = '' 31 + substituteInPlace setup.cfg \ 32 + --replace "wasabi>=0.6.0,<1.0.0" "wasabi" 33 + ''; 34 + 35 + # no tests 36 + doCheck = false; 37 + 38 + SETUPTOOLS_SCM_PRETEND_VERSION = version; 39 + 40 + propagatedBuildInputs = [ requests tqdm wasabi plac platformdirs ]; 41 + 42 + nativeBuildInputs = [ cython mecab setuptools-scm ]; 43 + 44 + pythonImportsCheck = [ "unidic" ]; 45 + 46 + meta = with lib; { 47 + description = "Contemporary Written Japanese dictionary"; 48 + homepage = "https://github.com/polm/unidic-py"; 49 + license = licenses.mit; 50 + maintainers = with maintainers; [ laurent-f1z1 ]; 51 + }; 52 + }
+23
pkgs/development/python-modules/unidic/fix-download-directory.patch
··· 1 + diff --git a/unidic/download.py b/unidic/download.py 2 + index 445ce55..d488bd6 100644 3 + --- a/unidic/download.py 4 + +++ b/unidic/download.py 5 + @@ -6,6 +6,8 @@ import sys 6 + from wasabi import msg 7 + from urllib.request import urlretrieve 8 + from tqdm import tqdm 9 + +from platformdirs import user_cache_dir 10 + +from pathlib import Path 11 + 12 + # This is used to show progress when downloading. 13 + # see here: https://github.com/tqdm/tqdm#hooks-and-callbacks 14 + @@ -56,7 +58,8 @@ def download_and_clean(version, url, dirname='unidic', delfiles=[]): 15 + This downloads the zip file from the source, extracts it, renames the 16 + resulting directory, and removes large files not used at runtime. 17 + """ 18 + - cdir = os.path.dirname(os.path.abspath(__file__)) 19 + + cdir = Path(user_cache_dir('unidic-py')) 20 + + cdir.mkdir(parents=True, exist_ok=True) 21 + fname = os.path.join(cdir, 'unidic.zip') 22 + print("Downloading UniDic v{}...".format(version), file=sys.stderr) 23 + download_progress(url, fname)
+2
pkgs/top-level/python-packages.nix
··· 12596 12596 12597 12597 unidecode = callPackage ../development/python-modules/unidecode { }; 12598 12598 12599 + unidic = callPackage ../development/python-modules/unidic { }; 12600 + 12599 12601 unidic-lite = callPackage ../development/python-modules/unidic-lite { }; 12600 12602 12601 12603 unidiff = callPackage ../development/python-modules/unidiff { };