Commit graph

10126 commits

Author SHA1 Message Date
Noorhteen Raja NJ
039294c362
Xompletions (#4521)
* feat: add command completers logic

* feat: implement xompleter logic

* fix: handle callable object in exception

* chore: add xompletions package to setup.py

* fix: update tests for changes to command completer logic

* docs:

* fix: qa errors

fixes #4514

* feat: add xonsh completions

* refactor: split module matcher to separate class

* feat: add django-admin completions

* fix: failing tests

* feat: add more properties to completion-context

* refactor: cleanup code

* todo item add
2022-01-10 11:21:22 -05:00
Noorhteen Raja NJ
27970af142
fix: boottime on haiku getting (#4632) 2022-01-10 09:45:45 -05:00
dev2718
4af6806562
fix #4630 (#4631)
Co-authored-by: Alexander Firbas <alexander.firbas@gmail.com>
2022-01-09 08:46:06 +05:30
Hierosme
343ea33998
Add uname command, Update uptime comand (#3909)
* Add uname support

* Changelog addition

* Migration to platform module

* Update uptime.py for the last version
Merge the original uptime module to a single file
Change the bootime() return be stay compatible with xonsh
Add support for Haiku , suppose to close #3882
Add dependency from uptime to support to MacOS 10.10 by add _posix.c file.

* Update uptime.py for the last version
Merge the original uptime module to a single file
Change the bootime() return be stay compatible with xonsh
Add support for Haiku , suppose to close #3882
Add dependency from uptime to support to MacOS 10.10 by add _posix.c file.

* typo fix

* black reformat

* remove usage of print

* black is black

* add original test for uptime
convert original test via 2to3
black reformat tests

* strange syntaxe fixe for flaske8

* black the incredible tool it stop a bug fixe just because it THE tool it want a return for make less readable code

* flake8 the famous tool it permit to stop a big fixe without any information's about the trouble

* workaround about xonsh CI don't respect docstring specs

* RISC OS only comment thing

* black is a good jock in a CI

* black is a good jock in a CI

* roll back uptime.py

* look if we can make it work

* fixe all i understand

* add command in corutils alias

* reformat uptime.py with black

* fixe version

* try with xonsh xp.LIBC lib

* black in a CI is a stupid thing

* stupid Windows and it \r

* use os.linestep

* use newline simple wrapper

* use newline simple wrapper

* use newline simple wrapper

* use newline simple wrapper

* try osx rollback method

* fixe

* fixe

* a test on window via the CI because i haven't the OS

* a test on window via the CI because i haven't the OS

* a test on window via the CI because i haven't the OS

* fix: black: format

* refactor: update uname command

now has auto-completions

* docs: update news item and fix qa error

* refactor: remove unused file

* fix: qa imports

* refactor: update getting boottime

fallback to monotonic time on unix

* fix: update haiku compatibility in uptime

* refactor: add uptime to aliases

* refactor: move xoreutils tests

* fix: call aliases using xonsh

Co-authored-by: Tuux <tuxa@rtnp.org>
Co-authored-by: Noortheen Raja <jnoortheen@gmail.com>
2022-01-08 18:28:46 +05:30
Noorhteen Raja NJ
70dd8bf24b
fix: remove custom handling of osc tokens for ptk prompt (#4629)
https://github.com/prompt-toolkit/python-prompt-toolkit/blob/master/examples/prompts/finalterm-shell-integration.py

fixes #374
2022-01-07 17:34:52 -05:00
Noorhteen Raja NJ
7c4e207abd
update test xsh usage (#4581)
* todo

* test: remove usage of DummyEnv and setting .env attribute on xession fixture

one step closer to making too much of tweaking to xession during tests

* test: fix tests vox and gitstatus-prompt

* docs: update test-fixture usage

* fix: import flake8 error

* test: remove direct access to XSH in tests

* test: remove usage of XSH in test files

* todo

* test: use tmp-dir to create stubs

* refactor: use fixture factory to mock out XonshSession

* refactor: remove direct access of XSH from functions

* refactor: remove direct access of XSH from functions

* fix: qa checks

* refactor: rename variables to match their values

* test: update failing tests because it had no PATH set previously

* fix: remove builtins usage from pyghooks.py

* style:

* refactor: update tests to use fixtures

* fix: env varialbe is setup per function

some tests accidentally update the env variables and that is leaking
into next tests

* fix: failing vox tests

* test: set commands_cache per test

* test: fix failing tests

* fix: failing tests on linux

ptk-highlight

* fix: failing tests on Windows

cwd-prompt

* test: copy env as to not affect original object

* fix: lazily evaluate cmds-cache in pyghooks

* test: fix failing tests

* fix: qa errors import

* test: set commands-cache per test

while caching path results

* test: speedup test_thread_local_swap

* fix: failing tests on windows

* refactor: Execer doesn't control session

* refactor: XSH.unload will take care of reversing builtins attrs set

* test: use env.update over monkeypatch

* Revert "test: use env.update over monkeypatch"

This reverts commit 010a5022247a098f1741966b8af1bf758663480e.
2022-01-07 17:33:22 -05:00
Peter Ye
b6c61e3343
Fix unpacking of dictionaries inside a dictionary (#4624) 2022-01-07 04:51:06 +05:30
Noorhteen Raja NJ
c01fc6efe3
refactor: do not override sys coreutils (#4617)
* refactor: do not override sys coreutils

* docs:
2022-01-05 09:44:53 -05:00
Peter Ye
8bf47f29be
ast: do not descend into any comprehensions (#4622)
* ast: do not descend into any comprehensions

* add test

* add news
2022-01-05 09:35:50 -05:00
Noorhteen Raja NJ
35d44068d3
Update CONTRIBUTING.rst (#4616)
* Update CONTRIBUTING.rst

* Update CONTRIBUTING.rst
2021-12-25 19:12:07 +05:30
Noorhteen Raja NJ
cd57240237
fix: append space at the end of completions (#4611) 2021-12-23 18:27:37 +05:30
Noortheen Raja
af06aa8311 fix: loading default aliases on windows 2021-12-23 06:32:47 +05:30
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