Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3, 1/1] package/python-pysensors: fix build without host lm-sensors
@ 2024-01-04 17:17 Fabrice Fontaine
  2024-01-04 19:59 ` [Buildroot] [External] " Maier, Brandon L Collins via buildroot
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Fabrice Fontaine @ 2024-01-04 17:17 UTC (permalink / raw)
  To: buildroot; +Cc: James Hilliard, Fabrice Fontaine, Asaf Kahlon, Brandon Maier

Fix the following build failure raised since the addition of the
package in commit c8ff8d41c06f6b1cbc5cf8702a516411084ead16:

  File "/home/buildroot/autobuild/instance-2/output-1/build/python-pysensors-0.0.4/setup.py", line 3, in <module>
    import sensors
  File "/home/buildroot/autobuild/instance-2/output-1/build/python-pysensors-0.0.4/sensors/__init__.py", line 20, in <module>
    raise ImportError("can't find the sensors library.")

Fixes:
 - http://autobuild.buildroot.org/results/acd8583fb635ea27811405a2478182ddcd5642f7

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
Changes v2 -> v3 (after review of Thomas Petazzoni):
 - Drop dependency and add a patch  instead

Changes v1 -> v2 (after review of Brandon Maier):
 - Replace lm-sensors dependency by host-lm-sensors and set SENSORS_LIB

 ...-Remove-import-sensors-from-setup-py.patch | 55 +++++++++++++++++++
 package/python-pysensors/Config.in            |  2 +-
 2 files changed, 56 insertions(+), 1 deletion(-)
 create mode 100644 package/python-pysensors/0001-Remove-import-sensors-from-setup-py.patch

diff --git a/package/python-pysensors/0001-Remove-import-sensors-from-setup-py.patch b/package/python-pysensors/0001-Remove-import-sensors-from-setup-py.patch
new file mode 100644
index 0000000000..737f194fd4
--- /dev/null
+++ b/package/python-pysensors/0001-Remove-import-sensors-from-setup-py.patch
@@ -0,0 +1,55 @@
+Remove import sensors from setup.py
+
+Don't import sensors in setup.py to avoid adding a dependency on host
+lm-sensors. Instead, move __version__, __author__, __contact__ and
+__license__ to setup.py
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Upstream: upstream is dead since 2019
+
+diff '--color=auto' -Nura PySensors-0.0.4.orig/sensors/__init__.py PySensors-0.0.4/sensors/__init__.py
+--- PySensors-0.0.4.orig/sensors/__init__.py	2024-01-04 13:47:07.114179107 +0100
++++ PySensors-0.0.4/sensors/__init__.py	2024-01-04 14:07:24.701178768 +0100
+@@ -6,12 +6,6 @@
+ 
+ from sensors import stdc
+ 
+-__version__ = "0.0.4"
+-__date__ = "2019-09-19"
+-__author__ = "Marc 'BlackJack' Rintsch"
+-__contact__ = 'marc@rintsch.de'
+-__license__ = 'LGPL v2.1'
+-
+ API_VERSION = 4
+ DEFAULT_CONFIG_FILENAME = b"/etc/sensors3.conf"
+ 
+diff '--color=auto' -Nura PySensors-0.0.4.orig/setup.py PySensors-0.0.4/setup.py
+--- PySensors-0.0.4.orig/setup.py	2024-01-04 13:47:07.114179107 +0100
++++ PySensors-0.0.4/setup.py	2024-01-04 14:07:04.657260411 +0100
+@@ -1,17 +1,21 @@
+ #!/usr/bin/env python3
+ from setuptools import setup
+-import sensors
++
++__version__ = "0.0.4"
++__author__ = "Marc 'BlackJack' Rintsch"
++__contact__ = 'marc@rintsch.de'
++__license__ = 'LGPL v2.1'
+ 
+ setup(
+     name='PySensors',
+-    version=sensors.__version__,
+-    author=sensors.__author__,
+-    author_email=sensors.__contact__,
++    version=__version__,
++    author=__author__,
++    author_email=__contact__,
+     packages=['sensors'],
+     # scripts=[],
+     url='http://pypi.python.org/pypi/PySensors/',
+     # download_url='',
+-    license=sensors.__license__,
++    license=__license__,
+     description='Python bindings to libsensors (via ctypes)',
+     long_description=open('README.rst').read(),
+     long_description_content_type="text/x-rst",
diff --git a/package/python-pysensors/Config.in b/package/python-pysensors/Config.in
index f8e056506b..952d14c351 100644
--- a/package/python-pysensors/Config.in
+++ b/package/python-pysensors/Config.in
@@ -1,6 +1,6 @@
 config BR2_PACKAGE_PYTHON_PYSENSORS
 	bool "python-pysensors"
-	select BR2_PACKAGE_LM_SENSORS
+	select BR2_PACKAGE_LM_SENSORS # runtime
 	help
 	  Python bindings for libsensors.so from the lm-sensors project
 	  via ctypes. Supports API version 4, i.e. libsensors version
-- 
2.43.0

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [External] [PATCH v3, 1/1] package/python-pysensors: fix build without host lm-sensors
  2024-01-04 17:17 [Buildroot] [PATCH v3, 1/1] package/python-pysensors: fix build without host lm-sensors Fabrice Fontaine
@ 2024-01-04 19:59 ` Maier, Brandon L Collins via buildroot
  2024-01-05 12:48 ` [Buildroot] " Thomas Petazzoni via buildroot
  2024-01-12 17:35 ` Peter Korsgaard
  2 siblings, 0 replies; 4+ messages in thread
From: Maier, Brandon L Collins via buildroot @ 2024-01-04 19:59 UTC (permalink / raw)
  To: Fabrice Fontaine, buildroot@buildroot.org; +Cc: James Hilliard, Asaf Kahlon



> -----Original Message-----
> From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> Sent: Thursday, January 4, 2024 11:18 AM
> To: buildroot@buildroot.org
> Cc: Maier, Brandon L Collins <Brandon.Maier@collins.com>; Yegor Yefremov
> <yegorslists@googlemail.com>; Asaf Kahlon <asafka7@gmail.com>; James
> Hilliard <james.hilliard1@gmail.com>; Fabrice Fontaine
> <fontaine.fabrice@gmail.com>
> Subject: [External] [PATCH v3,1/1] package/python-pysensors: fix build
> without host lm-sensors
>
> Fix the following build failure raised since the addition of the
> package in commit c8ff8d41c06f6b1cbc5cf8702a516411084ead16:
>
>   File "/home/buildroot/autobuild/instance-2/output-1/build/python-
> pysensors-0.0.4/setup.py", line 3, in <module>
>     import sensors
>   File "/home/buildroot/autobuild/instance-2/output-1/build/python-
> pysensors-0.0.4/sensors/__init__.py", line 20, in <module>
>     raise ImportError("can't find the sensors library.")
>
> Fixes:
>  -
> https://urldefense.com/v3/__http://autobuild.buildroot.org/results/acd858
> 3fb635ea27811405a2478182ddcd5642f7__;!!MvWE!FdrN9I_dN8olqAB3yG
> v0wt4DbIRaVHj0a5Gyy0r7EPMWfu13tzrq-
> ISXCPpZZgI4APscx8PWjCClFlE0q9Hq8XEowT-mYQ$
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> Changes v2 -> v3 (after review of Thomas Petazzoni):
>  - Drop dependency and add a patch  instead
>
> Changes v1 -> v2 (after review of Brandon Maier):
>  - Replace lm-sensors dependency by host-lm-sensors and set SENSORS_LIB
>
>  ...-Remove-import-sensors-from-setup-py.patch | 55
> +++++++++++++++++++
>  package/python-pysensors/Config.in            |  2 +-
>  2 files changed, 56 insertions(+), 1 deletion(-)
>  create mode 100644 package/python-pysensors/0001-Remove-import-
> sensors-from-setup-py.patch
>
> diff --git a/package/python-pysensors/0001-Remove-import-sensors-from-
> setup-py.patch b/package/python-pysensors/0001-Remove-import-sensors-
> from-setup-py.patch
> new file mode 100644
> index 0000000000..737f194fd4
> --- /dev/null
> +++ b/package/python-pysensors/0001-Remove-import-sensors-from-
> setup-py.patch
> @@ -0,0 +1,55 @@
> +Remove import sensors from setup.py
> +
> +Don't import sensors in setup.py to avoid adding a dependency on host
> +lm-sensors. Instead, move __version__, __author__, __contact__ and
> +__license__ to setup.py
> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Upstream: upstream is dead since 2019
> +
> +diff '--color=auto' -Nura PySensors-0.0.4.orig/sensors/__init__.py
> PySensors-0.0.4/sensors/__init__.py
> +--- PySensors-0.0.4.orig/sensors/__init__.py 2024-01-04
> 13:47:07.114179107 +0100
> ++++ PySensors-0.0.4/sensors/__init__.py      2024-01-04
> 14:07:24.701178768 +0100
> +@@ -6,12 +6,6 @@
> +
> + from sensors import stdc
> +
> +-__version__ = "0.0.4"
> +-__date__ = "2019-09-19"
> +-__author__ = "Marc 'BlackJack' Rintsch"
> +-__contact__ = 'marc@rintsch.de'
> +-__license__ = 'LGPL v2.1'
> +-
> + API_VERSION = 4
> + DEFAULT_CONFIG_FILENAME = b"/etc/sensors3.conf"
> +
> +diff '--color=auto' -Nura PySensors-0.0.4.orig/setup.py PySensors-
> 0.0.4/setup.py
> +--- PySensors-0.0.4.orig/setup.py    2024-01-04 13:47:07.114179107
> +0100
> ++++ PySensors-0.0.4/setup.py 2024-01-04 14:07:04.657260411
> +0100
> +@@ -1,17 +1,21 @@
> + #!/usr/bin/env python3
> + from setuptools import setup
> +-import sensors
> ++
> ++__version__ = "0.0.4"
> ++__author__ = "Marc 'BlackJack' Rintsch"
> ++__contact__ = 'marc@rintsch.de'
> ++__license__ = 'LGPL v2.1'
> +
> + setup(
> +     name='PySensors',
> +-    version=sensors.__version__,
> +-    author=sensors.__author__,
> +-    author_email=sensors.__contact__,
> ++    version=__version__,
> ++    author=__author__,
> ++    author_email=__contact__,
> +     packages=['sensors'],
> +     # scripts=[],
> +
> url='https://urldefense.com/v3/__http://pypi.python.org/pypi/PySensors/__
> ;!!MvWE!FdrN9I_dN8olqAB3yGv0wt4DbIRaVHj0a5Gyy0r7EPMWfu13tzrq-
> ISXCPpZZgI4APscx8PWjCClFlE0q9Hq8XE5xs9oHw$ ',
> +     # download_url='',
> +-    license=sensors.__license__,
> ++    license=__license__,
> +     description='Python bindings to libsensors (via ctypes)',
> +     long_description=open('README.rst').read(),
> +     long_description_content_type="text/x-rst",
> diff --git a/package/python-pysensors/Config.in b/package/python-
> pysensors/Config.in
> index f8e056506b..952d14c351 100644
> --- a/package/python-pysensors/Config.in
> +++ b/package/python-pysensors/Config.in
> @@ -1,6 +1,6 @@
>  config BR2_PACKAGE_PYTHON_PYSENSORS
>       bool "python-pysensors"
> -     select BR2_PACKAGE_LM_SENSORS
> +     select BR2_PACKAGE_LM_SENSORS # runtime
>       help
>         Python bindings for libsensors.so from the lm-sensors project
>         via ctypes. Supports API version 4, i.e. libsensors version
> --
> 2.43.0

Retested in docker-run

Tested-by: Brandon Maier <brandon.maier@collins.com>

Thanks!


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH v3, 1/1] package/python-pysensors: fix build without host lm-sensors
  2024-01-04 17:17 [Buildroot] [PATCH v3, 1/1] package/python-pysensors: fix build without host lm-sensors Fabrice Fontaine
  2024-01-04 19:59 ` [Buildroot] [External] " Maier, Brandon L Collins via buildroot
@ 2024-01-05 12:48 ` Thomas Petazzoni via buildroot
  2024-01-12 17:35 ` Peter Korsgaard
  2 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-01-05 12:48 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: James Hilliard, Brandon Maier, Asaf Kahlon, buildroot

On Thu,  4 Jan 2024 18:17:36 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Fix the following build failure raised since the addition of the
> package in commit c8ff8d41c06f6b1cbc5cf8702a516411084ead16:
> 
>   File "/home/buildroot/autobuild/instance-2/output-1/build/python-pysensors-0.0.4/setup.py", line 3, in <module>
>     import sensors
>   File "/home/buildroot/autobuild/instance-2/output-1/build/python-pysensors-0.0.4/sensors/__init__.py", line 20, in <module>
>     raise ImportError("can't find the sensors library.")
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/acd8583fb635ea27811405a2478182ddcd5642f7
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> Changes v2 -> v3 (after review of Thomas Petazzoni):
>  - Drop dependency and add a patch  instead

Applied to master, thanks.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Buildroot] [PATCH v3, 1/1] package/python-pysensors: fix build without host lm-sensors
  2024-01-04 17:17 [Buildroot] [PATCH v3, 1/1] package/python-pysensors: fix build without host lm-sensors Fabrice Fontaine
  2024-01-04 19:59 ` [Buildroot] [External] " Maier, Brandon L Collins via buildroot
  2024-01-05 12:48 ` [Buildroot] " Thomas Petazzoni via buildroot
@ 2024-01-12 17:35 ` Peter Korsgaard
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2024-01-12 17:35 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: James Hilliard, Brandon Maier, Asaf Kahlon, buildroot

>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:

 > Fix the following build failure raised since the addition of the
 > package in commit c8ff8d41c06f6b1cbc5cf8702a516411084ead16:

 >   File "/home/buildroot/autobuild/instance-2/output-1/build/python-pysensors-0.0.4/setup.py", line 3, in <module>
 >     import sensors
 >   File "/home/buildroot/autobuild/instance-2/output-1/build/python-pysensors-0.0.4/sensors/__init__.py", line 20, in <module>
 >     raise ImportError("can't find the sensors library.")

 > Fixes:
 >  - http://autobuild.buildroot.org/results/acd8583fb635ea27811405a2478182ddcd5642f7

 > Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
 > ---
 > Changes v2 -> v3 (after review of Thomas Petazzoni):
 >  - Drop dependency and add a patch  instead

 > Changes v1 -> v2 (after review of Brandon Maier):
 >  - Replace lm-sensors dependency by host-lm-sensors and set SENSORS_LIB

Committed to 2023.11.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-12 17:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-04 17:17 [Buildroot] [PATCH v3, 1/1] package/python-pysensors: fix build without host lm-sensors Fabrice Fontaine
2024-01-04 19:59 ` [Buildroot] [External] " Maier, Brandon L Collins via buildroot
2024-01-05 12:48 ` [Buildroot] " Thomas Petazzoni via buildroot
2024-01-12 17:35 ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox