Commit graph

41 commits

Author SHA1 Message Date
Noorhteen Raja NJ
c63f75efd0
cmd cache refactor - optimize cache usage (#4954)
* todo:

* refactor: remove usage of singleton in cmd-cache

* refactor: pass aliases/env to commands_cache on creation

reduce the usage of singletons

* fix: setting up mockups for tests

* feat: add $XONSH_CACHE_DIR

* refactor: use cache path to stire cmds-cache

* chore: todo

* feat: efficient cache commands per path and modified time

* refactor: move aliases to commands cache

now XonshSession is not needed to setup cmds-cache

* refactor: update tests

* fix: type annotation

* refactor: init aliases at commands-cache

* test: update failing tests

* fix: handle paths mtime changing

* docs: add news item

* refactor: remove $COMMANDS_CACHE_SIZE_WARNING

* fix: loading on windows fails because of setup sequence

* fix: failing tests
2022-11-14 23:52:10 +05:30
Noorhteen Raja NJ
011c5c00e9
Fix vox env dir (#4736)
* refactor: use stdout passed from function

better handling of errors

* test: no need to skip these on windows

* test: load local plugin

* test: update vox-runin

* test: speedup vox tests

we dont need to test venv, only calls made to it via subprocess

* test: pip.exe on windows
2022-03-27 17:12:52 +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
4983e67224 test: python completers have become flaky
fix: qa error, it is not a class method

still B019 is raised from bugbear

fix: failing vox tests in windows

fix: unc check on windows on ci

fix: vox failing on windows

get_binary_path already appends .exe
2022-03-22 19:13:11 +05:30
Oliver Bestwalter
7a04133611
implement vox create --prompt (#4676)
Pass the prompt arg through to venv.
Additionally, upgrade needs to be adjusted to keep a prompt setting if it is there.
2022-02-21 14:51:31 +05:30
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
Noortheen Raja
e66c08168b test: refactor vox tests
vox create is costly. reuse it between tests
2021-12-23 06:32:47 +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
Noorhteen Raja NJ
a3c1b2429e
argparserAlias - vox (#4437)
* feat: use argparser-alias for vox

* feat: vox.create --interpreter completions

* refactor: use func based completer

* fix: implement interpreter completion

* docs:

* refactor: update import path of cli_utils

* style: convert to f-strings

* fix: failing tests

* fix: failing tests

completer from base_completer appears
2021-10-13 10:02:06 -04:00
Noorhteen Raja NJ
ca9338149c
fix: vox system_site_packages option not passed (#4404)
* fix: vox system_site_packages option not passed

* docs: add news item

* docs: add todo nit
2021-08-11 09:46:32 +03: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
Anthony Scopatz
f048b295d6 black updates to tests and docs 2020-08-26 10:10:59 -05:00
Matthias Bussonnier
784c5286ef
Remove most of Python 3.5 compatibility code. (#3654)
There  now should not be any remaining  3,5 conditinal code.
We now directly use inspect's getouterframes, so remove it from
inspector

The 3.5 parser get merged into 3.6 and a number of global vaiable
referring to 3.5/3.6 are now gone.

The only remaining mention is appveyor test, which are anyway failing
but not being seen as so by GitHub, so I'll leave them alone.
2020-08-05 10:29:31 -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
Gil Forsyth
9acc111d65
Merge pull request #3277 from astronouth7303/xontrib-autovox
Add autovox xontrib
2019-09-09 16:32:55 -04:00
Jamie Bliss
0b9ab83c86 Only run autovox test on Py3.6+ 2019-08-28 15:02:41 -04:00
Jamie Bliss
f8e5e9521b Write test for autovox 2019-08-28 14:50:27 -04:00
Jamie Bliss
cf45a946eb Fix masked test names 2019-08-28 14:07:27 -04:00
Caleb Hattingh
3b8d8472cb Trying to fix CI failure on Windows Python 3.5 2019-08-16 20:33:51 +10:00
Caleb Hattingh
eb8971dc7b Make the new path parameter explicit in the tests. 2019-08-15 23:23:09 +10:00
Caleb Hattingh
220923f084 Include path as a kwarg on activate and deactivate events 2019-08-14 17:50:06 +10:00
Caleb Hattingh
16edba8fe8 Apply abspath() to the env_dir, and add a test to verify. 2019-08-04 12:20:04 +10: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
Maximilian Köhl
7334c7a5c4 fix AppVeyor MSYS2 test script to no longer use symlinks in pytest 2017-12-31 17:50:55 +01:00
Jamie Bliss
39102ee401 Update vox_on_* 2017-01-14 19:06:49 -05:00
Jamie Bliss
5e5921802d add fspath support to vox 2016-12-09 23:14:41 -05:00
Jamie Bliss
ce98aa8fa9 Allow activation of environments in relative directories.
Also disallow the creation of venvs with reserved names
2016-10-02 21:49:38 -04:00
Jamie Bliss
2afbdcc1dd Overtesting on Windows 2016-09-13 21:01:50 -04:00
Jamie Bliss
2f60a22f64 Windows is still a thing. 2016-09-13 20:52:19 -04:00
Jamie Bliss
dc8c5b5b53 Finally fix __iter__() so subdirs work correctly.
Also add a test for subdirs
2016-09-13 20:49:34 -04:00
Jamie Bliss
e2c981de78 Add an explicit (and more correct) __contains__() 2016-09-13 20:29:44 -04:00
Jamie Bliss
0d791d1bea Add events to vox. 2016-08-28 13:37:23 -04:00
Jamie Bliss
9d727652c7 Fix #1513
Forgot to copy a mutated value on save. Added a test to prevent
regression.
2016-07-30 03:35:39 -04:00
Gil Forsyth
9ac3d29e7d add 'skip if on conda' fixture to vox tests 2016-07-23 17:27:27 -04:00
Gil Forsyth
10d06dc78b skip vox tests for the moment 2016-07-23 11:21:41 -04:00
Jamie Bliss
50f34fa352 Refactor machinery into voxapi in order to minimize global namespace pollution. 2016-07-20 16:22:23 -04:00
Jamie Bliss
7a05377443 Migrate vox to a xontrib 2016-07-20 15:45:14 -04:00
Jamie Bliss
4175d48b93 Add Vox class (and some basic tests for it) 2016-07-20 14:50:22 -04:00