* feat: use ArgparserAlias for xonfig
* test: update test for xonfig completions
* refactor: update docs
* refactor: use function based completer
* fix: remove old import
* docs:
* fix: merge issues
* test: move xsh_with_aliases to root conftest.py
* docs:
* feat: set subparser's prog from func-name
* feat: add colored help formatter and alias builder
closes#4284
* feat: add auto-completion support to argparser
* test: update test for completer
* fix: getting doc from params that have annotation
* refactor: use filter-function for checking alias completions
* doc: add discussion abount check for alias having parser
see discussion on
https://github.com/xonsh/xonsh/pull/4267
* type fix
* refactor: use function based completer
* test: fix failing argparser test
* docs: update news item
* update completion for argparser sub-commands to append_space
from comment on
https://github.com/xonsh/xonsh/pull/4267#discussion_r676044508
* docs: update docstring typo
* refactor: move inspect import to top
* feat: support option strings before positionals
and add env setting for showing completions for options by default
* test: update tests after adding new $ALIAS_COMPLETIONS_OPTIONS_BY_DEFAULT
* add suggested completion_context_parse fixture
* docs: add suggested doc for dispatch function
* refactor: use try/except for import of typing.annotated
* refactor: move complete_argparser_aliases to completers/aliases.py
* refactor: move argparser completer to its own module
* style:
* refactor: rename completer to not clash with argparse
* fix: expand option's descriptions
* fix: add completer/argparser to amalgam
* args: accept --rc dir to load dir/*.xsh
* test_main: add a test for --rc dir
* args: drop unused --config-path, not read anywhere
* news: add entry for rcdir changes
* xonshrc_context: return loaded instead of context, don't touch env
This function returned the context, but the return value is not used by
the sole call site (and would inconsistently be either the env or ctx
depending on other arguments). Redefine the function to return what was
loaded.
The function will also no longer touch the environment variables
XONSHRC, XONSHRC_DIR or LOADED_RC_FILES.
* XonshSession: add rc_files list, and set in start_services
* LOADED_RC_FILES: drop completely
* xonfig: add RC files
* test_main: update tests for changes to XONSHRC{,_DIR}
* news: add entry for xonshrc changes
* Use full paths when launching processes on Windows
Addresses issue #3763.
* Add news item
* Suppress stderr from "which"
* Replace xonsh.xoreutils.which with shutil.which
* Use existing resolved binary location
* Ensure PATHEXT mock is not overwritten
* Add tests for running excutables on windows
* Ensure we don't set overwrite command when binary_loc is none
* tweak tests
* Revert "Ensure PATHEXT mock is not overwritten"
This reverts commit ce5d6ac091.
* Use monkeypatch for chdir
Co-authored-by: Morten Lund <melund@gmail.com>
* Add ends_with_colon_token tool
* Add execer test for comment ending with a colon
* Use ends_with_colon_token() to catch non-indented blocks in execer
* Use ends_with_colon_token() for automatic indentation in prompt_toolkit and readline
* Add news
* chore: adding py310 to ci
though this will require code/parser changes, this is to prepare for
upcoming adoption
* fix: set python version as string
* fix: reference to master -> main
* fix: coverage is not reported in master
- disable amalgamation
1. during coverage report tests
2. qa tools like mypy may follow imports
- use python 3.9 for coverage and qa report. since it will have more
coverage and better typing support
* chore: use py3.10 with setup-py action
* chore: add news-item check job
* fix: py3.10 error while starting
the match statement is not supported.
while the syntax support is only upto py3.8
* fix: news-item checker
* chore: enable fail report for py310 tests
* test: add test for ptk_shell
* tests: Run tests with the amalgamated xonsh
* tests: Test xonsh loads correctly interactively
* tests: Ensure tests run from amalgamated xonsh
* environ: Separate $XONSH_DEBUG and $XONSH_NO_AMALGAMATE
* tests: Keep XONSH_NO_AMALGAMATE in a comment for ease of debugging
* tests: Fix monkeypatch for amalgamated code
* refactor: remove usage of global variables in abbrevs.py
* chore: add flake8-mutable to prevent mutable defaults
* fix: abbrevs expand test
* refactor: add xonsh session singleton
* refactor: fix circular errors when using xonshSession as singleton
* refactor: remove black magicked builtin attributes
* style: black format tests as well
* refactor: update tests to use xonsh-session singleton
* refactor: update abbrevs to not use builtins
* test: remove DummyCommandsCache and patch orig class
* fix: failing test_command_completers
* test: use monkeypatch to update xession fixture
* fix: failing test_pipelines
* fix: failing test_main
* chore: run test suit as single invocation
* test: fix tests/test_xonsh.xsh
* refactor: remove builtins from docs/conf.py
* fix: mypy error in jobs
* fix: test error from test_main
* test: close xession error in test_command_completers
* chore: use pytest-cov for reporting coverage
this will include subprocess calls, and will increase coverage
* style:
* test_main: test lots of startup order combinations
This is based on the startup order described in
https://github.com/xonsh/xonsh/issues/4096#issuecomment-791991841
and adds an (ugly) parameterised test which tries lots of different
CLI combinations, and verifies which RC files (if any) get loaded,
and in what order.
* test_script_startup: skip on windows
* ast: Fix annotated assignment
* ast: Support annotated variable without a value
* tests: Test annotated assign statements
* news: Add annotated-assignment
* Add support for rc.d drop-in configuration directories
* main: change how --rc, --no-rc are handled
Explicitly pass --no-rc rather than signalling it as an empty --rc, to
indicate that we should suppress both XONSHRC and XONSHRCDIR in that
case.
* Rename XONSHRCDIR -> XONSHRC_DIR
* xonshrc_context: document setting env for XONSHRC_DIR
* main: --rc foo.xsh should suppress XONSHRC_DIR
* Add saving current working directory (cwd) to the history
* Added XONSH_HISTORY_SAVE_CWD and create PromptHistorySetting section
* news
* Move dummy history to the distinct file
* tests
* tests
Co-authored-by: a <a@a.a>
* fix: update failing commands-cache tests
in some cases, the thread updates the binaries faster than the next call
* chore: upgrade black to 21.5b0
* chore: upgrade mypy to 0.812 version
* fix: handle corrupt commands-cache file
* fix: parser-table output dir. this should be same as the defaults
* fix: flake8 error
* Added env variable to ignore ./ and ../ in filepath completion
* Changed ignore_dots to complete dots as always, never, or upon matching
* Updated news
* Added default 'matching'
* Update ignore_dots.rst
* black
* fix test
* tests
Co-authored-by: Bailey Morgan <bailey.mccarty.morgan@gmail.com>
Co-authored-by: a <a@a.a>
* feat: use saved commands_cache between runs
this will speed-up startup time by a small factor (around 0.15s on my
system with ssd and ryzen5)
* test: update env-variable handling for cmds-cache tests
* refactor: add env-variable to control saving commands-cache
* refactor: mypy error fix for commands_cache
* fix: update handling max(iterable
* test: add tests for commands-cache new version
* docs: update env variable doc
* test: add more test for commands-cache caching behaviour