mirror of
https://github.com/xonsh/xonsh.git
synced 2025-03-04 08:24:40 +01:00
don't require prompt toolkit for docs on user side
we'll make sure it's available on CI when the docs are generated for the website, but it shouldn't fail to build in userspace just because of the ptk events hack thing
This commit is contained in:
parent
91653dafa8
commit
bc7d4117e9
1 changed files with 8 additions and 3 deletions
11
docs/conf.py
11
docs/conf.py
|
@ -11,6 +11,7 @@ import os
|
|||
import sys
|
||||
import builtins
|
||||
import inspect
|
||||
import importlib
|
||||
|
||||
os.environ['XONSH_DEBUG'] = '1'
|
||||
|
||||
|
@ -20,9 +21,13 @@ from xonsh.xontribs import xontrib_metadata
|
|||
from xonsh import main
|
||||
from xonsh.commands_cache import CommandsCache
|
||||
|
||||
# hacky runaround to import PTK-specific events
|
||||
builtins.__xonsh_env__ = Env()
|
||||
from xonsh.ptk.shell import events
|
||||
spec = importlib.util.find_spec('prompt_toolkit')
|
||||
if spec is not None:
|
||||
# hacky runaround to import PTK-specific events
|
||||
builtins.__xonsh_env__ = Env()
|
||||
from xonsh.ptk.shell import events
|
||||
else:
|
||||
from xonsh.events import events
|
||||
|
||||
sys.path.insert(0, os.path.dirname(__file__))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue