Skip to content

Commit

Permalink
Improve xonsh, windows
Browse files Browse the repository at this point in the history
  • Loading branch information
evhub committed May 29, 2023
1 parent c75f6f3 commit 5605b80
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion coconut/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ def get_bool_env_var(env_var, default=False):

conda_build_env_var = "CONDA_BUILD"

disabled_xonsh_modes = ("exec", "eval")
enabled_xonsh_modes = ("single",)

# -----------------------------------------------------------------------------------------------------------------------
# DOCUMENTATION CONSTANTS:
Expand Down
6 changes: 3 additions & 3 deletions coconut/integrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

from coconut.constants import (
coconut_kernel_kwargs,
disabled_xonsh_modes,
enabled_xonsh_modes,
)
from coconut.util import memoize_with_exceptions

Expand Down Expand Up @@ -137,14 +137,14 @@ def new_try_subproc_toks(self, ctxtransformer, node, *args, **kwargs):

def new_parse(self, parser, code, mode="exec", *args, **kwargs):
"""Coconut-aware version of xonsh's _parse."""
if self.loaded and mode not in disabled_xonsh_modes:
if self.loaded and mode in enabled_xonsh_modes:
code, _ = self.compile_code(code)
return parser.__class__.parse(parser, code, mode=mode, *args, **kwargs)

def new_ctxvisit(self, ctxtransformer, node, inp, ctx, mode="exec", *args, **kwargs):
"""Version of ctxvisit that ensures looking up original lines in inp
using Coconut line numbers will work properly."""
if self.loaded and mode not in disabled_xonsh_modes:
if self.loaded and mode in enabled_xonsh_modes:
from xonsh.tools import get_logical_line

# hide imports to avoid circular dependencies
Expand Down
2 changes: 1 addition & 1 deletion coconut/root.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
VERSION = "3.0.1"
VERSION_NAME = None
# False for release, int >= 1 for develop
DEVELOP = 14
DEVELOP = 15
ALPHA = False # for pre releases rather than post releases

assert DEVELOP is False or DEVELOP >= 1, "DEVELOP must be False or an int >= 1"
Expand Down
36 changes: 18 additions & 18 deletions coconut/tests/main_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,24 +877,24 @@ def test_simple_minify(self):
run_runnable(["-n", "--minify"])


@add_test_func_names
class TestExternal(unittest.TestCase):

if not PYPY or PY2:
def test_prelude(self):
with using_path(prelude):
comp_prelude()
if MYPY and PY38:
run_prelude()

def test_bbopt(self):
with using_path(bbopt):
comp_bbopt()
if not PYPY and PY38 and not PY310:
install_bbopt()

# more appveyor timeout prevention
if not WINDOWS:
# more appveyor timeout prevention
if not WINDOWS:
@add_test_func_names
class TestExternal(unittest.TestCase):

if not PYPY or PY2:
def test_prelude(self):
with using_path(prelude):
comp_prelude()
if MYPY and PY38:
run_prelude()

def test_bbopt(self):
with using_path(bbopt):
comp_bbopt()
if not PYPY and PY38 and not PY310:
install_bbopt()

def test_pyprover(self):
with using_path(pyprover):
comp_pyprover()
Expand Down

0 comments on commit 5605b80

Please sign in to comment.