Commit graph

85 commits

Author SHA1 Message Date
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
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
Noortheen Raja
f2b7d4ed4f style: sort imports 2022-03-24 19:49:30 +05:30
Noortheen Raja
81b65556a5 chore: update tests 2022-03-24 19:49:30 +05:30
Noortheen Raja
78091a22f3 style: isort imports
fix #4584
2022-01-31 11:16:51 -05:00
Noortheen Raja
90587726e0 chore: upgrade black to 22.1.0 2022-01-31 11:16:51 -05:00
dev2718
1aefbf3b35
Fix: detype None env-vars to '' to fix #4600 (#4649)
* detype untyped and path env-vars to ""; path_to_str("") == None

* update env-var-tutorial, add news

* update test_expandvars, test_expand_path, test_register_custom_var_str

* trigger CI-rerun since unrelated osx test failed

Co-authored-by: Alexander Firbas <alexander.firbas@gmail.com>
2022-01-21 14:46:50 +05:30
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
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
Noorhteen Raja NJ
50a1c92004
chore: enable flake8 for tests (#4482) 2021-09-26 11:32:24 -04:00
Daniel Shimon
438c66dfc0
Env swap thread safety (#4465)
* environ: Implement InternalEnvironDict for thread-local overrides

* environ: Make `swap` thread-safe without leaks

Use thread-local storage to override the changes.
This way the changes can't leak to other threads.

* environ: Implement 'get/set_swapped_values' to pass to threads

* procs: Use swapped values in threaded subprocs

This is so the thread will use the same swapped values as the origin one.

* news: Add env-swap-thread-safety
2021-09-13 11:06:55 -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
Noorhteen Raja NJ
bceaafae4d
Add groups to env vars (#4026)
* feat: add grouped-settings for env variables

fixes #4014

style: fix mypy errors

chore: update testing requirements versions

fix: update xonsh.tools import error

* chore: add news item

* fix: update Var.with_default handling env defaults

* fix: set env var.doc_default=DefaultNotGiven

there is a custom handler for it

* chore: update travis

speedup docs generation

* chore: add command to serve docs during development

* docs: add jinja2 helpers/renderers extension for sphinx

* docs: update envvars document

* docs: fix docs failing

* Update xonsh/environ.py

commit suggestion

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

* Update xonsh/environ.py

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

* Update xonsh/environ.py

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

* Update xonsh/environ.py

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

* Update xonsh/environ.py

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

* Update xonsh/environ.py

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

* refactor: update rst-extension

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
2021-01-04 12:21:44 -05:00
Anthony Scopatz
17f86d359e
callable default skips validation (#3668)
* callable default skips validation

* default value

* black

* today func

* store called defaults
2020-12-18 14:42:18 -05:00
a
982ce976ec fix 2020-10-21 03:52:31 +03:00
a
04df5c75ad env path 2020-10-07 19:22:02 +03:00
a
7049c250b4 Merge branch 'master' of https://github.com/xonsh/xonsh into env_get_path 2020-09-30 23:44:37 +03:00
Anthony Scopatz
7b1b5d2874
Merge pull request #3793 from cafehaine/master
Change the behavior of NO_COLOR, add RESET
2020-09-30 13:30:38 -07:00
a
fb4c52a5ef Fix register 2020-09-30 21:36:59 +03:00
cafehaine
f3bf1d287f Fix tests 2020-09-23 21:15:37 +02:00
Bob Hyman
53c0f25e77 fix per review 2020-09-11 12:31:11 -04:00
Bob Hyman
034f9f325d Cleanup per review. 2020-09-11 01:11:29 -04:00
Bob Hyman
d0096fb655 Test cases, news and fix one bug. 2020-09-08 14:44:26 -04:00
Anthony Scopatz
f048b295d6 black updates to tests and docs 2020-08-26 10:10:59 -05:00
Bob Hyman
c4aaede00b Rewrite fix per code review, cleaner! 2020-08-25 16:17:34 -04:00
Bob Hyman
e0d9ace4b0 fix commit list 2020-08-24 13:32:49 -04:00
Anthony Scopatz
43e7827a9a fix tests 2020-08-16 19:13:35 -05:00
Anthony Scopatz
0d1d3574ea Env.rawkeys() 2020-08-16 18:46:02 -05:00
David Strobach
3a45923b83 Only return string keys while iterating over __xonsh__.env 2020-08-12 03:34:34 +02:00
David Dotson
a8d4a57f01
Environment variable registration, deregistration (addresses #3227) (#3377)
* First attempt at register/deregister machinery for envvars

* Added detailed docstring, simplified ensurers

Also added some type checking that became clear from docstring writing.

* Changes in response to @scopatz review

Simplified kwarg names.

* defaultval -> default

* Created new Var namedtuple, as well as DEFAULT_VARS

We should now delete DEFAULT_ENSURERS, DEFAULT_VALUES, DEFAULT_DOCS, and
refactor Env to use the new single namedtuple and the DEFAULT_VARS dict

* Removed DEFAULT_ENSURERS, DEFAULT_VALUES, DEFAULT_DOCS

Now need to edit Env to use new DEFAULT_VARS, Var namedtuple

* Finished updating Env object to use new combined Var

Also made corresponding changes elsewhere ensurer was used

* Working on test failures

* More fixes in light of test failures

* Set default values for Var in register.

There's a bit of duplication here, but makes for a cleaner function.

* Black reformatting on environ.py

* Removed history replay

* Added register tests

* Added addtional deregistration test

* Removed all replay references, in docs too

* Added news item for env-reg-dereg

* trigger rebuild

* doc fix

* more doc fixes

* again

* attr names

* reorder imports

* fix flake error

Co-authored-by: Anthony Scopatz <scopatz@gmail.com>
2020-08-05 10:39:11 -04:00
Bob Hyman
dde73ba72c Xonsh failback to /usr/bin/bash in preference to /etc/shells 2020-06-25 19:49:04 -04:00
Bob Hyman
08f1b06749 ln=target; fix #3578 2020-06-13 01:36:22 -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
Noortheen Raja
0851866ebf feat: add HISTCONTROL(erasedups) support to sqlite backend
fixes part of !3478
2020-03-19 12:58:31 +05:30
Bob Hyman
f54129342b Hammer lint errors flat. 2020-01-04 13:56:02 -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
5f30593dfe target color 2019-08-06 14:39:11 -04:00
Jean-Benoist Leger
d81a40efbc
change the env variable used for testing delitem behavior for default values in environ 2019-05-15 23:23:49 +02:00
Jean-Benoist Leger
934f337ab1
add test on Env.__delitem__ 2019-04-26 20:27:45 +02:00
Anthony Scopatz
53e7645d01 more color fixes 2019-03-06 23:08:26 -08:00
Anthony Scopatz
43d0527657 fixes 2019-02-14 10:00:20 -05:00
Anthony Scopatz
41c240a7ee some test and flake fixes 2019-02-13 19:12:53 -05:00
Anthony Scopatz
4c91df2abc many test fixes 2018-09-13 14:03:35 -04:00
Anthony Scopatz
634a8ec9f2 black tests 2018-08-30 09:18:49 -05:00
Anthony Scopatz
1883f5002c some minor improvements and test 2018-08-21 15:21:46 -04:00
Anthony Scopatz
76ae2f8924 fixed $ARG<N> subprocess issue 2018-07-20 20:41:00 -04:00
Anthony Scopatz
d2928dec6b fixed tests for no conf 2017-12-18 19:13:49 -08:00
Jamie Bliss
517b176456 Remove lines/columns from the default environment 2017-11-29 13:51:13 -05:00
Gil Forsyth
d6540ce66d add test that all int and bool envvars have ensurers
hopefully this will stop this from cropping up again in the future
2017-03-15 09:09:08 -04:00