Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni via buildroot <buildroot@buildroot.org>
To: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Cc: James Hilliard <james.hilliard1@gmail.com>,
	Asaf Kahlon <asafka7@gmail.com>,
	Brandon Maier <brandon.maier@collins.com>,
	buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH v2, 2/2] package/python-pysensors: add host-lm-sensors dependency
Date: Thu, 4 Jan 2024 10:55:38 +0100	[thread overview]
Message-ID: <20240104105538.36eaf9ef@windsurf> (raw)
In-Reply-To: <20240103173741.850916-2-fontaine.fabrice@gmail.com>

Hello Fabrice,

Thanks for the patch. See below some feedback.

On Wed,  3 Jan 2024 18:37:41 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> host-lm-sensors is needed to extract the version from libsensors.so and
> avoid 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

Does python-pysensors setup.py really need  the version of the
lm-sensors library?

I see this:

#!/usr/bin/env python3
from setuptools import setup
import sensors

setup(
    name='PySensors',
    version=sensors.__version__,
    author=sensors.__author__,
    author_email=sensors.__contact__,
    packages=['sensors'],
    # scripts=[],
    url='http://pypi.python.org/pypi/PySensors/',
    # download_url='',
    license=sensors.__license__,
    description='Python bindings to libsensors (via ctypes)',
    long_description=open('README.rst').read(),
    long_description_content_type="text/x-rst",
    keywords=['sensors', 'hardware', 'monitoring'],
    classifiers=[
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'License :: OSI Approved',
        'License :: OSI Approved ::'
        ' GNU Lesser General Public License v2 or later (LGPLv2+)',
        'Operating System :: POSIX :: Linux',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: Implementation',
        'Programming Language :: Python :: Implementation :: CPython',
        'Topic :: System',
        'Topic :: System :: Hardware',
        'Topic :: System :: Monitoring',
    ],
    python_requires=">=3.6",
)

So the "sensors" module is only being imported to get
sensors.__version__, sensors.__author__ and sensors.__contact__,
sensors.__license__, all of which are statically defined in the sensors
module.

So in practice, in the context of setup.py, this detection of the
lm-sensors version is not used. I believe:

__version__ = "0.0.4"
__date__ = "2019-09-19"
__author__ = "Marc 'BlackJack' Rintsch"
__contact__ = 'marc@rintsch.de'
__license__ = 'LGPL v2.1'

Should just be moved directly to setup.py, and setup.py should not
import sensors. From a quick look, none of those variables are used
outside of setup.py. And of course this could be contributed upstream,
explaining why "import sensors" at setup time is not good.

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

  parent reply	other threads:[~2024-01-04  9:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-03 17:37 [Buildroot] [PATCH v2,1/2] package/lm-sensors: add host package Fabrice Fontaine
2024-01-03 17:37 ` [Buildroot] [PATCH v2, 2/2] package/python-pysensors: add host-lm-sensors dependency Fabrice Fontaine
2024-01-03 21:36   ` [Buildroot] [External] " Maier, Brandon L Collins via buildroot
2024-01-04  9:55   ` Thomas Petazzoni via buildroot [this message]
2024-01-04 10:10     ` [Buildroot] " Fabrice Fontaine
2024-01-04 10:44       ` Thomas Petazzoni via buildroot
2024-01-03 21:35 ` [Buildroot] [External] [PATCH v2, 1/2] package/lm-sensors: add host package Maier, Brandon L Collins via buildroot

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=20240104105538.36eaf9ef@windsurf \
    --to=buildroot@buildroot.org \
    --cc=asafka7@gmail.com \
    --cc=brandon.maier@collins.com \
    --cc=fontaine.fabrice@gmail.com \
    --cc=james.hilliard1@gmail.com \
    --cc=thomas.petazzoni@bootlin.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox