All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Guillaume W. Bres" <guillaume.bressaix@gmail.com>
To: buildroot@busybox.net
Cc: "Guillaume W. Bres" <guillaume.bressaix@gmail.com>
Subject: [Buildroot] [PATCH v1 2/7] package/python-threadpoolctl: new package
Date: Tue, 16 Aug 2022 16:39:38 +0200	[thread overview]
Message-ID: <20220816143943.16142-2-guillaume.bressaix@gmail.com> (raw)
In-Reply-To: <20220816143943.16142-1-guillaume.bressaix@gmail.com>

package/python-scikitlearn needs python-threadpoolctl as a
runtime dependency.

Signed-off-by: Guillaume W. Bres <guillaume.bressaix@gmail.com>
---
python-threadpoolctl originally builds with "flit", whose
build process merely consists in copying threadpoolctl.py to
the /usr/lib python pool. As we have no knowledge of "flit",
I simply used the buildroot infra to recreate this behavior.
Let me know of any suggestion
---
 DEVELOPERS                                    |  1 +
 package/Config.in                             |  1 +
 package/python-threadpoolctl/Config.in        | 10 +++++++++
 .../python-threadpoolctl.hash                 |  3 +++
 .../python-threadpoolctl.mk                   | 22 +++++++++++++++++++
 5 files changed, 37 insertions(+)
 create mode 100644 package/python-threadpoolctl/Config.in
 create mode 100644 package/python-threadpoolctl/python-threadpoolctl.hash
 create mode 100644 package/python-threadpoolctl/python-threadpoolctl.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 2c4f9ed76e..21a35cf9d1 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1195,6 +1195,7 @@ F:	package/python-joblib/
 F:	package/python-pybind/
 F:	package/python-pythran/
 F:	package/python-scipy/
+F:	package/python-threadpoolctl/
 F:	package/reaver/
 F:	support/testing/tests/package/br2-external/python-pybind
 F:	support/testing/tests/package/sample_python_pybind.py
diff --git a/package/Config.in b/package/Config.in
index 7f017c92e9..876d7309eb 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1274,6 +1274,7 @@ menu "External python modules"
 	source "package/python-termcolor/Config.in"
 	source "package/python-terminaltables/Config.in"
 	source "package/python-texttable/Config.in"
+	source "package/python-threadpoolctl/Config.in"
 	source "package/python-thrift/Config.in"
 	source "package/python-tinycss2/Config.in"
 	source "package/python-tinyrpc/Config.in"
diff --git a/package/python-threadpoolctl/Config.in b/package/python-threadpoolctl/Config.in
new file mode 100644
index 0000000000..127de3bc39
--- /dev/null
+++ b/package/python-threadpoolctl/Config.in
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_PYTHON_THREADPOOLCTL
+	bool "python-threadpoolctl"
+	depends on BR2_PACKAGE_PYTHON3
+	help
+	  Python helpers to limit the number of threads
+	  used in the threadpool-backed of common native
+	  libraries used for scientific computing and
+	  data science (e.g. BLAS and OpenMP).
+
+	  https://github.com/joblib/threadpoolctl
diff --git a/package/python-threadpoolctl/python-threadpoolctl.hash b/package/python-threadpoolctl/python-threadpoolctl.hash
new file mode 100644
index 0000000000..6b6fa72443
--- /dev/null
+++ b/package/python-threadpoolctl/python-threadpoolctl.hash
@@ -0,0 +1,3 @@
+# Locally calculated
+sha256  449b806f9147a3cf28ed7ec6389dbff9c450331d695873ab75dea79fe661f1e7  python-threadpoolctl-3.1.0.tar.gz
+sha256  81ac619075248b06e53660b652d10e485f4675f5d0ae0f97ea22370da1f7e23b  LICENSE
diff --git a/package/python-threadpoolctl/python-threadpoolctl.mk b/package/python-threadpoolctl/python-threadpoolctl.mk
new file mode 100644
index 0000000000..50f77b1b1f
--- /dev/null
+++ b/package/python-threadpoolctl/python-threadpoolctl.mk
@@ -0,0 +1,22 @@
+################################################################################
+#
+# python-threadpoolctl
+#
+################################################################################
+
+PYTHON_THREADPOOLCTL_VERSION = 3.1.0
+PYTHON_THREADPOOLCTL_SITE = $(call github,joblib,threadpoolctl,$(PYTHON_THREADPOOLCTL_VERSION),$(PYTHON_THREADPOOLCTL_VERSION).tar.gz)
+PYTHON_THREADPOOLCTL_LICENSE = BSD-3-Clause
+PYTHON_THREADPOOLCTL_LICENSE_FILES = LICENSE
+
+# threadpoolctl is originally built using 'flit' which
+# simply symlinks $(@D)/threadpoolctl.py to site-packages
+define PYTHON_THREADPOOLCTL_BUILD_CMDS
+endef
+
+define PYTHON_THREADPOOLCTL_INSTALL_TARGET_CMDS
+	cp $(@D)/threadpoolctl.py \
+		$(TARGET_DIR)/usr/lib/python$(PYTHON3_VERSION_MAJOR)
+endef
+
+$(eval $(generic-package))
-- 
2.20.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2022-08-16 14:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-16 14:39 [Buildroot] [PATCH v1 1/7] package/python-joblib: new package Guillaume W. Bres
2022-08-16 14:39 ` Guillaume W. Bres [this message]
2022-08-16 14:39 ` [Buildroot] [PATCH v1 3/7] package/lapack: host-python-scipy needs host-lapack Guillaume W. Bres
2022-08-16 14:39 ` [Buildroot] [PATCH v1 4/7] package/python-pybind: host-python-scipy needs host-python-pybind Guillaume W. Bres
2022-08-16 14:39 ` [Buildroot] [PATCH v1 5/7] package/python-scipy: add host-package Guillaume W. Bres
2022-08-16 14:39 ` [Buildroot] [PATCH v1 6/7] package/python-scikitlearn: new package Guillaume W. Bres
2022-08-17 10:54   ` Thomas Petazzoni via buildroot
2022-08-16 14:39 ` [Buildroot] [PATCH v1 7/7] support/testing: add python-scikitlearn test Guillaume W. Bres

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=20220816143943.16142-2-guillaume.bressaix@gmail.com \
    --to=guillaume.bressaix@gmail.com \
    --cc=buildroot@busybox.net \
    /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.