grmmgrmm
grmmgrmm

Reputation: 1408

bitbake recipe pulling from pypi runs into timeout

I have a recipe to build aiohttp-pydantic from pypi which essentially looks like this (omitting license, author, summary, etc.)

PYPI_PACKAGE = "aiohttp-pydantic"

inherit pypi setuptools3

RDEPENDS_${PN} += "\
    python3-aiohttp \
    python3-pydantic \
"

Unfortunately the fetcher times out. I also tried PYPI_PACKAGE = "aiohttp_pydantic" with the same result.

Apart from that I also tried building directly from github source. Unfortunately, here it is attempted to import aiohttp for unknown reasons:

|   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
|   File "/build/build/tmp-orange-pi-zero/work/armv7vet2hf-neon-poky-linux-gnueabi/python3-aiohttp-pydantic/1.0+gitAUTOINC+69fb553635-r0/git/aiohttp_pydantic/__init__.py", line 1, in <module>
|     from .view import PydanticView
|   File "/build/build/tmp-orange-pi-zero/work/armv7vet2hf-neon-poky-linux-gnueabi/python3-aiohttp-pydantic/1.0+gitAUTOINC+69fb553635-r0/git/aiohttp_pydantic/view.py", line 6, in <module>
|     from aiohttp.abc import AbstractView
| ModuleNotFoundError: No module named 'aiohttp'
| ERROR: 'python3 setup.py build ' execution failed.
| WARNING: exit code 1 from a shell command.
| ERROR: Execution of '/build/build/tmp-orange-pi-zero/work/armv7vet2hf-neon-poky-linux-gnueabi/python3-aiohttp-pydantic/1.0+gitAUTOINC+69fb553635-r0/temp/run.do_compile.18942' failed with exit code 1

I remember I had an issue when trying to build a python project that comes with a pyproject.toml. Could that be an issue here as well?

Any help is highly appreciated.

Upvotes: 0

Views: 654

Answers (1)

ah008a
ah008a

Reputation: 1145

It seems you've hit a corner case, this is a limitation but not from bitbake or the Yocto Project, rather from the maintainers of the package aiohttp-pydantic, it seems they arent providing the sources for that package (which is what bitbake tries to fetch), they're only providing binaries via wheel.

This can be tested by pip by using the --no-binary argument:

$ python -m pip install aiohttp-pydantic --no-binary :all:           

https://pypi.org/simple
https://pypi.org/pypi
https://test.pypi.org/simple
https://test.pypi.org/pypi
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement aiohttp-pydantic (from versions: none)
ERROR: No matching distribution found for aiohttp-pydantic

Doing the same for a package that provides sources:

$ python -m pip install aiohttp --no-binary :all:                         

https://pypi.org/simple
https://pypi.org/pypi
https://test.pypi.org/simple
https://test.pypi.org/pypi
Defaulting to user installation because normal site-packages is not writeable
Collecting aiohttp
https://files.pythonhosted.org/packages/5a/86/5f63de7a202550269a617a5d57859a2961f3396ecd1739a70b92224766bc/aiohttp-3.8.1.tar.gz#sha256=fc5471e1a54de15ef71c1bc6ebe80d4dc681ea600e68bfd1cbce40427f0b7578
https://files.pythonhosted.org/packages/5a/86/5f63de7a202550269a617a5d57859a2961f3396ecd1739a70b92224766bc/aiohttp-3.8.1.tar.gz
  Downloading aiohttp-3.8.1.tar.gz (7.3 MB)
Downloading %s aiohttp-3.8.1.tar.gz (7.3 MB)

also we can look at the index of PyPi, for aiohttp we see the .tar.gz files: https://pypi.org/simple/aiohttp/

but they're not present for aiohttp-pydantic

https://pypi.org/simple/aiohttp-pydantic/

You still should be able to create a recipe for that package though, but instead of using the pypi class you need to do it via the pip_install_wheel class

Upvotes: 2

Related Questions