diff mbox series

[2/4] python-cffi: always install target python-pycparser

Message ID 20171213090424.11172-2-yegorslists@googlemail.com
State Superseded
Headers show
Series [1/4] python-more-itertools: new package | expand

Commit Message

Yegor Yefremov Dec. 13, 2017, 9:04 a.m. UTC
From: Yegor Yefremov <yegorslists@googlemail.com>

Some packages like python-crossbar, python-keyring use scripts,
that check dependencies of all involved packages at runtime. And
though cffi needs pycparser only in host variant during the bindings
compilation, it still has pycparser in its setup.py as dependency.

So always installing pycparser along with cffi would create rather
little overhead, but we won't have to check whether particular
package has such a runtime script, that checks for dependencies.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 package/python-cffi/Config.in     | 1 +
 package/python-crossbar/Config.in | 1 -
 2 files changed, 1 insertion(+), 1 deletion(-)

Comments

Thomas Petazzoni Dec. 16, 2017, 3:37 p.m. UTC | #1
Hello,

On Wed, 13 Dec 2017 10:04:22 +0100, yegorslists@googlemail.com wrote:

> Some packages like python-crossbar, python-keyring use scripts,
> that check dependencies of all involved packages at runtime. And
> though cffi needs pycparser only in host variant during the bindings
> compilation, it still has pycparser in its setup.py as dependency.

It is not entirely clear to me what is happening here. Could you expand
a bit on this?

> So always installing pycparser along with cffi would create rather
> little overhead, but we won't have to check whether particular
> package has such a runtime script, that checks for dependencies.

I understand what you mean, but I find the wording confusing. It feels
as if you're saying that you're not going to do the change... that
you're doing in this commit.

What about:

"Since adding pycparser as a dependency to python-cffi adds only very
little overhead, we chose this solution as it avoids having to ..."

Thanks,

Thomas
Yegor Yefremov Dec. 16, 2017, 9:14 p.m. UTC | #2
On Sat, Dec 16, 2017 at 4:37 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Hello,
>
> On Wed, 13 Dec 2017 10:04:22 +0100, yegorslists@googlemail.com wrote:
>
>> Some packages like python-crossbar, python-keyring use scripts,
>> that check dependencies of all involved packages at runtime. And
>> though cffi needs pycparser only in host variant during the bindings
>> compilation, it still has pycparser in its setup.py as dependency.
>
> It is not entirely clear to me what is happening here. Could you expand
> a bit on this?

Let's take python-cryptography, the package using CFFI. But we don't
install target pycparser. We can use python-cryptography. But for
example keyring has a script named "keyring". And even if you just
invoke it with "--help" parameter, it will complain, that you don't
have pycparser, because in setuptools "database" cffi package has
pycaprser in its install_requires field in setup.py.

Actually pycparser is a runtime dependency of cffi [1] and though it
is not really needed on target, we have a full moral right to select
this package. So I could just change the patch title to "add missing
runtime dependency".

[1] https://bitbucket.org/cffi/cffi/src/9b653b9a1c876ac94951b980d8dc0ce63dfd0a72/setup.py?at=default&fileviewer=file-view-default#setup.py-214

Yegor

>> So always installing pycparser along with cffi would create rather
>> little overhead, but we won't have to check whether particular
>> package has such a runtime script, that checks for dependencies.
>
> I understand what you mean, but I find the wording confusing. It feels
> as if you're saying that you're not going to do the change... that
> you're doing in this commit.
>
> What about:
>
> "Since adding pycparser as a dependency to python-cffi adds only very
> little overhead, we chose this solution as it avoids having to ..."
>
> Thanks,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com
diff mbox series

Patch

diff --git a/package/python-cffi/Config.in b/package/python-cffi/Config.in
index 3805d3d10a..bc9f6a296d 100644
--- a/package/python-cffi/Config.in
+++ b/package/python-cffi/Config.in
@@ -1,6 +1,7 @@ 
 config BR2_PACKAGE_PYTHON_CFFI
 	bool "python-cffi"
 	select BR2_PACKAGE_LIBFFI
+	select BR2_PACKAGE_PYTHON_PYCPARSER # runtime
 	help
 	  This is the Foreign Function Interface for Python calling C
 	  code. The aim of this project is to provide a convenient
diff --git a/package/python-crossbar/Config.in b/package/python-crossbar/Config.in
index faec922e50..2a98467bd4 100644
--- a/package/python-crossbar/Config.in
+++ b/package/python-crossbar/Config.in
@@ -5,7 +5,6 @@  config BR2_PACKAGE_PYTHON_CROSSBAR
 	select BR2_PACKAGE_PYTHON_AUTOBAHN
 	select BR2_PACKAGE_PYTHON_CBOR
 	select BR2_PACKAGE_PYTHON_CLICK
-	select BR2_PACKAGE_PYTHON_PYCPARSER
 	select BR2_PACKAGE_PYTHON_CRYPTOGRAPHY
 	select BR2_PACKAGE_PYTHON_JINJA2
 	select BR2_PACKAGE_PYTHON_LMDB