Commit graph

10214 commits

Author SHA1 Message Date
Noortheen Raja
713fe6a120 fix: deprecation warning 2021-12-23 06:32:47 +05:30
Noortheen Raja
e66c08168b test: refactor vox tests
vox create is costly. reuse it between tests
2021-12-23 06:32:47 +05:30
Noortheen Raja
f5367f6083 feat: add upgrade command
fixes #2095
2021-12-23 06:32:47 +05:30
Noorhteen Raja NJ
71f2258c57
test: update test configs (#4603) 2021-12-23 06:31:26 +05:30
Noorhteen Raja NJ
c524028a78
fix: prompt getting git branch (#4607)
fixes #4450
2021-12-21 17:28:02 +05:30
Angus Hollands
5091c8368e
Refactor: make session loading explicit (#4540)
* 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>
2021-12-21 13:07:53 +05:30
Noorhteen Raja NJ
888cb819c9
history transfer (#4604)
* refactor: update `history gc` cli usage

* feat: added `history transfer` command

cli-utils now provides hook to parser.add_argument call

* test: test refactor

* docs:

* fix: mypy error

* fix: remove debug line
2021-12-20 08:36:29 +05:30
Evan Hubinger
8fc3e1f5f6
Fix OSError on Windows with GnuWin32 (#4599)
* Fix OSError on Windows

* Clean up PR
2021-12-16 16:09:52 -05:00
Noorhteen Raja NJ
5a985427e7
feat: add sub-command to print current completions (#4586)
* feat: `completer complete` command is added to test current completions

* fix: tests
2021-12-12 08:47:47 +05:30
Angus Hollands
31978e7c61
Fix: support Conda environments when running on non-conda interpreter (#4532)
* Fix: support Conda environments when running on non-conda interpreter

* Chore: remove unused import

* Docs: add news item

* Update fix-conda-env-system.rst

* Update fix-conda-env-system.rst

Co-authored-by: Noorhteen Raja NJ <jnoortheen@gmail.com>
2021-12-10 10:18:16 +05:30
Noorhteen Raja NJ
7ee5b26064
feat: update command completions to show description as well (#4488)
* feat: update command completions to show description as well

closes #3823

* test: fix failing tests on windows

* fix: failing tests on windows machine
2021-12-07 10:33:41 -05:00
Noorhteen Raja NJ
c2d25ac251
pre-commit hook for pyupgrade (#4583)
* chore: add pyupgrade

* refactor: upgrade code to py3.7+

ran `pre-commit run pyupgrade -a` while excluding changes to ply

* fix: flake errors
2021-12-06 14:42:26 -05:00
Andy Kipp
d6aa169eae
docs: add "The xonsh shell community" to the readme (#4585)
* 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>
2021-12-03 09:39:19 -05:00
Noorhteen Raja NJ
68e2123b90
Update development.txt 2021-12-02 12:46:47 +05:30
Jason R. Coombs
03ddd829d6
Clarify behavior for capturing and storing output in the history. (#4578)
* Clarify behavior for capturing and storing output in the history. Fixes #4576.

*  Fade to black.
2021-12-02 00:12:42 +05:30
Angus Hollands
a4c9c684ec
Docs: elaborate on parse phases comments (#4534)
* Docs: elaborate slightly on parse phases

* Chore: update news

* Delete docs-elaborate-parse-phases.rst

Co-authored-by: Noorhteen Raja NJ <jnoortheen@gmail.com>
2021-12-01 13:07:17 +05:30
Noorhteen Raja NJ
b2516737b6
code refactor (#4571)
* style:

* refactor: tests of xoreutils
2021-11-30 08:23:32 -05:00
Noorhteen Raja NJ
9a8cc74c4b
refactor: remove xonsh.ptk2 module (#4570) 2021-11-30 08:22:31 -05:00
Noorhteen Raja NJ
adafa20b88
adopt NEP-0029 (#4568)
* 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
2021-11-29 12:48:48 -05:00
Noorhteen Raja NJ
73609bf87a
feat: option to show only longest/descriptive arg-completions (#4483) 2021-11-29 10:56:20 -05:00
Noorhteen Raja NJ
b031047beb
add fish shell based completer (#4569)
* feat: add fish shell based completer

* refactor: use filter-func to filter results
2021-11-29 21:02:32 +05:30
Noorhteen Raja NJ
d5c6c9e4e6
docs: remove xompletions api doc (#4479) 2021-11-27 09:59:23 -05:00
Noorhteen Raja NJ
0053d55e3d
feat: auto-completion support for source-foreign (#4564)
* 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
2021-11-27 16:28:04 +05:30
Noorhteen Raja NJ
6d756ef7c9
Vox improvements (#4549)
* refactor: confirm before deleting the folder

fix: failing tests

* feat: shorter positional argument which is optional

cli-utils

* refactor: vox-default interpreter from system's default

* feat: add new vox commands info, wipe

* feat: add new vox commands toggle-ssp, runin, runinall

* feat: add new vox commands toggle-ssp, runin, runinall

* feat: add new vox commands project-set, project-get

* feat: implement vox new 'pip installs/requirements' and project linking

* test: update failing tests
2021-11-26 23:37:35 +05:30
omjadas
e1168b92d2
fix: sourcing files before foreign aliases/functions (#4565) 2021-11-24 13:38:57 +05:30
omjadas
a49a538ab2
Simplify foreign functions (#4393)
* chore: simplify foreign functions

* fix: sourcing multiple foreign files

* refactor: address review comments

* Update docs/aliases.rst

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>

* refactor: run black

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
2021-11-23 17:01:42 -05:00
Noorhteen Raja NJ
5f0ec33447
Ap/aliases completer (#4486)
* 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:
2021-11-23 12:34:12 -05:00
mattmc3
4edac0bb3f
New xontribs (#4544)
* Add xontrib-up

* Add xontrib-default-command

* Add news for new xontribs
2021-11-23 04:09:21 +05:30
Evgeny
3d753ea3be
Add Sublime Text 4 extension to the Editors page (#4552) 2021-11-23 04:06:48 +05:30
Noorhteen Raja NJ
7f4d606f30
fix: docs build fail on tracer calls without spec (#4559) 2021-11-22 11:13:30 -05:00
Samuel Dion-Girardeau
f7343dc6f1
Remove syntax override for .xsh files (#4554)
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.
2021-11-22 10:07:04 -05:00
Angus Hollands
99bdf5600a
Fix: don't display welcome if $XONSHRC_DIR member is found (#4531)
* 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>
2021-11-18 12:42:29 -05:00
Gil Forsyth
337cf25a40 Updated CHANGELOG for 0.11.0 2021-11-17 15:37:41 -05:00
Gil Forsyth
d32ac62848 bumped version to 0.11.0 2021-11-17 15:35:27 -05:00
Gil Forsyth
1f62e7331f Updated authorship for 0.11.0 2021-11-17 15:34:51 -05:00
Gil Forsyth
88552f873b
Update authors file 2021-11-17 15:32:27 -05:00
Eleni E
a558f9cf47
Add quotes in autocomplete when filename contains brackets (#4528) 2021-11-17 13:58:09 -05:00
Vasilis Gerakaris
b13298f3cd
docs: update header image link for Contributing.md (#4527) 2021-11-17 13:57:07 -05:00
Noorhteen Raja NJ
0c13e8c008
adding convention for short boolean flags (#4520)
* 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
2021-11-17 13:51:18 -05:00
Noorhteen Raja NJ
5df00b863a
chore: use conda to install py310 (#4519) 2021-11-17 13:40:19 -05:00
Kaarel Pärtel
8da06b4446
fix: escape curly braces for the prompt cwd (#4511)
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
2021-11-17 13:39:28 -05:00
IJR222
7331d8aee5
Update editors.rst (#4526)
Fixed typo.
2021-11-02 08:52:05 -04:00
Vasilis Gerakaris
e762dc57ab
fix: handle None value on XSH.env if UPDATE_OS_ENVIRON is set` (#4507) 2021-10-15 12:27:34 -04:00
Vasilis Gerakaris
3457d7263f
refactor: display meaningful message when running xonsh -c "xonfig colors" (#4508)
Closes #4376.
2021-10-15 09:06:34 -04:00
circuit10
40bbbcf86e
Fix copy/paste error in xontribs_meta (#4509) 2021-10-15 09:00:18 -04:00
Noorhteen Raja NJ
d51a03bc74
fix: random test failures on macos (#4518) 2021-10-15 08:53:30 -04:00
Noorhteen Raja NJ
4b0918f9e3
fix: failing ci checks with black and mypy (#4517)
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
2021-10-14 17:01:44 -04:00
Vasilis Gerakaris
a5fcfba8be
fix: implement __hash__ method for Env (#4512)
Allows caching in `lru_cache` for `tools.suggest_commands()`

Closes #4510
2021-10-14 17:00:39 -04:00
Noorhteen Raja NJ
20ef5a033c
Ap/trace (#4453)
* feat: use argparser-alias for trace

* test: add test for trace cli

* fix: qs

* fix: update import path

* docs:
2021-10-13 10:04:59 -04:00
Noorhteen Raja NJ
a3c1b2429e
argparserAlias - vox (#4437)
* feat: use argparser-alias for vox

* feat: vox.create --interpreter completions

* refactor: use func based completer

* fix: implement interpreter completion

* docs:

* refactor: update import path of cli_utils

* style: convert to f-strings

* fix: failing tests

* fix: failing tests

completer from base_completer appears
2021-10-13 10:02:06 -04:00