facultyai / faculty-sync

Synchronise a local directory with your Faculty platform workspace
https://pypi.org/project/faculty_sync/
Apache License 2.0
10 stars 1 forks source link

Ensure prompt_toolkit is less than version 3.0 #49

Closed Matt-Haugh closed 4 years ago

Matt-Haugh commented 4 years ago

prompt_toolkit versions >= 3.0 use the asyncio event loop natively, rather then using its own implementations of event loops. This causes the import statement on line 11 of ui.py in faculty-sync to fail. To prevent this from happening I have changed the requirements file to ensure the prompt_toolkit version is less than 3.0.

Alternatively, we could follow the solution suggested in the prompt_toolkit docs:

from prompt_toolkit import __version__ as ptk_version

PTK3 = ptk_version.startswith('3.')

if PTK3:
    from asyncio import get_event_loop
else:
    from prompt_toolkit.eventloop import get_event_loop
pbugnion commented 4 years ago

Thanks, this looks great!

I'll release this in the next few days.

srstevenson commented 4 years ago

Should we do this in setup.py too?

Matt-Haugh commented 4 years ago

Good shout, I'll submit a PR tomorrow.