Commit graph

10691 commits

Author SHA1 Message Date
Andy Kipp
c4c7d1cbd7
Xonfig: show sensitive env variables that could affect the shell behavior. (#5374)
* wip

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Added XONSH_SUBPROC_OUTPUT_FORMAT

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-02 22:46:22 +05:30
Andy Kipp
4906ba8598
Update tutorial.rst: remove new line chars (#5382)
Update tutorial.rst
2024-05-02 18:01:06 +02:00
Andy Kipp
c5cb7044b5
feat: add subproc output format, autostrip singleline output (#5377)
### Motivation

* To have an ability to manage the output format added ``$XONSH_SUBPROC_OUTPUT_FORMAT`` to switch the way to return the output lines. Default ``stream_lines`` to return text. Alternative ``list_lines`` to return the list of lines. Also supported custom lambda function.
* Additionally the [proposal to change default behavior](https://github.com/xonsh/xonsh/pull/5377#discussion_r1587627131) for a single line case.
* Closes #3924 as soft solution.

### Before

```xsh
mkdir -p /tmp/tst && cd /tmp/tst && touch 1 2 3

$(ls)
# '1\n2\n3\n'

id $(whoami)
# id: ‘pc\n’: no such user: Invalid argument

du $(ls)
# du: cannot access '1'$'\n''2'$'\n''3'$'\n': No such file or directory

ls $(fzf)
# ls: cannot access 'FUNDING.yml'$'\n': No such file or directory
```

### After

```xsh
mkdir -p /tmp/tst && cd /tmp/tst && touch 1 2 3

$XONSH_SUBPROC_OUTPUT_FORMAT = 'list_lines'

$(ls)
# ['1', '2', '3']

[f for f in $(ls)]
# ['1', '2', '3']

id $(whoami)
# uid=501(user) gid=20(staff)

du $(ls)
# 0 1
# 0 2
# 0 3

ls $(fzf)
# FUNDING.yml

# etc
mkdir -p /tmp/@($(whoami))/dir
cat /etc/passwd | grep $(whoami)
```

### Notes

* It will be good to improve parser for cases like `mkdir -p /tmp/$(whoami)/dir`. PR is welcome!
* I named the default mode as `stream_lines` (instead of just `stream` or `raw`) because in fact we transform raw output into stream of lines and possibly reduce the length of output ([replacing `\r\n` to `\n`](c3a12b2a9c/xonsh/procs/pipelines.py (L380-L383))). May be some day we need to add raw "stream" output format.
* Now anybody can implement bash `IFS` behavior in [bashisms](https://github.com/xonsh/xontrib-bashisms).

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-05-02 11:48:25 -04:00
doronz88
9ae34e140c which: fix handling of None results (#5358) 2024-05-01 13:07:38 +05:30
Noorhteen Raja NJ
b8f91cdf22
fix: trace help on empty args
fixes #5373
2024-04-30 18:52:00 +05:30
pre-commit-ci[bot]
3ab2c967c2
[pre-commit.ci] pre-commit autoupdate (#5376)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.4.1 → v0.4.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.1...v0.4.2)
- [github.com/pre-commit/mirrors-mypy: v1.9.0 → v1.10.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.9.0...v1.10.0)

* fix riff warnings

* fix riff warnings

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix riff warnings

* update

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix riff warnings

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix riff warnings

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix riff warnings

* update

* fix riff warnings

* update

* update

* fix riff warnings

* fix riff warnings

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: a <1@1.1>
2024-04-30 13:42:32 +02:00
Jason R. Coombs
d835a8a1e8
Leverage sort for sorting items. (#5378) 2024-04-30 11:21:31 +02:00
Andy Kipp
c3a12b2a9c
feat: add --no-env flag to avoid inheriting parent-shell env (#5370)
### Motivation

Basically we use `xonsh --no-rc` to have pure xonsh. 
I noticed many times when parent environment can affect `xonsh --no-rc` e.g. `$XONSH_HISTORY_FILE`.
Current workaround is `env -i @$(which xonsh) --no-rc` but I think we need to have pure xonsh way.

Closes #4921

### Before

```xsh
xonsh --no-rc
$QWE = 1
xonsh --no-rc
$QWE
# 1
```

### After
```xsh
xonsh --no-rc
$QWE = 1
xonsh --no-rc --no-env
$QWE
# Unknown environment variable: $QWE

$XONSH_ENV_INHERITED  # Marker to have a way to catch this situation.
# False
```

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
2024-04-29 12:29:22 -04:00
Gil Forsyth
81865354a1 chore(README): remove old CI status badges, light language polish 2024-04-29 21:16:17 +05:30
Andy Kipp
f71b5adde8
Xonsh Zulip Community started (#5372)
* wip

* wip

---------

Co-authored-by: a <1@1.1>
2024-04-29 10:01:02 -04:00
Andy Kipp
61751c2319
jobs: catching ChildProcessError (#5365)
* Update jobs.py

* Create jobs_catch_no_process.rst

* Update jobs.py

* Update jobs_catch_no_process.rst

* Update jobs.py
2024-04-26 10:34:31 +02:00
Andy Kipp
8ab1b9a0ee
jobs: default representation changed to dict (#5363)
* update

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-26 10:26:24 +02:00
pre-commit-ci[bot]
874ad9ffe6 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-04-26 13:37:19 +05:30
a
a8a604d4c5 wip 2024-04-26 13:37:19 +05:30
a
134f313d73 wip 2024-04-26 13:37:19 +05:30
a
a769689515 wip 2024-04-26 13:37:19 +05:30
a
52c96c9dd5 wip 2024-04-26 13:37:19 +05:30
pre-commit-ci[bot]
0aceced733 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-04-26 13:37:19 +05:30
a
c9d87ab9b5 wip 2024-04-26 13:37:19 +05:30
pre-commit-ci[bot]
71ab4d2aeb [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-04-26 13:37:19 +05:30
a
d1f043e956 XONSH_TRACE_SUBPROC returns more useful details. 2024-04-26 13:37:19 +05:30
pre-commit-ci[bot]
c52ddd55ac [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-04-26 13:37:19 +05:30
a
ddd4bd93c9 XONSH_TRACE_SUBPROC returns more useful details. 2024-04-26 13:37:19 +05:30
pre-commit-ci[bot]
8921715379 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-04-26 13:37:19 +05:30
a
4250cce9fd XONSH_TRACE_SUBPROC returns more useful details. 2024-04-26 13:37:19 +05:30
pre-commit-ci[bot]
983a7c51d1 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2024-04-26 13:37:19 +05:30
a
24fdfece1e XONSH_TRACE_SUBPROC returns more useful details. 2024-04-26 13:37:19 +05:30
Andy Kipp
26c6e119e2
Shortcut for shell-type (#5367)
* Shortcut for shell-type

* Shortcut for shell-type

---------

Co-authored-by: a <1@1.1>
2024-04-25 20:10:18 +02:00
Andy Kipp
4dc17ca600
Downgrade AppImage to 3.11 (#5364)
* Update rever.xsh

* Create appimage_py311.rst
2024-04-25 11:46:36 +02:00
Andy Kipp
273f12d329
Add thread details to the exception (#5360)
* thread details

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-24 11:15:40 +02:00
Andy Kipp
af9c3afa23
Added detailed info about thread to thread exceptions (#5357)
* update

* update

* update

* update

* update

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-24 08:46:04 +02:00
Noorhteen Raja NJ
56e0257697
chore: Update publish.yml python versions (#5359) 2024-04-24 08:43:04 +02:00
Noortheen Raja
c071112584 chore: use uv for docs action 2024-04-24 09:16:33 +05:30
Noortheen Raja
a61860e623 chore: use uv for docs action 2024-04-24 09:16:33 +05:30
Noortheen Raja
499f35428a chore: use uv for docs action 2024-04-24 09:16:33 +05:30
Noortheen Raja
3b5f0b4a0d chore: uv to use system python 2024-04-24 09:16:33 +05:30
Noortheen Raja
93900e7239 feat: use uv for installing test deps
and use PuPI OICD to publish packages
2024-04-24 09:16:33 +05:30
Gil Forsyth
c508e0de60
Updated CHANGELOG for 0.16.0 2024-04-23 14:34:31 -04:00
Gil Forsyth
91b80bb664
bumped version to 0.16.0 2024-04-23 14:34:31 -04:00
Gil Forsyth
972d59e134
Updated authorship for 0.16.0 2024-04-23 14:34:30 -04:00
Gil Forsyth
91c18ba601
fix(appimage): quote version bounds in appimage prereqs 2024-04-23 14:34:29 -04:00
Andy Kipp
cc143b1ece
Pin ptk for AppImage (#5356)
* Update pre-requirements.txt

* Update appimage-py312.rst
2024-04-23 10:31:41 +02:00
pre-commit-ci[bot]
4ba970cad4
[pre-commit.ci] pre-commit autoupdate (#5355)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.3.7 → v0.4.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.3.7...v0.4.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-23 08:46:52 +05:30
a
79f02e9ea4 update 2024-04-21 17:14:31 +05:30
Andy Kipp
330f150f6a
EnvPath methods (append, remove, add, insert) prepare the path (#5349)
* EnvPath methods (append, remove, add, insert) prepare the path before add.

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* update

* update

* update

* update

* update

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-04-21 10:03:42 +02:00
a
e30dd960e2 update 2024-04-20 20:33:07 +02:00
Noortheen Raja
a5eb5bfbf2 test: xfail virtualenv plugin 2024-04-20 23:44:26 +05:30
Noortheen Raja
667efceb72 refactor!: remove confusing hook_post_add_argument
current usecase can be solved with custom Action
2024-04-20 23:44:26 +05:30
Noortheen Raja
c02262f7b6 chore: ignore more pdm files 2024-04-20 23:44:26 +05:30
Noortheen Raja
a44c20d805 feat: update setting default sub-command for argparser
also remove lambda based default help command
2024-04-20 23:44:26 +05:30