Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python.pkgs.pyqt5: 5.10.1 -> 5.11.3 #49400

Closed
wants to merge 2 commits into from

Conversation

dotlambda
Copy link
Member

Motivation for this change

Qutebrowser complains about needing Qt 5.11 when setting content.cookies.accept to no-3rdparty.

When running qutebrowser with this version of pyqt5, I get ModuleNotFoundError: No module named 'PyQt5.sip'.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

cc @svanderburg

@nyanloutre
Copy link
Member

nyanloutre commented Dec 5, 2018

I also get ModuleNotFoundError: No module named 'PyQt5.sip' when using the pyrcc5 tool

It seems the sip module is now bundled in pyqt: http://pyqt.sourceforge.net/Docs/PyQt5/incompatibilities.html

This might be the solution: https://riverbankcomputing.com/pipermail/pyqt/2018-July/040494.html

Details:

WIP patch (not working):

diff --git a/pkgs/development/python-modules/sip/default.nix b/pkgs/development/python-modules/sip/default.nix
index f8cc7e8dc45..ee8a1ffbafc 100644
--- a/pkgs/development/python-modules/sip/default.nix
+++ b/pkgs/development/python-modules/sip/default.nix
@@ -14,6 +14,7 @@ buildPythonPackage rec {

   configurePhase = ''
     ${python.executable} ./configure.py \
+      --sip-module PyQt5.sip \
       -d $out/lib/${python.libPrefix}/site-packages \
       -b $out/bin -e $out/include
   '';

Maybe we should create a sip module dedicated for pyqt5 (with the --sip-module) and a standard sip module to be used outside (if it's useful)

@nyanloutre nyanloutre mentioned this pull request Dec 10, 2018
10 tasks
@nyanloutre
Copy link
Member

This is the behavior observed with the above patch applied

➜ nix-shell -I nixpkgs=. -p python3Packages.pyqt5 python3

[nix-shell:~/nixpkgs]$ echo $PYTHONPATH
/nix/store/93bfhjg1cr2650in7wzqv309kdyl7i8b-python3.7-sip-4.19.13/lib/python3.7/site-packages:/nix/store/9vcy8i7mcwmcp486krc22v7851spcdqj-python3-3.7.1/lib/python3.7/site-packages:/nix/store/q4bf5k1j6xgs621jp3mxmydxjxgfbalj-python3.7-setuptools-40.6.2/lib/python3.7/site-packages:/nix/store/pgpkq47dbakpcpmkf7gsw8d9kd4pv14f-python3.7-PyQt-5.11.3/lib/python3.7/site-packages:/nix/store/93bfhjg1cr2650in7wzqv309kdyl7i8b-python3.7-sip-4.19.13/lib/python3.7/site-packages:/nix/store/9vcy8i7mcwmcp486krc22v7851spcdqj-python3-3.7.1/lib/python3.7/site-packages:/nix/store/q4bf5k1j6xgs621jp3mxmydxjxgfbalj-python3.7-setuptools-40.6.2/lib/python3.7/site-packages:/nix/store/pgpkq47dbakpcpmkf7gsw8d9kd4pv14f-python3.7-PyQt-5.11.3/lib/python3.7/site-packages

[nix-shell:~/nixpkgs]$ python
Python 3.7.1 (default, Oct 20 2018, 06:25:16)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt5.sip
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'PyQt5.sip'
>>>

[nix-shell:~/nixpkgs]$ exit

➜ nix-shell -I nixpkgs=. -p python3Packages.sip python3

[nix-shell:~/nixpkgs]$ echo $PYTHONPATH
/nix/store/93bfhjg1cr2650in7wzqv309kdyl7i8b-python3.7-sip-4.19.13/lib/python3.7/site-packages:/nix/store/9vcy8i7mcwmcp486krc22v7851spcdqj-python3-3.7.1/lib/python3.7/site-packages:/nix/store/q4bf5k1j6xgs621jp3mxmydxjxgfbalj-python3.7-setuptools-40.6.2/lib/python3.7/site-packages:/nix/store/93bfhjg1cr2650in7wzqv309kdyl7i8b-python3.7-sip-4.19.13/lib/python3.7/site-packages:/nix/store/9vcy8i7mcwmcp486krc22v7851spcdqj-python3-3.7.1/lib/python3.7/site-packages:/nix/store/q4bf5k1j6xgs621jp3mxmydxjxgfbalj-python3.7-setuptools-40.6.2/lib/python3.7/site-packages

[nix-shell:~/nixpkgs]$ python
Python 3.7.1 (default, Oct 20 2018, 06:25:16)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import PyQt5.sip
>>>

[nix-shell:~/nixpkgs]$ exit

I don't know why it fails in the first case because the sip module is in the PYTHONPATH and the only thing added is python3.7-PyQt

@veprbl
Copy link
Member

veprbl commented Dec 20, 2018

Well, this has landed to master.

@nyanloutre I can still reproduce your issue. I think you are on the right track about solving this. It seems like your last problem is because sip.so needs to be in the same directory with the rest of PyQt5 module in order for it to be loadable. If they are in separate prefixes, then you'll only be able to load either PyQt5.sip or the real PyQt5.<stuff> depending on whichever instance of PyQt5 module is discovered first. I think you could just make so that necessary parts of modified pythonPackages.sip are copied over in postInstall of the pyqt5.

@nyanloutre
Copy link
Member

nyanloutre commented Dec 21, 2018

@veprbl thanks for the suggestion, I will try to simlink the sip library in the right pyqt5 directory

EDIT: it's working with a simlink (and the sip package can be left as it is)

nyanloutre added a commit to nyanloutre/nixpkgs that referenced this pull request Dec 21, 2018
@dotlambda dotlambda closed this Dec 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants