Commit graph

10853 commits

Author SHA1 Message Date
Łukasz Langa
1183813ff7
Fix ignored exception in tracer shutdown related to module deletion (#5806)
Some checks are pending
Build and deploy docs / Xonsh docs to gh-pages (push) Waiting to run
CI Tests / Test Python 3.10 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.11 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.12 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.13 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.10 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.11 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.12 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.13 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.10 windows-latest (push) Waiting to run
CI Tests / Test Python 3.11 windows-latest (push) Waiting to run
CI Tests / Test Python 3.12 windows-latest (push) Waiting to run
CI Tests / Test Python 3.13 windows-latest (push) Waiting to run
With the tracer on, modules at shutdown can be destroyed in an order
that prevents the `trace()` function from working. This was currently
the case with Python 3.13 where the function was still being called
during the `xonsh.tracer` module's destruction.

This change adds a test to prevent this from happening in the future,
and works around the issue by creating local references to necessary
functions that were otherwise set to None at shutdown.
2025-03-03 18:07:18 +06:00
Ahmed
bbd652c06d
website: Added click-to-copy functionality for specific code blocks with success alert. (#5804)
Some checks failed
Build and deploy docs / Xonsh docs to gh-pages (push) Has been cancelled
CI Tests / Test Python 3.10 macOS-latest (push) Has been cancelled
CI Tests / Test Python 3.11 macOS-latest (push) Has been cancelled
CI Tests / Test Python 3.12 macOS-latest (push) Has been cancelled
CI Tests / Test Python 3.13 macOS-latest (push) Has been cancelled
CI Tests / Test Python 3.10 ubuntu-latest (push) Has been cancelled
CI Tests / Test Python 3.11 ubuntu-latest (push) Has been cancelled
CI Tests / Test Python 3.12 ubuntu-latest (push) Has been cancelled
CI Tests / Test Python 3.13 ubuntu-latest (push) Has been cancelled
CI Tests / Test Python 3.10 windows-latest (push) Has been cancelled
CI Tests / Test Python 3.11 windows-latest (push) Has been cancelled
CI Tests / Test Python 3.12 windows-latest (push) Has been cancelled
CI Tests / Test Python 3.13 windows-latest (push) Has been cancelled
* Added Copy Functionality.

Implemented click-to-copy functionality for specific code areas, displaying an alert upon successful copy.

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-02-27 21:19:54 +06:00
Jason R. Coombs
34b3f3cfbe
Get cmd.exe from a well-known location. (#5779)
Some checks are pending
Build and deploy docs / Xonsh docs to gh-pages (push) Waiting to run
CI Tests / Test Python 3.10 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.11 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.12 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.13 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.10 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.11 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.12 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.13 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.10 windows-latest (push) Waiting to run
CI Tests / Test Python 3.11 windows-latest (push) Waiting to run
CI Tests / Test Python 3.12 windows-latest (push) Waiting to run
CI Tests / Test Python 3.13 windows-latest (push) Waiting to run
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andy Kipp <anki-code@users.noreply.github.com>
2025-02-26 13:23:22 -05:00
Andy Kipp
b30469fac1
Update environ.py: fix RST formatted comment 2025-02-26 23:44:45 +06:00
Andy Kipp
b5769cc88a
Update README.rst: fix Zulip link
Some checks are pending
Build and deploy docs / Xonsh docs to gh-pages (push) Waiting to run
CI Tests / Test Python 3.10 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.11 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.12 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.13 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.10 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.11 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.12 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.13 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.10 windows-latest (push) Waiting to run
CI Tests / Test Python 3.11 windows-latest (push) Waiting to run
CI Tests / Test Python 3.12 windows-latest (push) Waiting to run
CI Tests / Test Python 3.13 windows-latest (push) Waiting to run
2025-02-26 13:13:47 +06:00
Andy Kipp
48be4891a2
Update index.html: more xontribs to show 2025-02-26 13:05:52 +06:00
Łukasz Langa
c1e9186fe3
Fix SQL injection in history delete on the sqlite backend (#5799)
Some checks are pending
Build and deploy docs / Xonsh docs to gh-pages (push) Waiting to run
CI Tests / Test Python 3.10 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.11 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.12 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.13 macOS-latest (push) Waiting to run
CI Tests / Test Python 3.10 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.11 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.12 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.13 ubuntu-latest (push) Waiting to run
CI Tests / Test Python 3.10 windows-latest (push) Waiting to run
CI Tests / Test Python 3.11 windows-latest (push) Waiting to run
CI Tests / Test Python 3.12 windows-latest (push) Waiting to run
CI Tests / Test Python 3.13 windows-latest (push) Waiting to run
* Fix SQL injection in history delete on the sqlite backend

Also, return a value from history delete on the sqlite backend. Otherwise the
command always responded with "Deleted None entries from history".

Also, use XH_SQLITE_TABLE_NAME consistently across xonsh.history.sqlite.
Before, most of the calls used the variable, but part of them hard-coded the
table name.

* Add news entry

* Fix ReST syntax in changelog entry
2025-02-26 00:54:59 +06:00
Andy Kipp
7163e65e74
Fix #5800 2025-02-26 00:51:35 +06:00
Andy Kipp
71d4920ac5
Update pipelines.py: fix checking self.proc (#5794)
Some checks failed
Build and deploy docs / Xonsh docs to gh-pages (push) Has been cancelled
CI Tests / Test Python 3.10 macOS-latest (push) Has been cancelled
CI Tests / Test Python 3.11 macOS-latest (push) Has been cancelled
CI Tests / Test Python 3.12 macOS-latest (push) Has been cancelled
CI Tests / Test Python 3.13 macOS-latest (push) Has been cancelled
CI Tests / Test Python 3.10 ubuntu-latest (push) Has been cancelled
CI Tests / Test Python 3.11 ubuntu-latest (push) Has been cancelled
CI Tests / Test Python 3.12 ubuntu-latest (push) Has been cancelled
CI Tests / Test Python 3.13 ubuntu-latest (push) Has been cancelled
CI Tests / Test Python 3.10 windows-latest (push) Has been cancelled
CI Tests / Test Python 3.11 windows-latest (push) Has been cancelled
CI Tests / Test Python 3.12 windows-latest (push) Has been cancelled
CI Tests / Test Python 3.13 windows-latest (push) Has been cancelled
* Update pipelines.py

* Create pipelines_fix_check_self_proc.rst
2025-02-14 22:09:10 +05:30
Gil Forsyth
5dde2304e9 Updated CHANGELOG for 0.19.2 2025-02-11 12:08:13 -05:00
Gil Forsyth
9f788a45d6 bumped version to 0.19.2 2025-02-11 12:08:13 -05:00
Gil Forsyth
102d09b260 Updated authorship for 0.19.2 2025-02-11 12:08:13 -05:00
Łukasz Langa
43f62750ac
Don't append a space if the single available completion ends with a directory separator (#5792)
* Don't append a space if the single available completion ends with a directory separator

* Update subprocess-completions-dir-spaces.rst

---------

Co-authored-by: Andy Kipp <anki-code@users.noreply.github.com>
2025-02-11 11:16:43 +06:00
jfmontanaro
a33ccdf636
Implement history pull for JSON history backend (#5788)
* add --session-id option to `history pull` command

* implement `history pull` for JSON history

* add news item for `history pull` updates

* add documentation for history pull `--session-id` option

* add explanatory comment for sleep in test

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

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

* Update json-history-pull.rst

* fix failing tests

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andy Kipp <anki-code@users.noreply.github.com>
2025-02-03 22:34:19 +06:00
jfmontanaro
77ecefff34
Fix PTK shell sometimes not updating auto-suggest when up-arrow is pressed (#5787)
* fix combining consecutive history entries when loading ptk shell

* add test case for combining history items

* add news item for PTK history combining

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

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

* Update ptk-history-combining.rst

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andy Kipp <anki-code@users.noreply.github.com>
2025-01-31 21:40:43 +06:00
jfmontanaro
2cdcd6c976
Forward SIGHUP to child processes and process SystemExit more carefully (#5786)
* propagate SIGHUP to child processes

* do not wait for active job if shell is exiting

* move on_postcommand event out of _append_history and document behavior

* add changelog

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

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

* Update built_ins.py

* Update hup-propagation.rst

* use sys.exc_info instead of sys.exception for version compatibility

* update test_default_append_history to work with new history/postcommand interaction

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

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

* add tests for SIGHUP forwarding and postcommand blocking

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

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

* fix linting errors in news entry

* use tmpdir fixture in sighup tests

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

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

* Update test_integrations.py

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andy Kipp <anki-code@users.noreply.github.com>
2025-01-30 17:06:50 +06:00
Artur Manuel
0292b43e64
feat(environ): allow XONSH_*_DIR to be configurable (#5783)
* feat(environ): allow XONSH_*_DIR to be configurable

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

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

* test(env): add env var test

* fix(test): move test to test_environ

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

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

* Update test_environ.py

* Update configurable-xonsh-dirs.rst

---------

Co-authored-by: Artur Manuel <balkenix@outlook.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andy Kipp <anki-code@users.noreply.github.com>
2025-01-29 22:14:02 +06:00
Đỗ Trung Nguyên
e7426ce709
Add configuring cursor shape for prompt toolkit (#5785)
* env: add `PROMPT_TOOLKIT_CURSOR_SHAPE` for configuring `prompt_toolkit` cursor shape

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

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

* accepting prompt_toolkit.cursor_shapes.CursorShape as value

* rename PROMPT_TOOLKIT_CURSOR_SHAPE => XONSH_PROMPT_CURSOR_SHAPE

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-01-27 14:56:19 +06:00
Andy Kipp
62edf9e381
Update job.py: added current_job to comment for discoverability 2025-01-24 14:16:28 +06:00
Gil Forsyth
ad4ec32307 Updated CHANGELOG for 0.19.1 2025-01-13 11:54:31 -05:00
Gil Forsyth
f4c5f5b62f bumped version to 0.19.1 2025-01-13 11:54:31 -05:00
Gil Forsyth
0acc833dd9 Updated authorship for 0.19.1 2025-01-13 11:54:31 -05:00
Andy Kipp
5be43ba7a8
Fixed hanging the command right after calling full capture subprocess (#5769)
* fix

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

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

* test

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

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

* test

* test

* test

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

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

* test

---------

Co-authored-by: Andy Kipp <no@no.no>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andy Kipp <123@321.123>
2025-01-13 12:27:29 +06:00
pre-commit-ci[bot]
5f62cd8b4e
[pre-commit.ci] pre-commit autoupdate (#5754)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.8.2 → v0.8.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.2...v0.8.3)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-12-18 19:22:20 +05:30
Evgeny
ae283deeb9
ci: use current 3.13 version of python (#5751)
pre-commit: use current version of python
2024-12-12 13:30:26 +05:30
Andy Kipp
8898f605e9
xonsh/lib: Create README.md 2024-12-11 16:19:25 +06:00
Evgeny
4c0b223e7b
Allow non-integer exit codes (#5721)
* Allow non-integer exit codes justl like in Python proper

* doc: add news item

* Update fr-exit-str.rst

---------

Co-authored-by: Andy Kipp <anki-code@users.noreply.github.com>
2024-12-10 12:26:12 +06:00
pre-commit-ci[bot]
c85b8923a0
[pre-commit.ci] pre-commit autoupdate (#5746)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.8.1 → v0.8.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.1...v0.8.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-12-10 01:02:12 +05:30
Gil Forsyth
c059ac23d2 Updated CHANGELOG for 0.19.0 2024-12-09 09:41:03 -05:00
Gil Forsyth
689e8cb314 bumped version to 0.19.0 2024-12-09 09:41:03 -05:00
Gil Forsyth
f55164aad7 Updated authorship for 0.19.0 2024-12-09 09:41:03 -05:00
Evgeny
9d49292453
test: split a test to include Windows (#5665)
* test: split a test to include Windows

(moving non-Win commands like ls to a separate test)

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

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

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-12-08 20:22:08 +05:30
pre-commit-ci[bot]
5be2fa0a1e
[pre-commit.ci] pre-commit autoupdate (#5712)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.9 → v0.8.1](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.9...v0.8.1)
- [github.com/pre-commit/mirrors-mypy: v1.11.2 → v1.13.0](https://github.com/pre-commit/mirrors-mypy/compare/v1.11.2...v1.13.0)

* chore: ignore UP031

* chore: ignore mypy error

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Noortheen Raja <jnoortheen@gmail.com>
2024-12-08 14:07:36 +00:00
Gil Forsyth
055321dba7
chore: add 3.13 to release jobs and remove stale dependency (#5735)
chore: add 3.13 to release jobs and remove stale dep

`doctr` isn't used anymore, so we don't need to include it.
2024-12-08 18:13:50 +05:30
Simon Billinge
1d1e7a8827
try just using CaseSenssitiveDict from requests to see if it works (#5744)
* try just using CaseSenssitiveDict from requests to see if it works

* put the dependency back in pyproject.toml and ignore typing on import

* news

* code now passing tests locally.  I still need to write tests for the new Class

* tests for CaseInsensitiveDict
2024-12-08 13:58:31 +05:30
Gil Forsyth
9ae14866de
test: add Python 3.13 to test matrix (#5733) 2024-12-08 13:30:20 +05:30
Bala
0791372f30
Fix DeprecationWarning while initializing Expression (#5739)
* Fix DeprecationWarning while initializing `Expression`

* Add news item

* Rename the news file to the branch name

* Fixing more ast related warnings
2024-12-02 17:31:09 +05:30
Jueun Lee
599f1c0f36
env: add XONSH_SUPPRESS_WELCOME to suppress welcome msg (#5719)
add `XONSH_SUPPRESS_WELCOME` variable to suppress welcome msg

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
2024-11-18 18:04:24 -05:00
DoronZ
6fefc3c68d parsers: fix deprecation warnings triggered on python3.13
Close #5710
2024-11-17 08:44:39 -05:00
JamesParrott
58ca7e77b7 Add *args and **kwargs to _parse_known_args, and pass them through to the call to super(). _parse_known_args 2024-11-17 08:38:10 -05:00
Gil Forsyth
f2e4c93785 test(ubuntu,osx): skip pipeline and specs tests on Python 3.12
Some combination of these tests is hanging CI, but so far isn't
reproducible locally.  Need to narrow it down, but this is to unblock
other work.

test(ubuntu): skip all pipeline tests on Ubuntu on Python 3.12

test(specs): skip specs tests instead

test(pipelines): actually skip the pipeline tests

test: skip jobs

test: skip specs

test: only skip specs

test: skip specs and pipelines
2024-11-16 12:59:35 -05:00
Gil Forsyth
0bbaf74309 test(parser): xfail failed brackets test on windows 2024-11-16 12:59:35 -05:00
Gil Forsyth
8a65d4f449 fix(ArgparseCompleter): adjust parsing for upstream private changes
The upstream private API for `_parse_optional` changed, needed to update this.
2024-11-16 12:59:35 -05:00
Gil Forsyth
cd05822f9a Updated CHANGELOG for 0.18.4 2024-11-02 17:46:42 -04:00
Gil Forsyth
7104189f66 bumped version to 0.18.4 2024-11-02 17:46:42 -04:00
Gil Forsyth
7eb7b57853 Updated authorship for 0.18.4 2024-11-02 17:46:42 -04:00
Shawn Wallace
c84420e7b3
Add examples of environment variable interpolation (#5714)
* Add examples of environment variable interpolation

* Update tutorial.rst

* Update tutorial.rst

---------

Co-authored-by: Andy Kipp <anki-code@users.noreply.github.com>
2024-10-31 10:33:45 +01:00
Max Nordlund
2d07ae8698
Update tutorial_macros.rst (#5715)
This removes the false statement that Haskell and other functional programming languages does need nor not have macros.

Lisp is a functional programming language with macros at the core of the language. For Haskell specifically its called [Template Haskell](https://wiki.haskell.org/Template_Haskell).

There's also Erlang which has a token based macro system, something between the C preprocessor and Lisp. Elixir, a newer language in the same ecosystem as Erlang, has full procedural macros. This is similar to the macros in Xonsh; regular functions that take AST nodes as input and return a, potentially different, AST node.
2024-10-30 14:11:04 +01:00
pre-commit-ci[bot]
442e0a4968
[pre-commit.ci] pre-commit autoupdate (#5694)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.7 → v0.6.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.7...v0.6.9)
- [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v5.0.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-07 22:40:38 +02:00
Peter Ye
79b3561c21
Catch SystemExit in ProcProxy (#5698)
* catch SystemExit in ProcProxy

* add test

* add news

* update test

* Update fix-procproxy-sys-exit.rst

---------

Co-authored-by: Andy Kipp <anki-code@users.noreply.github.com>
2024-10-03 22:04:09 +05:30