All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Ralf Dragon <hypnotoad@lindra.de>
Cc: Julien Olivain <ju.o@free.fr>,
	gwenhael.goavec-merou@trabucayre.com, yann.morin.1998@free.fr,
	asafka7@gmail.com, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 2/2] python-qt5: add PyQt5.sip module
Date: Sun, 17 Dec 2023 23:07:04 +0100	[thread overview]
Message-ID: <20231217230704.003200c7@windsurf> (raw)
In-Reply-To: <20231212160112.94272-2-hypnotoad@lindra.de>

Hello Ralf,

On Tue, 12 Dec 2023 17:01:12 +0100
Ralf Dragon <hypnotoad@lindra.de> wrote:

> This fixes the following runtime error when importing PyQt5 in python:
> 
> from PyQt5.QtCore import *
> ModuleNotFoundError: No module named 'PyQt5.sip'

So it means that python-pyqt5 requires this new python-pyqt5-sip
package? How come has python-pyqt5 ever worked?

> diff --git a/package/python-pyqt5-sip/Config.in b/package/python-pyqt5-sip/Config.in
> new file mode 100644
> index 0000000000..6f26271f70
> --- /dev/null
> +++ b/package/python-pyqt5-sip/Config.in
> @@ -0,0 +1,6 @@
> +config BR2_PACKAGE_PYTHON_PYQT5_SIP
> +	bool "python-pyqt5-sip"
> +	depends on BR2_PACKAGE_PYTHON_PYQT5
> +	depends on BR2_PACKAGE_PYTHON_SIP

But, but, according to what you described above, it seems like
python-pyqt5 needs python-pyqt5-sip, but here you have a
python-pyqt5-sip -> python-pyqt5 dependency.

So with your patch applied, it's still possible to enable only
python-pyqt5, so we would still have the failure you're mentioning in
your commit log.

Could you clarify?

Also, it would very, very good to add a runtime test case in
support/testing/ for this, as such Python issues are only visible at
runtime. I have added Julien Olivain in Cc, who can probably help with
this, as he is our resident expert in writing support/testing tests :-)

> diff --git a/package/python-pyqt5-sip/python-pyqt5-sip.hash b/package/python-pyqt5-sip/python-pyqt5-sip.hash
> new file mode 100644
> index 0000000000..8039cdafd9
> --- /dev/null
> +++ b/package/python-pyqt5-sip/python-pyqt5-sip.hash
> @@ -0,0 +1,4 @@
> +# from https://pypi.org/project/PyQt5-sip/12.12.1
> +

Empty line not needed.

> +sha256  8fdc6e0148abd12d977a1d3828e7b79aae958e83c6cb5adae614916d888a6b10  PyQt5_sip-12.12.1.tar.gz
> +md5  c2117da3b4c0e081c1c5a9088b8a4d55  PyQt5_sip-12.12.1.tar.gz
> diff --git a/package/python-pyqt5-sip/python-pyqt5-sip.mk b/package/python-pyqt5-sip/python-pyqt5-sip.mk
> new file mode 100644
> index 0000000000..3f689b9d47
> --- /dev/null
> +++ b/package/python-pyqt5-sip/python-pyqt5-sip.mk
> @@ -0,0 +1,15 @@
> +################################################################################
> +#
> +# python-SIP-QT5

Should be all lower-case.

> +#
> +################################################################################
> +
> +PYTHON_PYQT5_SIP_VERSION = 12.12.1
> +PYTHON_PYQT5_SIP_SITE = https://files.pythonhosted.org/packages/c1/61/4055e7a0f36339964956ff415e36f4abf82561904cc49c021da32949fc55
> +PYTHON_PYQT5_SIP_SOURCE = PyQt5_sip-$(PYTHON_PYQT5_SIP_VERSION).tar.gz
> +PYTHON_PYQT5_SIP_LICENSE = MIT
> +PYTHON_PYQT5_SIP_LICENSE_FILES = LICENSE
> +PYTHON_PYQT5_SIP_SETUP_TYPE = setuptools
> +PYTHON_PYQT5_SIP_DEPENDENCIES += python-sip

No +=, just =.

> +
> +$(eval $(python-package))
> diff --git a/package/python-pyqt5/Config.in b/package/python-pyqt5/Config.in
> index 9fa7676f98..c2a1976950 100644
> --- a/package/python-pyqt5/Config.in
> +++ b/package/python-pyqt5/Config.in
> @@ -5,6 +5,7 @@ config BR2_PACKAGE_PYTHON_PYQT5
>  	bool "python-pyqt5"
>  	depends on BR2_PACKAGE_QT5
>  	select BR2_PACKAGE_PYTHON_SIP
> +	select BR2_PACKAGE_PYTHON_PYQT5_SIP

Ah, so python-pyqt5 now selects python-pyqt5-sip, and python-pyqt5-sip
also selects python-pyqt5. This sounds like a circular dependency.

Could you perhaps give a bit more background, so that we can provide
some better guidance on how to resolve this issue properly?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2023-12-17 22:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-12 16:01 [Buildroot] [PATCH 1/2] python-sip: fix compile error Ralf Dragon
2023-12-12 16:01 ` [Buildroot] [PATCH 2/2] python-qt5: add PyQt5.sip module Ralf Dragon
2023-12-17 22:07   ` Thomas Petazzoni via buildroot [this message]
2023-12-18 18:22     ` Ralf Dragon
2023-12-18 19:51       ` Thomas Petazzoni via buildroot
     [not found]         ` <f329f198-4cb1-4e61-8e47-0653cab03893@lindra.de>
2023-12-19 19:36           ` Ralf Dragon
2024-01-02 21:48           ` Ralf Dragon
2023-12-18 18:58     ` Ralf Dragon
2024-01-10 19:21     ` Julien Olivain
2024-01-10 19:58       ` Thomas Petazzoni via buildroot
2024-03-10 13:25   ` Julien Olivain
2023-12-17 22:03 ` [Buildroot] [PATCH 1/2] python-sip: fix compile error Thomas Petazzoni via buildroot
2024-01-05 12:41 ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231217230704.003200c7@windsurf \
    --to=buildroot@buildroot.org \
    --cc=asafka7@gmail.com \
    --cc=gwenhael.goavec-merou@trabucayre.com \
    --cc=hypnotoad@lindra.de \
    --cc=ju.o@free.fr \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=yann.morin.1998@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.