resolved news conflict

This commit is contained in:
Anthony Scopatz 2016-09-01 20:10:29 -04:00
commit 4f1cc49e37
35 changed files with 125 additions and 426 deletions

View file

@ -1,4 +1,4 @@
version: 0.4.5.{build}
version: 0.4.6.{build}
os: Windows Server 2012 R2
install:
- C:\Python35\Scripts\pip install -r requirements-tests.txt

View file

@ -4,10 +4,101 @@ Xonsh Change Log
.. current developments
v0.4.6
====================
**Added:**
* New option ``COMPLETIONS_CONFIRM``. When set, ``<Enter>`` is used to confirm
completion instead of running command while completion menu is displayed.
* NetBSD is now supported.
* Macro function calls are now available. These use a Rust-like
``f!(arg)`` syntax.
* Macro subprocess call now avalaible with the ``echo! x y z``
syntax.
* A new `event subsystem <http://xon.sh/tutorial_events.html>`_ has been added.
* howto install sections for Debian/Ubuntu and Fedora.
* ``History`` methods ``__iter__`` and ``__getitem__``
* ``tools.get_portions`` that yields parts of an iterable
* Added a py.test plugin to collect ``test_*.xsh`` files and run ``test_*()`` functions.
* ``__repr__`` and ``__str__`` magic method on LazyObject
**Changed:**
* ``create_module`` implementation on XonshImportHook
* Results of the ``bash`` tab completer are now properly escaped (quoted) when necessary.
* Foreign aliases that match xonsh builtin aliases are now ignored with a warning.
* ``prompt_toolkit`` completions now only show the rightmost portion
of a given completion in the dropdown
* The value of ``'none'`` is no longer allowed for ``$SHELL_TYPE`` just during the initial
load from the environment. ``-D``, later times, and other sources still work.
* ``yacc_debug=True`` now load the parser on the same thread that the
Parser instance is created. ``setup.py`` now uses this synchronous
form as it was causing the parser table to be missed by some package
managers.
* Tilde expansion for the home directory now has the same semantics as Bash.
Previously it only matched leading tildes.
* Context sensitive AST transformation now checks that all names in an
expression are in scope. If they are, then Python mode is retained. However,
if even one is missing, subprocess wrapping is attempted. Previously, only the
left-most name was examined for being within scope.
* ``dirstack.pushd`` and ``dirstack.popd`` now handle UNC paths (of form ``\\<server>\<share>\...``), but only on Windows.
They emulate behavior of `CMD.EXE` by creating a temporary mapped drive letter (starting from z: down) to replace
the ``\\<server>\<share>`` portion of the path, on the ``pushd`` and unmapping the drive letter when all references
to it are popped.
* And ``dirstack`` suppresses this temporary drive mapping funky jive if registry entry
``HKCU\software\microsoft\command processor\DisableUNCCheck`` (or HKLM\...) is a DWORD value 1. This allows Xonsh
to show the actual UNC path in your prompt string and *also* allows subprocess commands invoking `CMD.EXE` to run in
the expected working directory. See https://support.microsoft.com/en-us/kb/156276 to satisfy any lingering curiosity.
* ``lazy_locate_binary`` handles binary on different drive letter than current working directory (on Windows).
* ``_curr_session_parser`` now iterates over ``History``
* New implementation of bash completer with better performance and compatibility.
* ``$COMPLETIONS_BRACKETS`` is now available to determine whether or not to
include opening brackets in Python completions
* ``xonsh.bat`` tries to use `pylauncher <https://www.python.org/dev/peps/pep-0397/>`_ when available.
**Removed:**
* ``History`` method ``show``
* ``_hist_get_portion`` in favor of ``tools.get_portions``
* Unused imports in proc, flake8.
**Fixed:**
* xonsh modules imported now have the __file__ attribute
* Context senstitive AST transformer was not adding argument names to the
local scope. This would then enable extraneous subprocess mode wrapping
for expressions whose leftmost name was function argument. This has been
fixed by properly adding the argument names to the scope.
* Foreign shell functions that are mapped to empty filenames no longer
receive alaises since they can't be found to source later.
* Correctly preserve arguments given to xon.sh, in case there are quoted ones.
* Environment variables in subprocess mode were not being expanded
unless they were in a sting. They are now expanded properly.
* Fixed a bug that prevented xonsh from running scripts with code caching disabled.
* Text of instructions to download missing program now does not get off and
appears in whole.
* Fix some test problems when win_unicode_console was installed on windows.
* Fixed bug that prompt string and ``$PWD`` failed to track change in actual working directory if the
invoked Python function happened to change it (e.g via ```os.chdir()```. Fix is to update ``$PWD``
after each command in ```BaseShell.default()```.
* The interactive prompt now correctly handles multiline strings.
* ``cd \\<server>\<share>`` now works when $AUTO_PUSHD is set, either creating a temporary mapped drive or simply
setting UNC working directory based on registry ``DisableUNCCheck``. However, if $AUTO_PUSHD is not set and UNC
checking is enabled (default for Windows), it issues an error message and fails. This improves on prior behavior,
which would fail to change the current working directory, but would set $PWD and prompt string to the UNC path,
creating false expectations.
* fix parsing for tuple of tuples (like `(),()`)
* ``sys.stdin``, ``sys.stdout``, ``sys.stderr`` no longer complete with
opening square brackets
* xonsh now properly handles syntax error messages arising from using values in inappropriate contexts (e.g., ``del 7``).
v0.4.5
====================
@ -29,7 +120,7 @@ v0.4.5
syntax do not overlap, they perform very different operations. Please see
the xonsh FAQ for more information on trade-offs and mitigation strategies.
* ``which -v`` now calls superhelp, which will print highlighted source.
* Added xontribs:
* Added xontribs:
* `z (Tracks your most used directories, based on 'frecency'.) <https://github.com/astronouth7303/xontrib-z>`_
* amalgamate.py now supports relative imports.
* ``history show`` args ``-t``, ``-f``, ``-T`` ``+T`` to filter commands by timestamp
@ -46,7 +137,7 @@ v0.4.5
* ``_hist_show`` now uses ``_hist_get`` to print out the commands.
* ``xonsh.completers`` sub-package is now fully lazy.
* The vox xontrib now takes flags very similar to Python's venv tool. Use
* The vox xontrib now takes flags very similar to Python's venv tool. Use
``vox --help <command>`` to learn more.
* Xontribs may now define ``__all__`` as a module top-level to limit what gets exported to the shell context
* xon.sh uses the interpreter used to install instead of the default python3.
@ -73,10 +164,10 @@ v0.4.5
**Removed:**
* Anaconda Build is shutting down so we can no longer build conda development packages.
All references to these packages are removed from the documentation.
* Removed conda build recipe since the it is no longer used for Anaconda Build.
The recipe used to build xonsh on conda-forge can be found here:
* Anaconda Build is shutting down so we can no longer build conda development packages.
All references to these packages are removed from the documentation.
* Removed conda build recipe since the it is no longer used for Anaconda Build.
The recipe used to build xonsh on conda-forge can be found here:
https://github.com/conda-forge/xonsh-feedstock/blob/master/recipe/meta.yaml
@ -89,7 +180,7 @@ v0.4.5
* Fixed parser error line number exception from being raised while trying to
raise a SyntaxError.
* Made pip completer more robust to when pip is not installed.
* Fix a startup problem on windows caused by a refactor of Prompt_toolkit.
* Fix a startup problem on windows caused by a refactor of Prompt_toolkit.
https://github.com/jonathanslenders/python-prompt-toolkit/commit/a9df2a2
* ``ensure_slice`` bugfix for -1 index/slice
* Alias tab completion works again

View file

@ -1,16 +0,0 @@
**Added:** None
**Changed:**
* Context sensitive AST transformation now checks that all names in an
expression are in scope. If they are, then Python mode is retained. However,
if even one is missing, subprocess wrapping is attempted. Previously, only the
left-most name was examined for being within scope.
**Deprecated:** None
**Removed:** None
**Fixed:** None
**Security:** None

View file

@ -1,13 +0,0 @@
**Added:** None
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:**
* fix parsing for tuple of tuples (like `(),()`)
**Security:** None

View file

@ -1,13 +0,0 @@
**Added:** None
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:**
* Fixed a bug that prevented xonsh from running scripts with code caching disabled.
**Security:** None

View file

@ -1,17 +0,0 @@
**Added:** None
**Changed:**
* ``$COMPLETIONS_BRACKETS`` is now available to determine whether or not to
include opening brackets in Python completions
**Deprecated:** None
**Removed:** None
**Fixed:**
* ``sys.stdin``, ``sys.stdout``, ``sys.stderr`` no longer complete with
opening square brackets
**Security:** None

View file

@ -1,13 +0,0 @@
**Added:** None
**Changed:**
* Results of the ``bash`` tab completer are now properly escaped (quoted) when necessary.
**Deprecated:** None
**Removed:** None
**Fixed:** None
**Security:** None

View file

@ -1,14 +0,0 @@
**Added:**
* New option ``COMPLETIONS_CONFIRM``. When set, ``<Enter>`` is used to confirm
completion instead of running command while completion menu is displayed.
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:** None
**Security:** None

View file

@ -1,27 +0,0 @@
**Added:** None
**Changed:**
* ``dirstack.pushd`` and ``dirstack.popd`` now handle UNC paths (of form `\\<server>\<share>\...`), but only on Windows.
They emulate behavior of `CMD.EXE` by creating a temporary mapped drive letter (starting from z: down) to replace
the `\\<server>\<share>` portion of the path, on the ``pushd`` and unmapping the drive letter when all references
to it are popped.
* And ``dirstack`` suppresses this temporary drive mapping funky jive if registry entry
`HKCU\software\microsoft\command processor\DisableUNCCheck` (or HKLM\...) is a DWORD value 1. This allows Xonsh
to show the actual UNC path in your prompt string and *also* allows subprocess commands invoking `CMD.EXE` to run in
the expected working directory. See https://support.microsoft.com/en-us/kb/156276 to satisfy any lingering curiosity.
**Deprecated:** None
**Removed:** None
**Fixed:**
* ``cd \\<server>\<share>`` now works when $AUTO_PUSHD is set, either creating a temporary mapped drive or simply
setting UNC working directory based on registry ``DisableUNCCheck``. However, if $AUTO_PUSHD is not set and UNC
checking is enabled (default for Windows), it issues an error message and fails. This improves on prior behavior,
which would fail to change the current working directory, but would set $PWD and prompt string to the UNC path,
creating false expectations.
**Security:** None

View file

@ -1,14 +0,0 @@
**Added:** None
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:**
* Foreign shell functions that are mapped to empty filenames no longer
receive alaises since they can't be found to source later.
**Security:** None

View file

@ -1,13 +0,0 @@
**Added:**
* A new `event subsystem <http://xon.sh/tutorial_events.html>`_ has been added.
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:** None
**Security:** None

View file

@ -1,14 +0,0 @@
**Added:** None
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:**
* Environment variables in subprocess mode were not being expanded
unless they were in a sting. They are now expanded properly.
**Security:** None

View file

@ -1,13 +0,0 @@
**Added:** None
**Changed:**
* New implementation of bash completer with better performance and compatibility.
**Deprecated:** None
**Removed:** None
**Fixed:** None
**Security:** None

View file

@ -1,13 +0,0 @@
**Added:** None
**Changed:**
* Foreign aliases that match xonsh builtin aliases are now ignored with a warning.
**Deprecated:** None
**Removed:** None
**Fixed:** None
**Security:** None

View file

@ -1,16 +0,0 @@
**Added:** None
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:**
* Context senstitive AST transformer was not adding argument names to the
local scope. This would then enable extraneous subprocess mode wrapping
for expressions whose leftmost name was function argument. This has been
fixed by properly adding the argument names to the scope.
**Security:** None

View file

@ -1,21 +0,0 @@
**Added:**
* ``History`` methods ``__iter__`` and ``__getitem__``
* ``tools.get_portions`` that yields parts of an iterable
**Changed:**
* ``_curr_session_parser`` now iterates over ``History``
**Deprecated:** None
**Removed:**
* ``History`` method ``show``
* ``_hist_get_portion`` in favor of ``tools.get_portions``
**Fixed:** None
**Security:** None

View file

@ -1,15 +0,0 @@
**Added:**
* ``__repr__`` and ``__str__`` magic method on LazyObject
**Changed:** None
**Deprecated:** None
**Removed:**
* Unused imports in proc, flake8.
**Fixed:** None
**Security:** None

View file

@ -1,13 +0,0 @@
**Added:**
* howto install sections for Debian/Ubuntu and Fedora.
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:** None
**Security:** None

View file

@ -1,9 +1,5 @@
**Added:**
* Macro function calls are now available. These use a Rust-like
``f!(arg)`` syntax.
* Macro subprocess call now avalaible with the ``echo! x y z``
syntax.
* Macro context managers are now available via the ``with!``
syntax.

View file

@ -1,15 +0,0 @@
**Added:** None
**Changed:**
* ``create_module`` implementation on XonshImportHook
**Deprecated:** None
**Removed:** None
**Fixed:**
* xonsh modules imported now have the __file__ attribute
**Security:** None

View file

@ -1,13 +0,0 @@
**Added:** None
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:**
* xonsh now properly handles syntax error messages arising from using values in inappropriate contexts (e.g., ``del 7``).
**Security:** None

View file

@ -1,13 +0,0 @@
**Added:** None
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:**
* The interactive prompt now correctly handles multiline strings.
**Security:** None

View file

@ -1,13 +0,0 @@
**Added:**
* NetBSD is now supported.
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:** None
**Security:** None

View file

@ -1,13 +0,0 @@
**Added:** None
**Changed:**
* The value of ``'none'`` is no longer allowed for ``$SHELL_TYPE`` just during the initial load from the environment. ``-D``, later times, and other sources still work.
**Deprecated:** None
**Removed:** None
**Fixed:** None
**Security:** None

View file

@ -1,13 +0,0 @@
**Added:** None
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:**
* Correctly preserve arguments given to xon.sh, in case there are quoted ones.
**Security:** None

View file

@ -1,14 +0,0 @@
**Added:** None
**Changed:**
* ``prompt_toolkit`` completions now only show the rightmost portion
of a given completion in the dropdown
**Deprecated:** None
**Removed:** None
**Fixed:** None
**Security:** None

View file

@ -1,15 +0,0 @@
**Added:** None
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:**
* Fixed bug that prompt string and ``$PWD`` failed to track change in actual working directory if the
invoked Python function happened to change it (e.g via ```os.chdir()```. Fix is to update ``$PWD``
after each command in ```BaseShell.default()```.
**Security:** None

View file

@ -1,14 +0,0 @@
**Added:** None
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:**
* Text of instructions to download missing program now does not get off and
appears in whole.
**Security:** None

View file

@ -1,16 +0,0 @@
**Added:** None
**Changed:**
* ``yacc_debug=True`` now load the parser on the same thread that the
Parser instance is created. ``setup.py`` now uses this synchronous
form as it was causing the parser table to be missed by some package
managers.
**Deprecated:** None
**Removed:** None
**Fixed:** None
**Security:** None

View file

@ -1,13 +0,0 @@
**Added:**
* Added a py.test plugin to collect `test_*.xsh` files and run `test_*()` functions.
**Changed:** None
**Deprecated:** None
**Removed:** None
**Fixed:** None
**Security:** None

View file

@ -1,14 +0,0 @@
**Added:** None
**Changed:**
* Tilde expansion dor the home directory now has the same semantics as Bash.
Previously it only matched leading tildes.
**Deprecated:** None
**Removed:** None
**Fixed:** None
**Security:** None

View file

@ -9,7 +9,7 @@ from xonsh.built_ins import ensure_list_of_strs
from xonsh.execer import Execer
from xonsh.tools import XonshBlockError
from xonsh.events import events
from xonsh.platform import ON_WINDOWS
from tools import DummyShell, sp
@ -65,3 +65,16 @@ def xonsh_builtins():
del builtins.compilex
del builtins.aliases
del builtins.events
if ON_WINDOWS:
try:
import win_unicode_console
except ImportError:
pass
else:
@pytest.fixture(autouse=True)
def disable_win_unicode_console(monkeypatch):
""" Disable win_unicode_console if it is present since it collides with
pytests ouptput capture"""
monkeypatch.setattr(win_unicode_console, 'enable', lambda: None)

View file

@ -23,6 +23,13 @@ from xonsh.dirstack import _unc_tempDrives
HERE = os.path.abspath(os.path.dirname(__file__))
PARENT = os.path.dirname(HERE)
def drive_in_use(letter):
return ON_WINDOWS and os.system('vol {}: 2>nul>nul'.format(letter)) == 0
pytestmark = pytest.mark.skipif(any(drive_in_use(l) for l in 'ywzx'),
reason='Drive letters used by tests are '
'are already used by Windows.')
@pytest.yield_fixture(scope="module")
def shares_setup(tmpdir_factory):

View file

@ -1,4 +1,4 @@
__version__ = '0.4.5'
__version__ = '0.4.6'
# amalgamate exclude jupyter_kernel parser_table parser_test_table pyghooks
# amalgamate exclude winutils wizard pytest_plugin

View file

@ -133,7 +133,10 @@ class CommandsCache(cabc.Mapping):
if os.path.isfile(full_name)
), None)
if local_bin:
return os.path.abspath(os.path.relpath(local_bin, cwd))
if os.path.splitdrive(cwd)[0] != os.path.splitdrive(local_bin)[0]: # if cwd not on same drive as bin
return os.path.abspath(local_bin) # avoid ValueError in relpath()
else:
return os.path.abspath(os.path.relpath(local_bin, cwd))
cached = next((cmd for cmd in possibilities if cmd in self._cmds_cache), None)
if cached: