Go to file
Thomas De Schampheleire f544f572c7 utils/scanpypi: add setup.py script directory as sys.path[0]
Even though the directory containing a package's setup.py was added to
sys.path, some setup.py implementations rely on the fact that it is placed
in sys.path[0].

An example package is 'cram' which failed to be added with scanpypi:

    Traceback (most recent call last):
      File "utils/scanpypi", line 756, in <module>
        main()
      File "utils/scanpypi", line 703, in main
        package.load_setup()
      File "utils/scanpypi", line 303, in load_setup
        setup = imp.load_module('setup', s_file, s_path, s_desc)
      File "/usr/lib/python3.8/imp.py", line 234, in load_module
        return load_source(name, filename, file)
      File "/usr/lib/python3.8/imp.py", line 171, in load_source
        module = _load(spec)
      File "<frozen importlib._bootstrap>", line 702, in _load
      File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
      File "<frozen importlib._bootstrap_external>", line 783, in exec_module
      File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
      File "/tmp/scanpypi-2pzc5wb_/python-cram/cram-0.7/setup.py", line 44, in <module>
        long_description=long_description(),
      File "/tmp/scanpypi-2pzc5wb_/python-cram/cram-0.7/setup.py", line 20, in long_description
        return open(os.path.join(sys.path[0], 'README.rst')).read()
    FileNotFoundError: [Errno 2] No such file or directory: '.../buildroot/utils/README.rst'

The corresponding code from cram's setup.py is:

    def long_description():
        """Get the long description from the README"""
        return open(os.path.join(sys.path[0], 'README.rst')).read()

Indeed, the Python documentation says:

https://docs.python.org/3.8/library/sys.html#sys.path
    "...
    As initialized upon program startup, the first item of this list,
    path[0], is the directory containing the script that was used to invoke
    the Python interpreter.
    ..."

Fix this by inserting explicitly at index 0 instead of appending to
sys.path.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
(cherry picked from commit ad042904f4)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2021-08-05 22:05:33 +02:00
arch ARC: Add support for generic HS48 processor 2021-01-16 09:58:26 +01:00
board configs/stm32f469_disco: fix kernel bootup 2021-06-22 08:52:39 +02:00
boot boot/uboot: add missing dependency to host-pkgconf 2021-08-03 22:10:22 +02:00
configs configs/stm32f469_disco: add host {dosfs, m}tools 2021-06-24 09:22:31 +02:00
docs docs: move the IRC channel away from Freenode 2021-06-10 08:36:37 +02:00
fs fs/cpio: add zstd as compression option 2021-01-16 22:45:34 +01:00
linux {linux, linux-headers}: bump 4.{4, 9, 14, 19}.x / 5.{4, 10, 11, 12}.x series 2021-06-12 16:54:19 +02:00
package package/samba4: needs host-flex 2021-08-05 21:41:26 +02:00
support boot/uboot: add missing dependency to host-pkgconf 2021-08-03 22:10:22 +02:00
system system: support br2-external init systems 2020-10-14 22:48:42 +02:00
toolchain toolchain: introduce BR2_TOOLCHAIN_HAS_BINUTILS_BUG_27597 2021-04-26 23:11:07 +02:00
utils utils/scanpypi: add setup.py script directory as sys.path[0] 2021-08-05 22:05:33 +02:00
.defconfig
.flake8 Revert ".flake8: fix check for 80/132 columns" 2021-01-02 17:38:20 +01:00
.gitignore
.gitlab-ci.yml gitlab-ci: update the image version 2020-08-15 09:47:00 +02:00
CHANGES Update for 2021.02.3 2021-06-12 16:58:31 +02:00
Config.in Config.in: disable PIC/PIE for microblaze 2021-08-05 12:58:46 +02:00
Config.in.legacy Config.in.legacy: fix BR2_PACKAGE_SCONESERVER_HTTP_SCONESITE_IMAGE 2021-05-07 09:34:19 +02:00
COPYING
DEVELOPERS DEVELOPERS: Add myself as rpcbind maintainer 2021-08-05 20:52:02 +02:00
Makefile Makefile: document the <pkg>-reinstall target 2021-07-14 09:20:18 +02:00
Makefile.legacy
README docs: move the IRC channel away from Freenode 2021-06-10 08:36:37 +02:00

Buildroot is a simple, efficient and easy-to-use tool to generate embedded
Linux systems through cross-compilation.

The documentation can be found in docs/manual. You can generate a text
document with 'make manual-text' and read output/docs/manual/manual.text.
Online documentation can be found at http://buildroot.org/docs.html

To build and use the buildroot stuff, do the following:

1) run 'make menuconfig'
2) select the target architecture and the packages you wish to compile
3) run 'make'
4) wait while it compiles
5) find the kernel, bootloader, root filesystem, etc. in output/images

You do not need to be root to build or run buildroot.  Have fun!

Buildroot comes with a basic configuration for a number of boards. Run
'make list-defconfigs' to view the list of provided configurations.

Please feed suggestions, bug reports, insults, and bribes back to the
buildroot mailing list: buildroot@buildroot.org
You can also find us on #buildroot on OFTC IRC.

If you would like to contribute patches, please read
https://buildroot.org/manual.html#submitting-patches