* Refactor: Don't modify XSH in Execer
This is not an invariant change - the __del__ method of the execer now does not unload the session. This is probably what we want - the session should be the final arbiter of when it goes out of scope, and we might need an explicit mechanism to handle this.
* Refactor: make import hook Execer explicit
This is ugly for now, but helps raise the global state modifications to the surface
* Style: run black
* Refactor: add `update_cache` to `CommandsCache`
Previously a lot of internal usage of `all_commands` was for the updating side-effect. Now we make that a separate routine.
* Refactor: remove args from XonshSession constructor
* Refactor: move non stateful XonshSession methods to __init__
* Refactor: don't create custom class for namespace
* Refactor: auto-generate set of default builtins
* Refactor: set session attributes to None in constructor
* Refactor: don't test hasattr for known attribute
* Refactor: add methods to restore and disable Python exit
* Refactor: add initial value for XSH.aliases
* Refactor: don't default getattr for known attribute
* Refactor: make _lastflush a closer and move to `load()`
* Fix: catch $path even if empty.
This shouldn't ever actually manifest itself, but whilst we're here!
* Refactor: support existing usage of install_import_hooks
* Style: run black
* Refactor: remove unneeded import
* Docs: add news item
* Fix: news item
* Refactor: remove unused arg
* docs: fix news item
* fix: no duplicate calls
add helpers properties to completion-context
* refactor: importing a module should not affect the session
the user has to have XSH loaded before
* fix: todo item for testing imphooks
Co-authored-by: Noortheen Raja <jnoortheen@gmail.com>
* feat: update command completions to show description as well
closes#3823
* test: fix failing tests on windows
* fix: failing tests on windows machine
* docs: add "The xonsh shell community" to the readme
* docs: fix spelling
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
* chore: adopt NEP-0029 for py version deprecation policy
fixes#4560
* chore: drop py3.6 from CI
* docs: add news item
* fix: failing qa because latest version to flake8-bugbear
see https://github.com/PyCQA/flake8-bugbear/issues/208
* chore: require >=py3.7
* feat: auto-completion support for source-foreign
* feat: add completions for source-bash/zsh/cmd
* refactor: change the boolean flags names that defaults to True
* feat: create field to define alias-completer
this will resolve checking parser or alias. Now the alias can define how
it completes.
will solve
https://github.com/xonsh/xonsh/pull/4267#discussion_r676066853
* docs:
* fix: mypy error
* fix: rst qa
* style:
This override was introduced in 387340d435, on Oct 1st, 2020.
However, github/linguist has since incorporated Xonsh as a language.
See https://github.com/github/linguist/pull/5274, and it automatically
matches `.xsh` files.
This change will just give nicer languages stats, because the actual
syntax highlighting is still MagicStack/MagicPython.
* Fix: don't display welcome if $XONSHRC_DIR member is found
* Docs: add news item
* Update news/fix-xonshrc-dir-welcome.rst
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
* Lint: black
* Update news/fix-xonshrc-dir-welcome.rst
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
* feat: use NumpyDoc to represent Parsed docstring
in cli_utils.py
* feat: set argparse boolean option from default values
* refactor: shorter Arg in annotation
by following convention in cli_utils.py
* fix: get description without Parameters
* fix: qa errors
If a directory was named for example '{RED}', that would get
interpreted as a color string and the prompt would not show the
direcotry name and would color it instead. Using dir names like
'{{foo}}' or simply '{' would break the prompt outright.
There was not much documentation on the prompt formating, but it seems
that escaping a curly by doubling it makes the prompt display all
curlies correctly.
fixes#4381
pip21.3 has changed the behaviour of build - https://pip.pypa.io/en/stable/news/#v21-3 to use in-tree-build by default. this creates amalgamated files.
this will install as editable dependency during qa checks
for some reason mypy exclude for __amalgam__.py is not working