diff mbox series

[1/1] python-fastentrypoints: new package

Message ID 20180409180403.11728-1-asafka7@gmail.com
State Accepted
Headers show
Series [1/1] python-fastentrypoints: new package | expand

Commit Message

Asaf Kahlon April 9, 2018, 6:04 p.m. UTC
host-package that is able to shorten the load time of entry_points declared
in setup.py of python packages.

Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
---
 DEVELOPERS                                         |  1 +
 package/Config.in.host                             |  1 +
 package/python-fastentrypoints/Config.in.host      |  6 ++++++
 .../python-fastentrypoints.hash                    |  4 ++++
 .../python-fastentrypoints.mk                      | 14 ++++++++++++++
 5 files changed, 26 insertions(+)
 create mode 100644 package/python-fastentrypoints/Config.in.host
 create mode 100644 package/python-fastentrypoints/python-fastentrypoints.hash
 create mode 100644 package/python-fastentrypoints/python-fastentrypoints.mk

Comments

Thomas Petazzoni April 9, 2018, 7:01 p.m. UTC | #1
Hello,

On Mon,  9 Apr 2018 21:04:03 +0300, Asaf Kahlon wrote:
> host-package that is able to shorten the load time of entry_points declared
> in setup.py of python packages.
> 
> Signed-off-by: Asaf Kahlon <asafka7@gmail.com>

Thanks for this new version. Could you give some details on how you're
using this host package ? I.e what you are doing with it exactly ?

Thanks,

Thomas
Asaf Kahlon April 9, 2018, 7:47 p.m. UTC | #2
Yes, of course.

After the compilation of this package, you'll have an executable called
fastep under $(HOST_DIR)/usr/bin.
Then you can run fastep on a directory of a python package, and it'll speed
up the console_scripts declared on your setup.py.
What it really does is copying fastentrypoints,py to the directory, adding
it to MANIFEST.in, and adding an import on setup.py, which is actually a
monkey-patch.

It can be very useful on systems with limited resources where importing
pkg_resources can take a long time.
If you want, you can even take it further and write pkg-fastep.mk. Then you
can use it for the relevant python packages. It will add the needed
dependency and run fastep on the package directory.

Asaf.

On Mon, Apr 9, 2018 at 10:01 PM, Thomas Petazzoni <
thomas.petazzoni@bootlin.com> wrote:

> Hello,
>
> On Mon,  9 Apr 2018 21:04:03 +0300, Asaf Kahlon wrote:
> > host-package that is able to shorten the load time of entry_points
> declared
> > in setup.py of python packages.
> >
> > Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
>
> Thanks for this new version. Could you give some details on how you're
> using this host package ? I.e what you are doing with it exactly ?
>
> Thanks,
>
> Thomas
> --
> Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
> Embedded Linux and Kernel engineering
> https://bootlin.com
>
<div dir="ltr">Yes, of course.<div><br><div>After the compilation of this package, you&#39;ll have an executable called fastep under $(HOST_DIR)/usr/bin.</div><div>Then you can run fastep on a directory of a python package, and it&#39;ll speed up the console_scripts declared on your setup.py.</div><div>What it really does is copying fastentrypoints,py to the directory, adding it to MANIFEST.in, and adding an import on setup.py, which is actually a monkey-patch.</div><div><br></div><div>It can be very useful on systems with limited resources where importing pkg_resources can take a long time.</div><div>If you want, you can even take it further and write <a href="http://pkg-fastep.mk">pkg-fastep.mk</a>. Then you can use it for the relevant python packages. It will add the needed dependency and run fastep on the package directory.</div></div><div><br></div><div>Asaf.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 9, 2018 at 10:01 PM, Thomas Petazzoni <span dir="ltr">&lt;<a href="mailto:thomas.petazzoni@bootlin.com" target="_blank">thomas.petazzoni@bootlin.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<span class=""><br>
On Mon,  9 Apr 2018 21:04:03 +0300, Asaf Kahlon wrote:<br>
&gt; host-package that is able to shorten the load time of entry_points declared<br>
&gt; in setup.py of python packages.<br>
&gt;<br>
&gt; Signed-off-by: Asaf Kahlon &lt;<a href="mailto:asafka7@gmail.com">asafka7@gmail.com</a>&gt;<br>
<br>
</span>Thanks for this new version. Could you give some details on how you&#39;re<br>
using this host package ? I.e what you are doing with it exactly ?<br>
<br>
Thanks,<br>
<div class="HOEnZb"><div class="h5"><br>
Thomas<br>
--<br>
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)<br>
Embedded Linux and Kernel engineering<br>
<a href="https://bootlin.com" rel="noreferrer" target="_blank">https://bootlin.com</a><br>
</div></div></blockquote></div><br></div></div>
Asaf Kahlon April 10, 2018, 8:02 p.m. UTC | #3
Hello,

Is there anything new with my patch? Should I add/change something?

Thanks,
Asaf.

On Mon, Apr 9, 2018 at 10:47 PM, Asaf Kahlon <asafka7@gmail.com> wrote:

> Yes, of course.
>
> After the compilation of this package, you'll have an executable called
> fastep under $(HOST_DIR)/usr/bin.
> Then you can run fastep on a directory of a python package, and it'll
> speed up the console_scripts declared on your setup.py.
> What it really does is copying fastentrypoints,py to the directory, adding
> it to MANIFEST.in, and adding an import on setup.py, which is actually a
> monkey-patch.
>
> It can be very useful on systems with limited resources where importing
> pkg_resources can take a long time.
> If you want, you can even take it further and write pkg-fastep.mk. Then
> you can use it for the relevant python packages. It will add the needed
> dependency and run fastep on the package directory.
>
> Asaf.
>
> On Mon, Apr 9, 2018 at 10:01 PM, Thomas Petazzoni <
> thomas.petazzoni@bootlin.com> wrote:
>
>> Hello,
>>
>> On Mon,  9 Apr 2018 21:04:03 +0300, Asaf Kahlon wrote:
>> > host-package that is able to shorten the load time of entry_points
>> declared
>> > in setup.py of python packages.
>> >
>> > Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
>>
>> Thanks for this new version. Could you give some details on how you're
>> using this host package ? I.e what you are doing with it exactly ?
>>
>> Thanks,
>>
>> Thomas
>> --
>> Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
>> Embedded Linux and Kernel engineering
>> https://bootlin.com
>>
>
>
<div dir="ltr">Hello,<div><br></div><div>Is there anything new with my patch? Should I add/change something?</div><div><br></div><div>Thanks,</div><div>Asaf.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 9, 2018 at 10:47 PM, Asaf Kahlon <span dir="ltr">&lt;<a href="mailto:asafka7@gmail.com" target="_blank">asafka7@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Yes, of course.<div><br><div>After the compilation of this package, you&#39;ll have an executable called fastep under $(HOST_DIR)/usr/bin.</div><div>Then you can run fastep on a directory of a python package, and it&#39;ll speed up the console_scripts declared on your setup.py.</div><div>What it really does is copying fastentrypoints,py to the directory, adding it to MANIFEST.in, and adding an import on setup.py, which is actually a monkey-patch.</div><div><br></div><div>It can be very useful on systems with limited resources where importing pkg_resources can take a long time.</div><div>If you want, you can even take it further and write <a href="http://pkg-fastep.mk" target="_blank">pkg-fastep.mk</a>. Then you can use it for the relevant python packages. It will add the needed dependency and run fastep on the package directory.</div></div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Asaf.</div></font></span><div><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 9, 2018 at 10:01 PM, Thomas Petazzoni <span dir="ltr">&lt;<a href="mailto:thomas.petazzoni@bootlin.com" target="_blank">thomas.petazzoni@bootlin.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<span><br>
On Mon,  9 Apr 2018 21:04:03 +0300, Asaf Kahlon wrote:<br>
&gt; host-package that is able to shorten the load time of entry_points declared<br>
&gt; in setup.py of python packages.<br>
&gt;<br>
&gt; Signed-off-by: Asaf Kahlon &lt;<a href="mailto:asafka7@gmail.com" target="_blank">asafka7@gmail.com</a>&gt;<br>
<br>
</span>Thanks for this new version. Could you give some details on how you&#39;re<br>
using this host package ? I.e what you are doing with it exactly ?<br>
<br>
Thanks,<br>
<div class="m_-4995111288112529453HOEnZb"><div class="m_-4995111288112529453h5"><br>
Thomas<br>
--<br>
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)<br>
Embedded Linux and Kernel engineering<br>
<a href="https://bootlin.com" rel="noreferrer" target="_blank">https://bootlin.com</a><br>
</div></div></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>
Thomas Petazzoni April 28, 2018, 1:09 p.m. UTC | #4
Hello,

On Tue, 10 Apr 2018 23:02:12 +0300, Asaf Kahlon wrote:

> Is there anything new with my patch? Should I add/change something?

I'd like to hear from Yegor about this patch. Yegor, could you comment
on this patch ?

Thanks!!

Thomas
Yegor Yefremov April 28, 2018, 6:58 p.m. UTC | #5
On Sat, Apr 28, 2018 at 3:09 PM, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
> Hello,
>
> On Tue, 10 Apr 2018 23:02:12 +0300, Asaf Kahlon wrote:
>
>> Is there anything new with my patch? Should I add/change something?
>
> I'd like to hear from Yegor about this patch. Yegor, could you comment
> on this patch ?

I'm OK with this patch. This package could be helpful for the
python-crossbar testing as it takes ages to start crossbar script.

Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>

Yegor
Asaf Kahlon July 14, 2018, 8:09 a.m. UTC | #6
ping

On Sat, Apr 28, 2018 at 9:58 PM Yegor Yefremov <yegorslists@googlemail.com>
wrote:

> On Sat, Apr 28, 2018 at 3:09 PM, Thomas Petazzoni
> <thomas.petazzoni@bootlin.com> wrote:
> > Hello,
> >
> > On Tue, 10 Apr 2018 23:02:12 +0300, Asaf Kahlon wrote:
> >
> >> Is there anything new with my patch? Should I add/change something?
> >
> > I'd like to hear from Yegor about this patch. Yegor, could you comment
> > on this patch ?
>
> I'm OK with this patch. This package could be helpful for the
> python-crossbar testing as it takes ages to start crossbar script.
>
> Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>
>
> Yegor
>
<div dir="ltr">ping</div><br><div class="gmail_quote"><div dir="ltr">On Sat, Apr 28, 2018 at 9:58 PM Yegor Yefremov &lt;<a href="mailto:yegorslists@googlemail.com">yegorslists@googlemail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sat, Apr 28, 2018 at 3:09 PM, Thomas Petazzoni<br>
&lt;<a href="mailto:thomas.petazzoni@bootlin.com" target="_blank">thomas.petazzoni@bootlin.com</a>&gt; wrote:<br>
&gt; Hello,<br>
&gt;<br>
&gt; On Tue, 10 Apr 2018 23:02:12 +0300, Asaf Kahlon wrote:<br>
&gt;<br>
&gt;&gt; Is there anything new with my patch? Should I add/change something?<br>
&gt;<br>
&gt; I&#39;d like to hear from Yegor about this patch. Yegor, could you comment<br>
&gt; on this patch ?<br>
<br>
I&#39;m OK with this patch. This package could be helpful for the<br>
python-crossbar testing as it takes ages to start crossbar script.<br>
<br>
Reviewed-by: Yegor Yefremov &lt;<a href="mailto:yegorslists@googlemail.com" target="_blank">yegorslists@googlemail.com</a>&gt;<br>
<br>
Yegor<br>
</blockquote></div>
Thomas Petazzoni Oct. 20, 2018, 6:54 p.m. UTC | #7
Hello,

On Mon,  9 Apr 2018 21:04:03 +0300, Asaf Kahlon wrote:
> host-package that is able to shorten the load time of entry_points declared
> in setup.py of python packages.
> 
> Signed-off-by: Asaf Kahlon <asafka7@gmail.com>
> ---
>  DEVELOPERS                                         |  1 +
>  package/Config.in.host                             |  1 +
>  package/python-fastentrypoints/Config.in.host      |  6 ++++++
>  .../python-fastentrypoints.hash                    |  4 ++++
>  .../python-fastentrypoints.mk                      | 14 ++++++++++++++
>  5 files changed, 26 insertions(+)
>  create mode 100644 package/python-fastentrypoints/Config.in.host
>  create mode 100644 package/python-fastentrypoints/python-fastentrypoints.hash
>  create mode 100644 package/python-fastentrypoints/python-fastentrypoints.mk

Applied to master, thanks.

Thomas
diff mbox series

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index b797087191..ac0bab8c47 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -189,6 +189,7 @@  F:	package/sqlcipher/
 F:	package/stress/
 
 N:	Asaf Kahlon <asafka7@gmail.com>
+F:	package/python-fastentrypoints/
 F:	package/python-jsonmodels/
 F:	package/python-yieldfrom/
 
diff --git a/package/Config.in.host b/package/Config.in.host
index 563a277795..8cf8106895 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -42,6 +42,7 @@  menu "Host utilities"
 	source "package/pkgconf/Config.in.host"
 	source "package/pru-software-support/Config.in.host"
 	source "package/pwgen/Config.in.host"
+	source "package/python-fastentrypoints/Config.in.host"
 	source "package/python-lxml/Config.in.host"
 	source "package/python-six/Config.in.host"
 	source "package/python-xlrd/Config.in.host"
diff --git a/package/python-fastentrypoints/Config.in.host b/package/python-fastentrypoints/Config.in.host
new file mode 100644
index 0000000000..91605509ab
--- /dev/null
+++ b/package/python-fastentrypoints/Config.in.host
@@ -0,0 +1,6 @@ 
+config BR2_PACKAGE_HOST_PYTHON_FASTENTRYPOINTS
+	bool "host python-fastentrypoints"
+	help
+	  Makes entry_points specified in setup.py load more quickly.
+
+	  https://github.com/ninjaaron/fast-entry_points
diff --git a/package/python-fastentrypoints/python-fastentrypoints.hash b/package/python-fastentrypoints/python-fastentrypoints.hash
new file mode 100644
index 0000000000..84e9b78287
--- /dev/null
+++ b/package/python-fastentrypoints/python-fastentrypoints.hash
@@ -0,0 +1,4 @@ 
+# md5 from https://pypi.python.org/pypi/fastentrypoints/json, sha256 locally computed
+md5	9bd2a34697eb8279d87e7b927f4f7e85  fastentrypoints-0.10.tar.gz
+sha256	ed418146ed87230694ec2d8890b9b3e2967e95d857e5ce933cafecb1067cca82  fastentrypoints-0.10.tar.gz
+sha256	2da210da31c033faa270503884a3ac9058874543e6fdd0b094000720bf2ffb66  fastentrypoints.py
diff --git a/package/python-fastentrypoints/python-fastentrypoints.mk b/package/python-fastentrypoints/python-fastentrypoints.mk
new file mode 100644
index 0000000000..c4eb3e862f
--- /dev/null
+++ b/package/python-fastentrypoints/python-fastentrypoints.mk
@@ -0,0 +1,14 @@ 
+################################################################################
+#
+# python-fastentrypoints
+#
+################################################################################
+
+PYTHON_FASTENTRYPOINTS_VERSION = 0.10
+PYTHON_FASTENTRYPOINTS_SOURCE = fastentrypoints-$(PYTHON_FASTENTRYPOINTS_VERSION).tar.gz
+PYTHON_FASTENTRYPOINTS_SITE = https://pypi.python.org/packages/e8/c8/c2902c9c9da43d8be8c75a730f15f0c51933c42c39b91d1d7b605a88e907
+PYTHON_FASTENTRYPOINTS_SETUP_TYPE = setuptools
+PYTHON_FASTENTRYPOINTS_LICENSE = BSD-2-Clause
+PYTHON_FASTENTRYPOINTS_LICENSE_FILES = fastentrypoints.py
+
+$(eval $(host-python-package))