Commit graph

40 commits

Author SHA1 Message Date
Andy Kipp
2788ae3308
refactoring: move lazy to lib (#5560)
#5538

## For community
⬇️ **Please click the 👍 reaction instead of leaving a `+1` or 👍
comment**

---------

Co-authored-by: a <1@1.1>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-06-29 12:19:08 +02:00
pre-commit-ci[bot]
66c0490d37
[pre-commit.ci] pre-commit autoupdate (#5271)
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 23.12.1 → 24.1.1](https://github.com/psf/black/compare/23.12.1...24.1.1)

* [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-01-30 12:23:50 +01:00
Noorhteen Raja NJ
b4d196db17 fix: ruff linter errors 2023-09-18 11:08:08 +05:30
pre-commit-ci[bot]
ba8ae973b8 [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 22.12.0 → 23.1.0](https://github.com/psf/black/compare/22.12.0...23.1.0)
- [github.com/pycqa/isort: 5.11.4 → 5.12.0](https://github.com/pycqa/isort/compare/5.11.4...5.12.0)
2023-02-14 22:57:36 +05:30
Eddie Peters
8b9a7e2782
fix(pyghooks): Fix some errors caused by an unset Xonsh session env when using XonshLexer as a Pygments plugin. (#4860) 2022-06-30 10:40:58 -04:00
Noortheen Raja
78091a22f3 style: isort imports
fix #4584
2022-01-31 11:16:51 -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
Gyuri Horak
98d4d2a184
Short color token name support for register_custom_style() (#4339) (#4342) 2021-07-24 18:37:51 +03:00
Noorhteen Raja NJ
3ce8c9b337
add py310 (#4270)
* 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
2021-06-07 13:40:40 -04:00
Noorhteen Raja NJ
38295a1dd9
Remove globals (#4280)
* 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:
2021-05-20 13:14:26 +03:00
Gyuri Horak
31dd811ef0
re-apply original changes 2020-10-27 15:23:58 +01:00
Anthony Scopatz
f99bfe1c94
Revert "PTK support for custom themes" 2020-10-26 10:48:00 -05:00
Gyuri Horak
f18f45bcab
color_token_by_name behaves strangely in unit tests, color name related test removed 2020-10-23 16:54:34 +02:00
Gyuri Horak
07217abc45
pygments.Token != xonsh.ptk_shell.Token 2020-10-23 16:32:44 +02:00
Gyuri Horak
89b6253c14
PTK style overrides without pygments 2020-10-23 16:04:57 +02:00
Gyuri Horak
4076ee1177
pyghooks.register_custom_style renamed to pyghooks.register_custom_pygments_style to avoid confusion 2020-10-13 22:21:27 +02:00
Gyuri Horak
024021882c
unit test for custom theme registration 2020-10-12 17:30:54 +02:00
cafehaine
f3bf1d287f Fix tests 2020-09-23 21:15:37 +02:00
Bob Hyman
6492a61171 test 2020-06-24 20:03:56 -04:00
Bob Hyman
129ce9e44a LS_COLORS add mh, change rs to fi; support ln=target 2020-06-20 17:46:37 -04:00
Bob Hyman
016afa5281 Merge branch 'is_3608' of https://github.com/bobhy/xonsh into is_3608 2020-06-14 14:36:06 -04:00
Bob Hyman
b65f7b0ac5 Only test easy-to-test cases on Windows. 2020-06-14 13:16:37 -04:00
Bob Hyman
57ed6e553a Prune test cases that won't work on Windows. 2020-06-14 13:08:11 -04:00
Bob Hyman
08a79c97c8 don't try to create pipe on Windows; return 'or', not 'mi' for broken link 2020-06-14 00:43:15 -04:00
Bob Hyman
08f1b06749 ln=target; fix #3578 2020-06-13 01:36:22 -04:00
Bob Hyman
1f8ad1c285 use ls --colors implementation; no os.listxattr on Windows 2020-06-12 16:37:19 -04:00
Bob Hyman
3d3d09e00a Mega rewrite color_files per ls -c sources; first step to ln=target 2020-06-11 21:28:25 -04:00
Bob Hyman
24b83bcf38 Support $LS_COLORS 'ca' (linux only) 2020-06-10 22:07:50 -04:00
Bob Hyman
4e230fa5a8 LS_COLORS add 'mh' change 'rs' to 'fi' 2020-06-09 21:47:59 -04:00
Bob Hyman
26475146e2
Flake8 1 (#3550)
* flake8 fixes -- tests only

* fix ci failure

* integrate fix from is_3551 so tests will pass.

* Update tests/test_builtins.py

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
2020-05-05 06:42:28 -04:00
Bob Hyman
53bfe8c99c
Add ptk3 (#3521)
* delete package ptk; rename ptk2 to ptk_shell.; leave ptk2 as alias for ptk_shell.
* SHELL_TYPE "prompt_toolkit" only; remove ptk1 specific behavior.
* Doc updates: eliminate reference to prompt-toolkit < 2.0
* update requirements files ptk>=2; test shell_style="none"
* fix ptk2 stub per code review
* Add ptk2 to list of packages to install.
2020-04-18 10:44:27 -04:00
Bob Hyman
f54129342b Hammer lint errors flat. 2020-01-04 13:56:02 -05:00
Bob Hyman
0c31a90e46 Blacken test file corresponding to flake8 config 2020-01-04 09:55:58 -05:00
Bob Hyman
afd3cada69 Legit unit test failure 2020-01-04 09:29:09 -05:00
Bob Hyman
258c849c69 Initialize file_colors in XonshStyle; eliminate pre-cmdloop event 2020-01-03 21:30:14 -05:00
Bob Hyman
148748960b
CI Failures for files outside unit test environment.
/dev/sda and /dev/tty do exist in some Travis test environments but not others.  Eventually should add internal files for block and character device files.  For now, I'm relying on works-on-my-machine tests (which are passing).
2019-12-26 09:04:42 -05:00
Bob Hyman
6082b61fc3 ls-colors -- colorize file arguments in subproc mode command lines 2019-12-26 05:51:48 -05:00
Anthony Scopatz
081ac6b5bf news and black 2019-03-12 18:45:14 -04:00
Anthony Scopatz
20ac4bf46f basicly working 2019-03-12 18:36:18 -04:00
Anthony Scopatz
49f5eeb6d2 color converter func 2019-03-11 18:34:54 -04:00