diff mbox series

test: Add setuptools to test requirements.txt

Message ID 20250505205052.347616-1-javier.tia@linaro.org
State New
Headers show
Series test: Add setuptools to test requirements.txt | expand

Commit Message

Javier Tia May 5, 2025, 8:50 p.m. UTC
It solves the following error:

❯ ./test/py/test.py --bd sandbox --build
+make O=/u-boot/build-sandbox -s sandbox_defconfig
+make O=/u-boot/build-sandbox -s -j32
Traceback (most recent call last):
  File "/u-boot/build-sandbox/../scripts/dtc/pylibfdt/setup.py", line 23, in <module>
    from setuptools import setup, Extension
ModuleNotFoundError: No module named 'setuptools

Signed-off-by: Javier Tia <javier.tia@linaro.org>
---
 test/py/requirements.txt | 1 +
 1 file changed, 1 insertion(+)

Comments

Tom Rini May 5, 2025, 9:08 p.m. UTC | #1
On Mon, May 05, 2025 at 02:50:51PM -0600, Javier Tia wrote:

> It solves the following error:
> 
> ❯ ./test/py/test.py --bd sandbox --build
> +make O=/u-boot/build-sandbox -s sandbox_defconfig
> +make O=/u-boot/build-sandbox -s -j32
> Traceback (most recent call last):
>   File "/u-boot/build-sandbox/../scripts/dtc/pylibfdt/setup.py", line 23, in <module>
>     from setuptools import setup, Extension
> ModuleNotFoundError: No module named 'setuptools
> 
> Signed-off-by: Javier Tia <javier.tia@linaro.org>
> ---
>  test/py/requirements.txt | 1 +
>  1 file changed, 1 insertion(+)

This is the wrong place. You can't build U-Boot without
python3-setuptools being available, so it's part of the implicit or
explicit dependencies in doc/build/gcc.rst. I believe for Ubuntu/etc
it's implicit but should likely be explicit.
Javier Tia May 5, 2025, 9:14 p.m. UTC | #2
Hi Tom,

On Mon, May 5, 2025, at 3:08 PM, Tom Rini wrote:
> On Mon, May 05, 2025 at 02:50:51PM -0600, Javier Tia wrote:
>
>> It solves the following error:
>> 
>> ❯ ./test/py/test.py --bd sandbox --build
>> +make O=/u-boot/build-sandbox -s sandbox_defconfig
>> +make O=/u-boot/build-sandbox -s -j32
>> Traceback (most recent call last):
>>   File "/u-boot/build-sandbox/../scripts/dtc/pylibfdt/setup.py", line 23, in <module>
>>     from setuptools import setup, Extension
>> ModuleNotFoundError: No module named 'setuptools
>> 
>> Signed-off-by: Javier Tia <javier.tia@linaro.org>
>> ---
>>  test/py/requirements.txt | 1 +
>>  1 file changed, 1 insertion(+)
>
> This is the wrong place. You can't build U-Boot without
> python3-setuptools being available, so it's part of the implicit or
> explicit dependencies in doc/build/gcc.rst. I believe for Ubuntu/etc
> it's implicit but should likely be explicit.

What about the use case where you just want to run the U-Boot CI tests?

I found this problem just following the documentation at https://docs.u-boot.org/en/latest/develop/py_testing.html.

$ cd /path/to/u-boot
$ python3 -m venv venv
$ . ./venv/bin/activate
$ pip install -r test/py/requirements.txt
$ make mrproper
$ ./test/py/test.py --bd sandbox --build
Tom Rini May 5, 2025, 9:27 p.m. UTC | #3
On Mon, May 05, 2025 at 03:14:13PM -0600, Javier Tia wrote:
> Hi Tom,
> 
> On Mon, May 5, 2025, at 3:08 PM, Tom Rini wrote:
> > On Mon, May 05, 2025 at 02:50:51PM -0600, Javier Tia wrote:
> >
> >> It solves the following error:
> >> 
> >> ❯ ./test/py/test.py --bd sandbox --build
> >> +make O=/u-boot/build-sandbox -s sandbox_defconfig
> >> +make O=/u-boot/build-sandbox -s -j32
> >> Traceback (most recent call last):
> >>   File "/u-boot/build-sandbox/../scripts/dtc/pylibfdt/setup.py", line 23, in <module>
> >>     from setuptools import setup, Extension
> >> ModuleNotFoundError: No module named 'setuptools
> >> 
> >> Signed-off-by: Javier Tia <javier.tia@linaro.org>
> >> ---
> >>  test/py/requirements.txt | 1 +
> >>  1 file changed, 1 insertion(+)
> >
> > This is the wrong place. You can't build U-Boot without
> > python3-setuptools being available, so it's part of the implicit or
> > explicit dependencies in doc/build/gcc.rst. I believe for Ubuntu/etc
> > it's implicit but should likely be explicit.
> 
> What about the use case where you just want to run the U-Boot CI tests?

You still have to have built U-Boot.

> I found this problem just following the documentation at https://docs.u-boot.org/en/latest/develop/py_testing.html.
> 
> $ cd /path/to/u-boot
> $ python3 -m venv venv
> $ . ./venv/bin/activate
> $ pip install -r test/py/requirements.txt
> $ make mrproper
> $ ./test/py/test.py --bd sandbox --build

Right, and the failure comes from not being able to build U-Boot. Part
of commit 859621b47f9e ("python: Recreate test/py and tools/buildman
requirements.txt files") was to remove the parts of
test/py/requirements.txt that are not from the test/py suite, as it had
become the location for any python module required, not the test suite.
Javier Tia May 5, 2025, 9:40 p.m. UTC | #4
Hi Tom,

On Mon, May 5, 2025, at 3:27 PM, Tom Rini wrote:
> On Mon, May 05, 2025 at 03:14:13PM -0600, Javier Tia wrote:
>> Hi Tom,
>> 
>> On Mon, May 5, 2025, at 3:08 PM, Tom Rini wrote:
>> > On Mon, May 05, 2025 at 02:50:51PM -0600, Javier Tia wrote:
>> >
>> >> It solves the following error:
>> >> 
>> >> ❯ ./test/py/test.py --bd sandbox --build
>> >> +make O=/u-boot/build-sandbox -s sandbox_defconfig
>> >> +make O=/u-boot/build-sandbox -s -j32
>> >> Traceback (most recent call last):
>> >>   File "/u-boot/build-sandbox/../scripts/dtc/pylibfdt/setup.py", line 23, in <module>
>> >>     from setuptools import setup, Extension
>> >> ModuleNotFoundError: No module named 'setuptools
>> >> 
>> >> Signed-off-by: Javier Tia <javier.tia@linaro.org>
>> >> ---
>> >>  test/py/requirements.txt | 1 +
>> >>  1 file changed, 1 insertion(+)
>> >
>> > This is the wrong place. You can't build U-Boot without
>> > python3-setuptools being available, so it's part of the implicit or
>> > explicit dependencies in doc/build/gcc.rst. I believe for Ubuntu/etc
>> > it's implicit but should likely be explicit.
>> 
>> What about the use case where you just want to run the U-Boot CI tests?
>
> You still have to have built U-Boot.
>
>> I found this problem just following the documentation at https://docs.u-boot.org/en/latest/develop/py_testing.html.
>> 
>> $ cd /path/to/u-boot
>> $ python3 -m venv venv
>> $ . ./venv/bin/activate
>> $ pip install -r test/py/requirements.txt
>> $ make mrproper
>> $ ./test/py/test.py --bd sandbox --build
>
> Right, and the failure comes from not being able to build U-Boot. Part
> of commit 859621b47f9e ("python: Recreate test/py and tools/buildman
> requirements.txt files") was to remove the parts of
> test/py/requirements.txt that are not from the test/py suite, as it had
> become the location for any python module required, not the test suite.

Makes sense now. Thanks!
diff mbox series

Patch

diff --git a/test/py/requirements.txt b/test/py/requirements.txt
index 804a427b351..5be94a44912 100644
--- a/test/py/requirements.txt
+++ b/test/py/requirements.txt
@@ -3,3 +3,4 @@  pycryptodomex==3.21.0
 pytest==6.2.5
 pytest-xdist==2.5.0
 FATtools==1.0.42
+setuptools==80.3.1