python312Packages.pymupdf: fix "mupdf not found" import error#334596
python312Packages.pymupdf: fix "mupdf not found" import error#334596bennofs wants to merge 1 commit intoNixOS:masterfrom
Conversation
There was a problem hiding this comment.
In 4a3db5a (#298783) @dotlambda proposed to move it to buildInputs. What is more correct? I am undecided.
There was a problem hiding this comment.
Are buildInputs even included in the environment when using pythonWithPackages envs? Mupdf itself provides a python module, so it needs to be part of the env, and I don't see how moving this to buildInputs changes that?
There was a problem hiding this comment.
But I am not 100% familiar with the python nix packaging. From the documentation, I think the most correct would be to put it in "dependencies"?
There was a problem hiding this comment.
Yes, dependencies would be best. However it is currently roughly equivalent to propagatedBuildInputs anyway.
There was a problem hiding this comment.
dependencies sounds correct to me.
dotlambda
left a comment
There was a problem hiding this comment.
Please fix the commit message.
|
Should we merge this? |
|
How do I test this? I tried to set but that results in errors "attribute 'pip' missing" and "attribute 'python' missing". |
|
This can be tested using Before the PR: After the PR: This PR actually fixes the import error, since I've tested this on x86_64-linux, aarch64-linux and aarch64-darwin. (If you want to test this on Darwin make sure to apply the related tesseract-codesigning-fix from here first: #352788) |
Any idea why that's not caught by |
|
Out of curiosity, is there anything blocking this from moving forward? |
|
there is a merge conflict @bennofs Edit: I just noticed you are in Nixpkgs/retired-nixpkgs-contributors, can you clarify here once if you intend to see this pr through or whether someone else can pick it up. |
I'm happy if someone else picks it up, no need to wait for me :) |
Wouldn't uv2nix then have the same problem for any other python package that use the nixpkgs way to depend on native packages? Or is there something special about pymupdf here. My opinion is that we should be consistent within nixpkgs, and I believe the rest of nixpkgs uses the |
Fixes the following error:
```
Traceback (most recent call last):
File "/nix/store/73znvwd538dglfsk2wdixj106i5infjn-python3-3.11.9-env/lib/python3.11/site-packages/fitz/__init__.py", line 140, in <module>
from . import mupdf
ImportError: cannot import name 'mupdf' from partially initialized module 'fitz' (most likely due to a circular import) (/nix/store/73znvwd538dglfsk2wdixj106i5infjn-python3-3.11.9-env/lib/python3.11/site-packages/fitz/__init__.py)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/nix/store/73znvwd538dglfsk2wdixj106i5infjn-python3-3.11.9-env/lib/python3.11/site-packages/fitz/__init__.py", line 142, in <module>
import mupdf
```
|
Actually, this change has already been applied on master independently of this PR, as commit 36354c7. So this PR is no longer relevant. |
Description of changes
Fixes the following error:
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.