Hello community,

here is the log from the commit of package xonsh for openSUSE:Factory checked 
in at 2018-07-18 22:54:37
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/xonsh (Old)
 and      /work/SRC/openSUSE:Factory/.xonsh.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "xonsh"

Wed Jul 18 22:54:37 2018 rev:7 rq:622801 version:0.6.9

Changes:
--------
--- /work/SRC/openSUSE:Factory/xonsh/xonsh.changes      2018-06-29 
22:27:08.406450056 +0200
+++ /work/SRC/openSUSE:Factory/.xonsh.new/xonsh.changes 2018-07-18 
22:55:39.306619622 +0200
@@ -1,0 +2,37 @@
+Sat Jul  7 08:53:48 UTC 2018 - [email protected]
+
+- update to version 0.6.9:
+ * Added:
+  * New xonsh standard library ``xonsh.lib`` subpackage
+  * ``xonsh.lib.os.indir`` a context manager for temporarily entering into a 
directory
+  * ``xonsh.lib.subprocess.run`` and ``xonsh.lib.subprocess.check_call``
+    subprocess stubs using ``xonsh`` as the backend
+ * Fixed:
+  * update xoreutils._which.which() for python 3.x support.
+  * Fixed issue with incorrect strip lengths for prefixes with quotes in them
+  * Fixed bash script to also consider leading double quotes and not just 
single
+    quotes
+  * Launching xonsh with prompt_toolkit version 2.x no longer fails, and 
instead fallsback to readline shell. This is a patch for until prompt_toolkit 
2.x support is fully implemented. See PR #2570
+- update to version 0.6.8:
+ * Fixed:
+  * completions relative to ``CDPATH`` only trigger when used with ``cd``
+  * Import of ``ctypes.util`` is now explictly performed, as needed.
+    Python v3.7 no longer imports this module along with ``ctypes``.
+  * Fixed issue with pygments-cache not properly generating a cache the first
+    time when using prompt-toolkit. This was due to a lingering lazy import
+    of ``pkg_resources`` that has been removed.
+  * Removed duplicate ``pip`` completer
+  * ``bash_completion`` no longer returns invalid prefix lengths for 
directories
+    containing escape file names
+  * Fixed error when using redirection (e.g., >) on Windows.
+- update to version 0.6.7:
+ * Changed:
+  * Xonsh live example has been re-added back to the documentation.
+ * Fixed:
+  * Fixed issue where xonsh would fail to properly return the terminal prompt
+    (and eat up 100% CPU) after a failed subprocess command in interactive mode
+    if ``$RAISE_SUBPROC_ERROR = True``.
+  * ``xonsh.tokenize.tok_name`` no longer mutates the standard library 
``tokenize.tok_name``.
+    A copy is made on import instead.
+
+-------------------------------------------------------------------

Old:
----
  0.6.6.tar.gz

New:
----
  0.6.9.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ xonsh.spec ++++++
--- /var/tmp/diff_new_pack.adOhZp/_old  2018-07-18 22:55:40.670615097 +0200
+++ /var/tmp/diff_new_pack.adOhZp/_new  2018-07-18 22:55:40.694615019 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           xonsh
-Version:        0.6.6
+Version:        0.6.9
 Release:        0
 Summary:        A general purpose, Python-ish shell
 License:        BSD-3-Clause AND BSD-2-Clause

++++++ 0.6.6.tar.gz -> 0.6.9.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/.appveyor.yml 
new/xonsh-0.6.9/.appveyor.yml
--- old/xonsh-0.6.6/.appveyor.yml       2018-06-06 19:12:10.000000000 +0200
+++ new/xonsh-0.6.9/.appveyor.yml       2018-07-06 22:07:37.000000000 +0200
@@ -1,4 +1,4 @@
-version: 0.6.6.{build}
+version: 0.6.9.{build}
 os: Windows Server 2012 R2
 environment:
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/.gitignore new/xonsh-0.6.9/.gitignore
--- old/xonsh-0.6.6/.gitignore  2018-06-06 19:12:10.000000000 +0200
+++ new/xonsh-0.6.9/.gitignore  2018-07-06 22:07:37.000000000 +0200
@@ -34,7 +34,7 @@
 # Virtualenv
 pip-selfcheck.json
 bin/
-lib/
+/lib/
 include/
 
 # Mac
@@ -57,3 +57,5 @@
 
 # Rever
 rever/
+# Allow the lib
+!/xonsh/lib
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/CHANGELOG.rst 
new/xonsh-0.6.9/CHANGELOG.rst
--- old/xonsh-0.6.6/CHANGELOG.rst       2018-06-06 19:12:10.000000000 +0200
+++ new/xonsh-0.6.9/CHANGELOG.rst       2018-07-06 22:07:37.000000000 +0200
@@ -4,6 +4,66 @@
 
 .. current developments
 
+v0.6.9
+====================
+
+**Added:**
+
+* New xonsh standard library ``xonsh.lib`` subpackage
+* ``xonsh.lib.os.indir`` a context manager for temporarily entering into a 
directory
+* ``xonsh.lib.subprocess.run`` and ``xonsh.lib.subprocess.check_call``
+  subprocess stubs using ``xonsh`` as the backend
+
+
+**Fixed:**
+
+* update xoreutils._which.which() for python 3.x support.
+* Fixed issue with incorrect strip lengths for prefixes with quotes in them
+* Fixed bash script to also consider leading double quotes and not just single
+  quotes
+* Launching xonsh with prompt_toolkit version 2.x no longer fails, and instead 
fallsback to readline shell. This is a patch for until prompt_toolkit 2.x 
support is fully implemented. See PR #2570
+
+
+
+
+v0.6.8
+====================
+
+**Fixed:**
+
+* completions relative to ``CDPATH`` only trigger when used with ``cd``
+* Import of ``ctypes.util`` is now explictly performed, as needed.
+  Python v3.7 no longer imports this module along with ``ctypes``.
+* Fixed issue with pygments-cache not properly generating a cache the first
+  time when using prompt-toolkit. This was due to a lingering lazy import
+  of ``pkg_resources`` that has been removed.
+* Removed duplicate ``pip`` completer
+* ``bash_completion`` no longer returns invalid prefix lengths for directories
+  containing escape file names
+* Fixed error when using redirection (e.g., >) on Windows.
+
+
+
+
+v0.6.7
+====================
+
+**Changed:**
+
+* Xonsh live example has been re-added back to the documentation.
+
+
+**Fixed:**
+
+* Fixed issue where xonsh would fail to properly return the terminal prompt
+  (and eat up 100% CPU) after a failed subprocess command in interactive mode
+  if ``$RAISE_SUBPROC_ERROR = True``.
+* ``xonsh.tokenize.tok_name`` no longer mutates the standard library 
``tokenize.tok_name``.
+  A copy is made on import instead.
+
+
+
+
 v0.6.6
 ====================
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/docs/comparison.rst 
new/xonsh-0.6.9/docs/comparison.rst
--- old/xonsh-0.6.6/docs/comparison.rst 2018-06-06 19:12:10.000000000 +0200
+++ new/xonsh-0.6.9/docs/comparison.rst 2018-07-06 22:07:37.000000000 +0200
@@ -1,4 +1,3 @@
-
 Comparison
 ==========
 Xonsh is significantly different from most other shells or shell tools. The 
following
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/docs/devguide.rst 
new/xonsh-0.6.9/docs/devguide.rst
--- old/xonsh-0.6.6/docs/devguide.rst   2018-07-18 22:55:41.442612538 +0200
+++ new/xonsh-0.6.9/docs/devguide.rst   2018-07-18 22:55:41.678611755 +0200
@@ -1 +1 @@
-symbolic link to .. include:: ../CONTRIBUTING.rst
+symbolic link to ../CONTRIBUTING.rst
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/docs/index.rst 
new/xonsh-0.6.9/docs/index.rst
--- old/xonsh-0.6.6/docs/index.rst      2018-06-06 19:12:10.000000000 +0200
+++ new/xonsh-0.6.9/docs/index.rst      2018-07-06 22:07:37.000000000 +0200
@@ -1,6 +1,7 @@
-
 .. include:: intro.rst
 
+.. include:: tryitnow.rst
+
 .. include:: comparison.rst
 
 .. include:: installation.rst
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/docs/tryitnow.rst 
new/xonsh-0.6.9/docs/tryitnow.rst
--- old/xonsh-0.6.6/docs/tryitnow.rst   1970-01-01 01:00:00.000000000 +0100
+++ new/xonsh-0.6.9/docs/tryitnow.rst   2018-07-06 22:07:37.000000000 +0200
@@ -0,0 +1,9 @@
+Try It Now!
+===========
+Try out xonsh right here in the browser. Just press the triangle play button in
+the bottom right of the `Repl.it <https://repl.it>`_ frame below.
+**Note:** this is not a fully featured xonsh instance due to repl.it 
limitations.
+
+.. raw:: html
+
+    <iframe height="400px" width="100%" 
src="https://repl.it/@scopatz/xonsh?lite=true"; scrolling="no" frameborder="no" 
allowtransparency="true" allowfullscreen="true" sandbox="allow-forms 
allow-pointer-lock allow-popups allow-same-origin allow-scripts 
allow-modals"></iframe>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/rever.xsh new/xonsh-0.6.9/rever.xsh
--- old/xonsh-0.6.6/rever.xsh   2018-06-06 19:12:10.000000000 +0200
+++ new/xonsh-0.6.9/rever.xsh   2018-07-06 22:07:37.000000000 +0200
@@ -1,8 +1,8 @@
 $PROJECT = $GITHUB_ORG = $GITHUB_REPO = 'xonsh'
 $WEBSITE_URL = 'http://xon.sh'
 $ACTIVITIES = ['version_bump', 'changelog', 'pytest',
-               'tag', 'push_tag',  'pypi', 'conda_forge', 'ghpages',
-               'ghrelease', 'sphinx',
+               'tag', 'push_tag', 'ghrelease', 'sphinx',
+               'ghpages', 'pypi', 'conda_forge',
                ]
 
 $VERSION_BUMP_PATTERNS = [
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/setup.cfg new/xonsh-0.6.9/setup.cfg
--- old/xonsh-0.6.6/setup.cfg   2018-06-06 19:12:10.000000000 +0200
+++ new/xonsh-0.6.9/setup.cfg   2018-07-06 22:07:37.000000000 +0200
@@ -6,7 +6,9 @@
     *.py E122
     *.py E402
     tests/tools.py E128
+    # flake8 gives incorrect unused import errors, F401
     xonsh/ast.py F401
+    xonsh/platform.py F401
     xonsh/built_ins.py F821 E721
     xonsh/commands_cache.py F841
     xonsh/history.py F821
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/setup.py new/xonsh-0.6.9/setup.py
--- old/xonsh-0.6.6/setup.py    2018-06-06 19:12:10.000000000 +0200
+++ new/xonsh-0.6.9/setup.py    2018-07-06 22:07:37.000000000 +0200
@@ -306,9 +306,11 @@
         classifiers=['Programming Language :: Python :: 3'],
         packages=['xonsh', 'xonsh.ply.ply', 'xonsh.ptk', 'xonsh.parsers',
                   'xonsh.xoreutils', 'xontrib',
-                  'xonsh.completers', 'xonsh.history', 'xonsh.prompt'],
-        package_dir={'xonsh': 'xonsh', 'xontrib': 'xontrib'},
-        package_data={'xonsh': ['*.json', '*.githash'], 'xontrib': ['*.xsh']},
+                  'xonsh.completers', 'xonsh.history', 'xonsh.prompt',
+                  'xonsh.lib'],
+        package_dir={'xonsh': 'xonsh', 'xontrib': 'xontrib', 'xonsh.lib': 
'xonsh/lib'},
+        package_data={'xonsh': ['*.json', '*.githash'], 'xontrib': ['*.xsh'],
+                      'xonsh.lib': ['*.xsh']},
         cmdclass=cmdclass,
         scripts=scripts,
         )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/tests/test_integrations.py 
new/xonsh-0.6.9/tests/test_integrations.py
--- old/xonsh-0.6.6/tests/test_integrations.py  2018-06-06 19:12:10.000000000 
+0200
+++ new/xonsh-0.6.9/tests/test_integrations.py  2018-07-06 22:07:37.000000000 
+0200
@@ -233,6 +233,13 @@
 
 echo @$(which ls)
 """, 'spam spam sausage spam\n', 0),
+#
+# test redirection
+#
+("""
+echo Just the place for a snark. >tttt
+cat tttt
+""", 'Just the place for a snark.\n', 0),
 ]
 
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/tests/test_lib/test_os.xsh 
new/xonsh-0.6.9/tests/test_lib/test_os.xsh
--- old/xonsh-0.6.6/tests/test_lib/test_os.xsh  1970-01-01 01:00:00.000000000 
+0100
+++ new/xonsh-0.6.9/tests/test_lib/test_os.xsh  2018-07-06 22:07:37.000000000 
+0200
@@ -0,0 +1,10 @@
+import os
+from xonsh.lib.os import indir
+
+
+def test_indir():
+    path = os.path.dirname(__file__)
+    assert ![pwd].output.strip() != path
+    with indir(path):
+        assert ![pwd].output.strip() == path
+    assert ![pwd].output.strip() != path
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/tests/test_lib/test_subprocess.xsh 
new/xonsh-0.6.9/tests/test_lib/test_subprocess.xsh
--- old/xonsh-0.6.6/tests/test_lib/test_subprocess.xsh  1970-01-01 
01:00:00.000000000 +0100
+++ new/xonsh-0.6.9/tests/test_lib/test_subprocess.xsh  2018-07-06 
22:07:37.000000000 +0200
@@ -0,0 +1,27 @@
+import tempfile
+
+from xonsh.lib.os import indir
+from xonsh.lib.subprocess import run, check_call
+
+
+def test_run():
+    with tempfile.TemporaryDirectory() as tmpdir:
+        with indir(tmpdir):
+            run(['touch', 'hello.txt'])
+            assert 'hello.txt' in g`*.txt`
+            rm hello.txt
+            mkdir tst_dir
+            run(['touch', 'hello.txt'], cwd='tst_dir')
+            assert 'tst_dir/hello.txt' in g`tst_dir/*.txt`
+
+
+def test_check_call():
+    with tempfile.TemporaryDirectory() as tmpdir:
+        with indir(tmpdir):
+            check_call(['touch', 'hello.txt'])
+            assert 'hello.txt' in g`*.txt`
+            rm hello.txt
+            mkdir tst_dir
+            check_call(['touch', 'hello.txt'], cwd='tst_dir')
+            print(g`tst_dir/*.txt`)
+            assert 'tst_dir/hello.txt' in g`tst_dir/*.txt`
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/tests/test_path_completers.py 
new/xonsh-0.6.9/tests/test_path_completers.py
--- old/xonsh-0.6.6/tests/test_path_completers.py       2018-06-06 
19:12:10.000000000 +0200
+++ new/xonsh-0.6.9/tests/test_path_completers.py       2018-07-06 
22:07:37.000000000 +0200
@@ -1,9 +1,17 @@
+import builtins
+
 import pytest
+from unittest.mock import patch
 
 from xonsh.environ import Env
 import xonsh.completers.path as xcp
 
 
[email protected](autouse=True)
+def xonsh_execer_autouse(xonsh_builtins, xonsh_execer):
+    return xonsh_execer
+
+
 def test_pattern_need_quotes():
     # just make sure the regex compiles
     xcp.PATTERN_NEED_QUOTES.match('')
@@ -18,3 +26,16 @@
                                     'CDPATH': set(),
     }
     xcp.complete_path('[1-0.1]', '[1-0.1]', 0, 7, dict())
+
+
+@patch('xonsh.completers.path._add_cdpaths')
+def test_cd_path_no_cd(mock_add_cdpaths, xonsh_builtins):
+    xonsh_builtins.__xonsh_env__ = {'CASE_SENSITIVE_COMPLETIONS': False,
+                                    'GLOB_SORTED': True,
+                                    'SUBSEQUENCE_PATH_COMPLETION': False,
+                                    'FUZZY_PATH_COMPLETION': False,
+                                    'SUGGEST_THRESHOLD': 3,
+                                    'CDPATH': ['/'],
+    }
+    xcp.complete_path('a', 'cat a', 4, 5, dict())
+    mock_add_cdpaths.assert_not_called()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/xonsh/__init__.py 
new/xonsh-0.6.9/xonsh/__init__.py
--- old/xonsh-0.6.6/xonsh/__init__.py   2018-06-06 19:12:10.000000000 +0200
+++ new/xonsh-0.6.9/xonsh/__init__.py   2018-07-06 22:07:37.000000000 +0200
@@ -1,4 +1,4 @@
-__version__ = '0.6.6'
+__version__ = '0.6.9'
 
 
 # amalgamate exclude jupyter_kernel parser_table parser_test_table pyghooks
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/xonsh/completers/bash_completion.py 
new/xonsh-0.6.9/xonsh/completers/bash_completion.py
--- old/xonsh-0.6.6/xonsh/completers/bash_completion.py 2018-06-06 
19:12:10.000000000 +0200
+++ new/xonsh-0.6.9/xonsh/completers/bash_completion.py 2018-07-06 
22:07:37.000000000 +0200
@@ -14,7 +14,7 @@
 import functools
 import subprocess
 
-__version__ = '0.2.1'
+__version__ = '0.2.2'
 
 
 @functools.lru_cache(1)
@@ -206,7 +206,7 @@
 
 _quote_readline_by_ref()
 {{
-    if [[ $1 == \'* ]]; then
+    if [[ $1 == \'* || $1 == \"* ]]; then
         # Leave out first character
         printf -v $2 %s "${{1:1}}"
     else
@@ -284,7 +284,8 @@
     quote_paths : callable, optional
         A functions that quotes file system paths. You shouldn't normally need
         this as the default is acceptable 99+% of the time. This function 
should
-        a set of the new paths and a boolean for whether the paths were quoted.
+        return a set of the new paths and a boolean for whether the paths were
+        quoted.
 
     Returns
     -------
@@ -343,18 +344,18 @@
     # Ensure input to `commonprefix` is a list (now required by Python 3.6)
     commprefix = os.path.commonprefix(list(out))
     strip_len = 0
+    strip_prefix = prefix.strip("\"'")
     while strip_len < len(prefix):
-        if commprefix.startswith(prefix[strip_len:]):
+        if commprefix.startswith(strip_prefix[strip_len:]):
             break
         strip_len += 1
 
     if '-o noquote' not in complete_stmt:
         out, need_quotes = quote_paths(out, '', '')
-        strip_len += int(need_quotes)
     if '-o nospace' in complete_stmt:
         out = set([x.rstrip() for x in out])
 
-    return out, len(prefix) - strip_len
+    return out, max(len(prefix) - strip_len, 0)
 
 
 def bash_complete_line(line, return_line=True, **kwargs):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/xonsh/completers/init.py 
new/xonsh-0.6.9/xonsh/completers/init.py
--- old/xonsh-0.6.6/xonsh/completers/init.py    2018-06-06 19:12:10.000000000 
+0200
+++ new/xonsh-0.6.9/xonsh/completers/init.py    2018-07-06 22:07:37.000000000 
+0200
@@ -22,7 +22,6 @@
         ('completer', complete_completer),
         ('skip', complete_skipper),
         ('pip', complete_pip),
-        ('xpip', complete_pip),
         ('cd', complete_cd),
         ('rmdir', complete_rmdir),
         ('xonfig', complete_xonfig),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/xonsh/completers/path.py 
new/xonsh-0.6.9/xonsh/completers/path.py
--- old/xonsh-0.6.6/xonsh/completers/path.py    2018-06-06 19:12:10.000000000 
+0200
+++ new/xonsh-0.6.9/xonsh/completers/path.py    2018-07-06 22:07:37.000000000 
+0200
@@ -20,6 +20,19 @@
     return re.compile(pattern)
 
 
+def cd_in_command(line):
+    """Returns True if "cd" is a token in the line, False otherwise."""
+    lexer = builtins.__xonsh_execer__.parser.lexer
+    lexer.reset()
+    lexer.input(line)
+    have_cd = False
+    for tok in lexer:
+        if tok.type == 'NAME' and tok.value == 'cd':
+            have_cd = True
+            break
+    return have_cd
+
+
 def _path_from_partial_string(inp, pos=None):
     if pos is None:
         pos = len(inp)
@@ -295,7 +308,7 @@
     if tilde in prefix:
         home = os.path.expanduser(tilde)
         paths = {s.replace(home, tilde) for s in paths}
-    if cdpath:
+    if cdpath and cd_in_command(line):
         _add_cdpaths(paths, prefix)
     paths = set(filter(filtfunc, paths))
     paths, _ = _quote_paths({_normpath(s) for s in paths},
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/xonsh/lib/__init__.py 
new/xonsh-0.6.9/xonsh/lib/__init__.py
--- old/xonsh-0.6.6/xonsh/lib/__init__.py       1970-01-01 01:00:00.000000000 
+0100
+++ new/xonsh-0.6.9/xonsh/lib/__init__.py       2018-07-06 22:07:37.000000000 
+0200
@@ -0,0 +1,6 @@
+# setup import hooks
+import xonsh.imphooks
+
+xonsh.imphooks.install_import_hooks()
+
+del xonsh
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/xonsh/lib/os.xsh 
new/xonsh-0.6.9/xonsh/lib/os.xsh
--- old/xonsh-0.6.6/xonsh/lib/os.xsh    1970-01-01 01:00:00.000000000 +0100
+++ new/xonsh-0.6.9/xonsh/lib/os.xsh    2018-07-06 22:07:37.000000000 +0200
@@ -0,0 +1,11 @@
+"""Xonsh extension of the standard library os module, using xonsh for
+subprocess calls"""
+from contextlib import contextmanager
+
+
+@contextmanager
+def indir(d):
+    """Context manager for temporarily entering into a directory."""
+    ![pushd @(d)]
+    yield
+    ![popd]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/xonsh/lib/subprocess.xsh 
new/xonsh-0.6.9/xonsh/lib/subprocess.xsh
--- old/xonsh-0.6.6/xonsh/lib/subprocess.xsh    1970-01-01 01:00:00.000000000 
+0100
+++ new/xonsh-0.6.9/xonsh/lib/subprocess.xsh    2018-07-06 22:07:37.000000000 
+0200
@@ -0,0 +1,19 @@
+"""Xonsh extension of the standard library subprocess module, using xonsh for
+subprocess calls"""
+from xonsh.tools import XonshCalledProcessError as CalledProcessError
+from xonsh.lib.os import indir
+
+
+def run(cmd, cwd=None, check=False):
+    """Drop in replacement for ``subprocess.run`` like functionality"""
+    if cwd is None:
+        cwd = '.'
+    with indir(cwd), ${...}.swap(RAISE_SUBPROC_ERROR=check):
+        p = ![@(cmd)]
+    return p
+
+
+def check_call(cmd, cwd=None):
+    """Drop in replacement for ``subprocess.check_call`` like functionality"""
+    p = run(cmd, cwd=cwd, check=True)
+    return p.returncode
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/xonsh/platform.py 
new/xonsh-0.6.9/xonsh/platform.py
--- old/xonsh-0.6.6/xonsh/platform.py   2018-06-06 19:12:10.000000000 +0200
+++ new/xonsh-0.6.9/xonsh/platform.py   2018-07-06 22:07:37.000000000 +0200
@@ -116,14 +116,14 @@
 
 @functools.lru_cache(1)
 def has_prompt_toolkit():
-    """ Tests if the `prompt_toolkit` is available. """
+    """Tests if the `prompt_toolkit` is available."""
     spec = importlib.util.find_spec('prompt_toolkit')
     return (spec is not None)
 
 
 @functools.lru_cache(1)
 def ptk_version():
-    """ Returns `prompt_toolkit.__version__` if available, else ``None``. """
+    """Returns `prompt_toolkit.__version__` if available, else ``None``."""
     if has_prompt_toolkit():
         import prompt_toolkit
         return getattr(prompt_toolkit, '__version__', '<0.57')
@@ -141,12 +141,18 @@
 
 
 @functools.lru_cache(1)
-def ptk_version_is_supported():
+def ptk_above_min_supported():
     minimum_required_ptk_version = (1, 0)
     return ptk_version_info()[:2] >= minimum_required_ptk_version
 
 
 @functools.lru_cache(1)
+def ptk_below_max_supported():
+    ptk_max_version_cutoff = (2, 0)
+    return ptk_version_info()[:2] < ptk_max_version_cutoff
+
+
[email protected]_cache(1)
 def best_shell_type():
     if ON_WINDOWS or has_prompt_toolkit():
         return 'prompt_toolkit'
@@ -487,7 +493,9 @@
 @lazyobject
 def LIBC():
     """The platform dependent libc implementation."""
+    global ctypes
     if ON_DARWIN:
+        import ctypes.util
         libc = ctypes.CDLL(ctypes.util.find_library("c"))
     elif ON_CYGWIN:
         libc = ctypes.CDLL('cygwin1.dll')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/xonsh/proc.py 
new/xonsh-0.6.9/xonsh/proc.py
--- old/xonsh-0.6.6/xonsh/proc.py       2018-06-06 19:12:10.000000000 +0200
+++ new/xonsh-0.6.9/xonsh/proc.py       2018-07-06 22:07:37.000000000 +0200
@@ -549,7 +549,7 @@
                                                        self._signal_winch)
         # start up process
         if ON_WINDOWS and stdout is not None:
-            os.set_handle_inheritable(stdout.fileno(), False)
+            os.set_inheritable(stdout.fileno(), False)
 
         try:
             self.proc = proc = subprocess.Popen(*args,
@@ -2149,8 +2149,12 @@
                 rtn is not None and
                 rtn > 0 and
                 builtins.__xonsh_env__.get('RAISE_SUBPROC_ERROR')):
-            raise subprocess.CalledProcessError(rtn, spec.cmd,
-                                                output=self.output)
+            try:
+                raise subprocess.CalledProcessError(rtn, spec.cmd,
+                                                    output=self.output)
+            finally:
+                # this is need to get a working terminal in interactive mode
+                self._return_terminal()
 
     #
     # Properties
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/xonsh/ptk/__init__.py 
new/xonsh-0.6.9/xonsh/ptk/__init__.py
--- old/xonsh-0.6.6/xonsh/ptk/__init__.py       2018-06-06 19:12:10.000000000 
+0200
+++ new/xonsh-0.6.9/xonsh/ptk/__init__.py       2018-07-06 22:07:37.000000000 
+0200
@@ -1,5 +0,0 @@
-# must come before ptk / pygments imports
-from xonsh.lazyasd import load_module_in_background
-
-load_module_in_background('pkg_resources', debug='XONSH_DEBUG',
-                          replacements={'pygments.plugin': 'pkg_resources'})
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/xonsh/pytest_plugin.py 
new/xonsh-0.6.9/xonsh/pytest_plugin.py
--- old/xonsh-0.6.6/xonsh/pytest_plugin.py      2018-06-06 19:12:10.000000000 
+0200
+++ new/xonsh-0.6.9/xonsh/pytest_plugin.py      2018-07-06 22:07:37.000000000 
+0200
@@ -53,8 +53,8 @@
         self._test_func = test_func
         self._test_module = test_module
 
-    def runtest(self):
-        self._test_func()
+    def runtest(self, *args, **kwargs):
+        self._test_func(*args, **kwargs)
 
     def repr_failure(self, excinfo):
         """ called when self.runtest() raises an exception. """
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/xonsh/shell.py 
new/xonsh-0.6.9/xonsh/shell.py
--- old/xonsh-0.6.6/xonsh/shell.py      2018-06-06 19:12:10.000000000 +0200
+++ new/xonsh-0.6.9/xonsh/shell.py      2018-07-06 22:07:37.000000000 +0200
@@ -8,7 +8,7 @@
 import warnings
 
 from xonsh.platform import (best_shell_type, has_prompt_toolkit,
-                            ptk_version_is_supported)
+                            ptk_above_min_supported, ptk_below_max_supported)
 from xonsh.tools import XonshError, print_exception
 from xonsh.events import events
 import xonsh.history.main as xhm
@@ -132,11 +132,19 @@
                 warnings.warn('prompt_toolkit is not available, using '
                               'readline instead.')
                 shell_type = 'readline'
-            elif not ptk_version_is_supported():
+            elif not ptk_above_min_supported():
                 warnings.warn('prompt-toolkit version < v1.0.0 is not '
                               'supported. Please update prompt-toolkit. Using '
                               'readline instead.')
                 shell_type = 'readline'
+            elif not ptk_below_max_supported():
+                warnings.warn('prompt-toolkit version 2.0 is not yet '
+                              'supported. Please see Github PR #2570 for '
+                              'latest status. To use prompt-toolkit now you '
+                              'can downgrade to version 1.x with\n'
+                              'xpip install "prompt_toolkit<2"\n'
+                              'Starting xonsh with readline shell instead.')
+                shell_type = 'readline'
         self.shell_type = env['SHELL_TYPE'] = shell_type
         # actually make the shell
         if shell_type == 'none':
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/xonsh/tokenize.py 
new/xonsh-0.6.9/xonsh/tokenize.py
--- old/xonsh-0.6.6/xonsh/tokenize.py   2018-06-06 19:12:10.000000000 +0200
+++ new/xonsh-0.6.9/xonsh/tokenize.py   2018-07-06 22:07:37.000000000 +0200
@@ -24,6 +24,7 @@
 import builtins
 import itertools
 import collections
+import token
 from token import (AMPER, AMPEREQUAL, AT, CIRCUMFLEX,
                    CIRCUMFLEXEQUAL, COLON, COMMA, DEDENT, DOT, DOUBLESLASH,
                    DOUBLESLASHEQUAL, DOUBLESTAR, DOUBLESTAREQUAL, ENDMARKER, 
EQEQUAL,
@@ -46,8 +47,7 @@
 #
 # token modifications
 #
-import token
-
+tok_name = tok_name.copy()
 __all__ = token.__all__ + ["COMMENT", "tokenize", "detect_encoding",
                            "NL", "untokenize", "ENCODING", "TokenInfo",
                            "TokenError", 'SEARCHPATH', 'ATDOLLAR', 'ATEQUAL',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/xonsh-0.6.6/xonsh/xoreutils/_which.py 
new/xonsh-0.6.9/xonsh/xoreutils/_which.py
--- old/xonsh-0.6.6/xonsh/xoreutils/_which.py   2018-06-06 19:12:10.000000000 
+0200
+++ new/xonsh-0.6.9/xonsh/xoreutils/_which.py   2018-07-06 22:07:37.000000000 
+0200
@@ -261,7 +261,7 @@
     If no match is found for the command, a WhichError is raised.
     """
     try:
-        absName, fromWhere = whichgen(command, path, verbose, exts).next()
+        absName, fromWhere = next(whichgen(command, path, verbose, exts))
     except StopIteration:
         raise WhichError("Could not find '%s' on the path." % command)
     if verbose:


Reply via email to