keygenqt/aurora-cli

TypeError: unsupported operand type(s) for |: 'type' and 'type' in AltLinux

Closed this issue · 5 comments

When installing within AltLinux - this error happens:

[root@host-33 ~]# aurora-cli psdk install --latest
Traceback (most recent call last):
  File "/usr/local/bin/aurora-cli", line 5, in <module>
    from aurora_cli.main import main
  File "/usr/local/lib/python3/site-packages/aurora_cli/__main__.py", line 23, in <module>
    from aurora_cli.src.features.flutter.group_flutter import group_flutter
  File "/usr/local/lib/python3/site-packages/aurora_cli/src/features/flutter/group_flutter.py", line 24, in <module>
    from aurora_cli.src.features.flutter.impl.git_progress_alive_bar import GitProgressAliveBar
  File "/usr/local/lib/python3/site-packages/aurora_cli/src/features/flutter/impl/git_progress_alive_bar.py", line 21, in <module>
    class GitProgressAliveBar(RemoteProgress):
  File "/usr/local/lib/python3/site-packages/aurora_cli/src/features/flutter/impl/git_progress_alive_bar.py", line 52, in GitProgressAliveBar
    cur_count: str | float,
TypeError: unsupported operand type(s) for |: 'type' and 'type'

That happens as the python version is below 3.10 https://stackoverflow.com/a/76712732
Could be fixed by upgrading the python version or through try: except clause in the package.
Another way is to install another version of python with https://github.com/grmzk/python-manager (download and open-install rmp).
Then (you probably already have sudo https://www.altlinux.org/Sudo)

sudo hasher-useradd $USER
sudo python-manager --build 3.10.1

After build (takes around 10-15 minutes) - open-install python 3.10 rpm
then

sudo python3.10 -m venv venv
source ./venv/bin/activate
sudo python3.10 -m pip install aurora-cli
aurora-cli psdk install --latest

аналогично, не запускается

$ aurora-cli

Traceback (most recent call last):
  File "/home/sash0k/.local/bin/aurora-cli", line 5, in <module>
    from aurora_cli.main import main
  File "/home/sash0k/.local/lib/python3/site-packages/aurora_cli/__main__.py", line 22, in <module>
    from aurora_cli.src.features.devices.group_device import group_device  # noqa: E402
  File "/home/sash0k/.local/lib/python3/site-packages/aurora_cli/src/features/devices/group_device.py", line 19, in <module>
    from aurora_cli.src.features.devices.impl.common import common_command, common_run, common_install, common_upload
  File "/home/sash0k/.local/lib/python3/site-packages/aurora_cli/src/features/devices/impl/common.py", line 20, in <module>
    from aurora_cli.src.support.helper import get_path_files
  File "/home/sash0k/.local/lib/python3/site-packages/aurora_cli/src/support/helper.py", line 103, in <module>
    def find_path_file(extension: str, path: Path) -> Path | None:
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

$ cat /etc/os-release

NAME="Simply Linux"
VERSION="10.2 (Captain Finn)"

$ python3 --version

Python 3.9.18

UPD: более свежий питон в Альтах появится в p11, которая ещё не вышла. На текущий момент актуальный релиз у них 10.2

К сожалению у меня нет Альта что бы проверить. Буду рад мерж-реквесту или могу порекомендовать Ubuntu 22.04. По возможности чекну Альт, пока ее нет.

Тут не сколько в самом альт проблема, а в том что питон версии 3.9.18. Хотя бы тогда в тербованиях укажите минимальную версию питона

Добавил МР: #17