niess / python-appimage

AppImage distributions of Python
https://python-appimage.readthedocs.io/en/latest/
GNU General Public License v3.0
170 stars 24 forks source link

The unwanted crashing in case of warning: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. #44

Closed anki-code closed 2 years ago

anki-code commented 2 years ago

Hi!

The xxh project built system based on docker containers was crashed with error:

Step 9/10 : RUN python -m python_appimage build app /xxh/appimage
 ---> Running in 83823cdd8082
[2021-12-20 00:19:42,633] EXTRACT  python3.9.9-cp39-cp39-manylinux1_x86_64.AppImage
[2021-12-20 00:19:43,561] BUNDLE   xxh.desktop
[2021-12-20 00:19:43,562] BUNDLE   xxh.appdata.xml
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/usr/local/lib/python3.8/site-packages/python_appimage/__main__.py", line 113, in <module>
    main()
  File "/usr/local/lib/python3.8/site-packages/python_appimage/__main__.py", line 109, in main
    command.execute(*command._unpack_args(args))
  File "/usr/local/lib/python3.8/site-packages/python_appimage/commands/build/app.py", line 245, in execute
    system(('./AppDir/AppRun', '-m', 'pip', 'install', '-U', in_tree_build,
  File "/usr/local/lib/python3.8/site-packages/python_appimage/utils/system.py", line 42, in system
    raise RuntimeError(err)
RuntimeError: WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv

Please add ignoring of this pip warning.

Thanks!

niess commented 2 years ago

Hey @anki-code,

the warning message might have changed. I updated python-appimage in order to accept more generic pip warnings. Does it solve your issue?

anki-code commented 2 years ago

Yes! It works now! Many thanks @niess!

This was a simple fix https://github.com/niess/python-appimage/commit/ea71603f8e5c5460f24b12db022c2b4f977ac58b :) I should fix this myself :)