将 python3 个包添加到 Buildroot

Adding python3 packages to Buildroot

Buildroot 是一种可用于为嵌入式系统板构建 Linux 映像的工具。

Buildroot 带有一组预定义的 Python 包,我可以从它的菜单中选择。

此外,Buildroot 添加了一个很好的 Python 脚本,它可以导入属于 PyPI 存储库的任何包,称为 "scanpypi"。

不过好像脚本只适合Python2。尝试导入较新的包时,出现错误,例如:

./support/scripts/scanpypi websockets -o package
buildroot package name for websockets: python-websockets
Package: python-websockets
Fetching package websockets
Downloading package websockets from https://pypi.python.org/packages/b6/12/6194aac840c65253e45a38912e318f9ac548f9ba86d75bdb8fe66841b335/websockets-4.0.1.tar.gz...
Traceback (most recent call last):
  File "./support/scripts/scanpypi", line 653, in <module>
    main()
  File "./support/scripts/scanpypi", line 604, in main
    package.load_setup()
  File "./support/scripts/scanpypi", line 250, in load_setup
    setup = imp.load_module('setup', s_file, s_path, s_desc)
  File "/tmp/scanpypi-qbY6eQ/python-websockets/websockets-4.0.1/setup.py", line 11, in <module>
TypeError: 'encoding' is an invalid keyword argument for this function

此关键字无效。

另外:

./support/scripts/scanpypi websocket-server -o package
buildroot package name for websocket-server: python-websocket-server
Package: python-websocket-server
Fetching package websocket-server
Downloading package websocket-server from https://pypi.python.org/packages/74/64/e86581ee7775a2e08aca530b41e1a1e3ee6b320233b1eff301dcb86d1636/websocket_server-0.4.tar.gz...
Traceback (most recent call last):
  File "./support/scripts/scanpypi", line 653, in <module>
    main()
  File "./support/scripts/scanpypi", line 604, in main
    package.load_setup()
  File "./support/scripts/scanpypi", line 247, in load_setup
    os.chdir(self.tmp_extract)
OSError: [Errno 2] No such file or directory: '/tmp/scanpypi-YXROmL/python-websocket-server/websocket-server-0.4'

包名称中包含下划线 (_) 而不是破折号 (-),此失败。

我已经为 scanpypi 创建了一个 Python3 移植。

https://github.com/ishahak/buildroot_scanpypi3

编辑

应@yegorich 的要求,我很高兴地通知您,现在 scanpypi 可以用于 Python 2/3!

我的链接版本仍可用于直接从 GitHub 安装更新版本。