Skip to content

python311Packages.lexilang: init at 1.0.1, python311Packages.libretranslate: 1.5.2 -> 1.5.5#282824

Closed
fabaff wants to merge 3 commits intoNixOS:masterfrom
fabaff:libretranslate-fix
Closed

python311Packages.lexilang: init at 1.0.1, python311Packages.libretranslate: 1.5.2 -> 1.5.5#282824
fabaff wants to merge 3 commits intoNixOS:masterfrom
fabaff:libretranslate-fix

Conversation

@fabaff
Copy link
Member

@fabaff fabaff commented Jan 22, 2024

Description of changes

Fix build (https://hydra.nixos.org/build/246735645)

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@fabaff fabaff added the 0.kind: build failure A package fails to build label Jan 22, 2024
@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Jan 22, 2024
@fabaff

This comment was marked as outdated.

@ofborg ofborg bot added the 8.has: package (new) This PR adds a new package label Jan 22, 2024
@ofborg ofborg bot requested a review from misuzu January 22, 2024 08:54
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Jan 22, 2024
@misuzu
Copy link
Contributor

misuzu commented Jan 22, 2024

Translation works, but language detection is broken, logs:

% /nix/store/6r3kq4bja9ihyr09kbrf0zllfm3n1rn8-python3.11-libretranslate-1.5.5/bin/libretranslate --host 0.0.0.0 
Running on http://0.0.0.0:5000
WARNING:waitress.queue:Task queue depth is 1
WARNING:waitress.queue:Task queue depth is 2
WARNING:waitress.queue:Task queue depth is 2
WARNING:waitress.queue:Task queue depth is 1
Compiling database...
[Errno 2] No such file or directory: '/nix/store/wwknzccd07xfxjv03c59xfv5x8z45sqi-python3.11-lexilang-1.0.1/lib/python3.11/site-packages/dictionaries/afrikaans.txt'

@Izorkin
Copy link
Contributor

Izorkin commented Feb 20, 2024

Package added in upstream, Update this PR?

@fabaff fabaff force-pushed the libretranslate-fix branch from e08e9d6 to 4f0d14e Compare February 21, 2024 00:15
@fabaff
Copy link
Member Author

fabaff commented Feb 21, 2024

Translation works, but language detection is broken, logs:

Seems to work for me. But no expert on libretranslate here.

$ ./result/bin/libretranslate --host 0.0.0.0
Updating language models
Found 86 models
Downloading Albanian → English (1.9) ...
Downloading Arabic → English (1.0) ...
[....]

@fabaff
Copy link
Member Author

fabaff commented Feb 21, 2024

Result of nixpkgs-review pr 282824 run on x86_64-linux 1

6 packages built:
  • libretranslate (python311Packages.libretranslate)
  • libretranslate.dist (python311Packages.libretranslate.dist)
  • python311Packages.lexilang
  • python311Packages.lexilang.dist
  • python312Packages.lexilang
  • python312Packages.lexilang.dist

@ofborg ofborg bot requested a review from Izorkin February 21, 2024 00:45
@misuzu
Copy link
Contributor

misuzu commented Feb 21, 2024

Seems to work for me. But no expert on libretranslate here.

Request:

% curl 'http://0.0.0.0:5000/detect' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'q=guten%20morgen'

[{"confidence":0.0,"language":"en"}]

Logs:

Running on http://0.0.0.0:5000
Compiling database...
[Errno 2] No such file or directory: '/nix/store/r1k8wqws2bcdw5s8bkh46b6f6x3fyamq-python3.11-lexilang-1.0.1/lib/python3.11/site-packages/dictionaries/afrikaans.txt'

@Izorkin
Copy link
Contributor

Izorkin commented Feb 21, 2024

Update lexilang:

diff --git a/pkgs/development/python-modules/lexilang/default.nix b/pkgs/development/python-modules/lexilang/default.nix
index 5bd64ae8b760..5e75dac8848d 100644
--- a/pkgs/development/python-modules/lexilang/default.nix
+++ b/pkgs/development/python-modules/lexilang/default.nix
@@ -24,6 +24,10 @@ buildPythonPackage rec {
     setuptools
   ];

+  postBuild = ''
+    ${python.interpreter} test.py
+  '';
+
   checkPhase = ''
     runHook preCheck
     ${python.interpreter} test.py
@@ -34,6 +38,12 @@ buildPythonPackage rec {
     "lexilang"
   ];

+  postInstall = ''
+    cp -r $src/dictionaries/ $out/lib/python3.11/site-packages/
+    mkdir $out/lib/python3.11/site-packages/lexilang/data
+    cp $TMP/source/lexilang/data/words.pickle $out/lib/python3.11/site-packages/lexilang/data/words.pickle
+  '';
+

@Izorkin
Copy link
Contributor

Izorkin commented Feb 21, 2024

Any ideas on how to fix it?

WARNING: Language en package default expects mwt, which has been added

@Izorkin
Copy link
Contributor

Izorkin commented Mar 13, 2024

is there progress?

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 21, 2024
@wegank
Copy link
Member

wegank commented Jul 6, 2024

Done in #281850 and #295068.

@wegank wegank closed this Jul 6, 2024
@fabaff fabaff deleted the libretranslate-fix branch December 18, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.kind: build failure A package fails to build 2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: python Python is a high-level, general-purpose programming language. 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants