Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding python3 packages to Buildroot

Tags:

buildroot

Buildroot is a tool that can be used for building Linux images for embedded-system boards.

Buildroot comes with a predefined set of Python packages that can me selected from its menu.

In addition, Buildroot is added with a nice Python script that can import any package which is part of the PyPI repository, called "scanpypi".

However it seems the script is only adapted to Python2. When trying to import a newer package, errors appear, such as:

./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

This one was failing for invalid keyword.

Also:

./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'

This one was failing for package name containing underscore (_) instead of dash (-).

like image 569
ishahak Avatar asked Oct 25 '25 23:10

ishahak


1 Answers

I have created a Python3 porting for scanpypi.

See https://github.com/ishahak/buildroot_scanpypi3

EDIT

By the request of @yegorich, I'm glad to inform that now scanpypi can be used for both Python 2/3!

My linked version can still be used for installing newer versions directly from GitHub.

like image 83
ishahak Avatar answered Oct 29 '25 10:10

ishahak



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!