project-alice-assistant / AliceCLI

GNU General Public License v3.0
1 stars 7 forks source link

Broken PyInquirer dependency on Python 3.10 #4

Closed aaronchantrill closed 2 years ago

aaronchantrill commented 2 years ago

PyInquirer requires a pretty out of date version of prompt-toolkit (1.0.14, current version is 3.0.24), which has a broken import statement in Python 3.10.

The file prompt_toolkit/styles/from_dict.py includes the line from collections import Mapping which needs to be updated to from collections.abc import Mapping.

Psycho suggested swapping out another compatible library: possibly https://github.com/magmax/python-inquirer. I'll try it and see how it goes.

aaronchantrill commented 2 years ago

python-inquirer seems to have the same bad requirement (prompt-toolkit==1.0.14).

inquirerpy looks like it supports the latest prompt-toolkit

aaronchantrill commented 2 years ago

InquirerPy works, but does not include a Separator method. However, just including a menu item like '--' works, or you can copy/paste the Separator method from PyInquirer (which does the same thing, just '-'*15):

class Separator:
    line = '-' * 15

    def __init__(self, line=None):
        if line:
            self.line = line

    def __str__(self):
        return self.line