Commit graph

10336 commits

Author SHA1 Message Date
Noortheen Raja
576842c448 refactor: move out jupyter tests 2022-03-24 19:49:30 +05:30
Noortheen Raja
81b65556a5 chore: update tests 2022-03-24 19:49:30 +05:30
Noortheen Raja
8cff41b081 chore: move out jupyter, mpl, distributed, jedi xontribs
they are require extra packages for testing and usage
closes #4726
2022-03-24 19:49:30 +05:30
Noortheen Raja
43cbc770e9 refactor: move xontrib.jedi out 2022-03-24 19:49:30 +05:30
Noortheen Raja
48086a5778 feat: move fixtures to pytest-plugin 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
Noortheen Raja
a13a3af21f chore: try to comment news item missing
chore: make news item check a comment
2022-03-22 19:13:11 +05:30
Noortheen Raja
0acb256740 fix: mypy errors in ci
chore: upgrade mypy
2022-03-22 19:13:11 +05:30
Noortheen Raja
fa9c33b55b chore: cancel previous still running jobs for PRs 2022-03-22 19:13:11 +05:30
Noortheen Raja
d0f127718f chore: add tmate for manual ssh into runner 2022-03-22 19:13:11 +05:30
Noortheen Raja
96e726e390 refactor: revert check-news item
feat: make check-news item a warning
2022-03-22 19:13:11 +05:30
Noortheen Raja
ac1592c458 chore: use wheel to speedup binary installs 2022-03-22 19:13:11 +05:30
Noortheen Raja
9c2d10c416 fix: ci failure on linux 2022-03-22 19:13:11 +05:30
Noortheen Raja
a7ef90cce6 fix: upload coverage for latest py version
fix: checking qa without amalgamation

fix: correct if expression

chore: update condition

chore: disable fail-fast

chore: update name
2022-03-22 19:13:11 +05:30
Noortheen Raja
1c1fb997d4 chore: upgrade hooks 2022-03-22 19:13:11 +05:30
Noortheen Raja
e6043ca5aa chore: use matrix for CI
github has added
https://github.blog/2022-03-16-save-time-partial-re-runs-github-actions/

we can drop custom file generation

refactor: run with bash

chore: use setup-python

conda is also available in the github action virtualenv
2022-03-22 19:13:11 +05:30
Ganer
b0abba7c75
Fix annoying console spam (#4722)
* Fix annoying console spam

* Create fix-non-callable-autocompletion

* Rename fix-non-callable-autocompletion to fix-non-callable-autocompletion.rst

Co-authored-by: Noorhteen Raja NJ <jnoortheen@gmail.com>
2022-03-22 12:58:49 +05:30
Noorhteen Raja NJ
d49b164379
gitstatus modular (#4697) 2022-03-21 11:18:36 -04:00
E Pluribus Unum
6fc77f2fcb
do to following -> do the following (#4728)
* do to following -> do the following

very minor spelling correction

* Minor spelling corrections
2022-03-21 10:05:20 +05:30
Peter Ye
e5af63bff7
Fix regex globbing for paths that contain special regex characters (#4715)
* Fix regex globbing for paths that contain special regex characters

* Skip regex globbing asterisk character tests on Windows

Asterisks are forbidden in Windows filenames. Plus signs are allowed in Windows filenames, so the plus sign tests run properly.
2022-03-20 01:10:57 +05:30
Gil Forsyth
32bddba3a3
chore: update mypy (#4718)
* chore: pin mypy to 0.940, stop installing from git

* chore: skip mypy check of windows unc check
2022-03-16 07:52:37 +05:30
Gil Forsyth
f0d77b28e8
chore: call token personal_token
Just in case this action thinks it knows better
2022-03-15 10:50:32 -04:00
Gil Forsyth
688d91f377
chore: add repo name to token generation for docs push 2022-03-15 10:33:44 -04:00
Kyllingene
1889d3e2ea
Clarified use of time_format in docs (#4714)
* Added reference to ``PROMPT_FIELDS`` section in ``time_format`` definition

* Forgot the news item, added now

* Generalized reference to PROMPT_FIELDS
2022-03-15 08:17:16 +05:30
Peter Ye
b581edb05d
Fix $XONSH_TRACEBACK_LOGFILE path expansion (#4713) 2022-03-15 00:31:24 +05:30
dev2718
78f9195227
fix 4343 by always trying greedy=True in _parse_ctx_free (#4699)
Co-authored-by: Alexander Firbas <alexander.firbas@gmail.com>
2022-03-07 01:53:34 +05:30
ylmrx
8e1a1f3342
fix: ptk now support modal cursor shape, use it when vi_mode is enabled (#4695)
* fix: ptk now support modal cursor shape, use it when vi_mode is enabled

* lint: use double-quotes

* bump ptk dependency in setup and integration

* lint: sorting imports
2022-03-05 15:45:32 +05:30
Gil Forsyth
14fe0355d0
fix(maybe): use generated token to push docs (#4691)
Got the token to generate correctly, but now it's complaining about
scoping -- might be that it needs to be generated for xonsh/xonsh to
push to xonsh/xonsh-docs
2022-03-04 08:06:25 +05:30
Gil Forsyth
46df765628 Add goat counter to track hits on the docs 2022-03-03 10:45:19 -05:00
Noorhteen Raja NJ
af8570a21a Update issue templates 2022-03-01 08:53:49 -05:00
Noorhteen Raja NJ
269a6d48e7
chore: point to discussions in case of Q&A (#4681) 2022-02-28 16:33:46 +05:30
dev2718
d6588885ab
feat: colored tracebacks during interactive use (#4683)
* feat: colored tracebacks

* fix pygments import, remove promt_toolkit restriction

Co-authored-by: Alexander Firbas <alexander.firbas@gmail.com>
2022-02-26 22:50:52 +05:30
dev2718
0ba5bec86f
Feat: support for match statement for python >= 3.10 (#4672)
* feat: initial match statement support

* refactor assignment exprs for <3.8 compatibility; sort imports

* remove match extensions

* bump qa-workflow python version, minor alterations for qa-pipeline

* add mypy exception

* update mypy version

* Bump workflow main python version to 3.10

* remove outdated note

Co-authored-by: Alexander Firbas <alexander.firbas@gmail.com>
2022-02-25 17:00:00 +05:30
Oliver Bestwalter
81c8fe6bb9
make env_name aware of prompt in pyvenv.cfg (#4673)
* make env_name aware of prompt in pyvenv.cfg

prompt.env.env_name is now aware of the "prompt" key in pyvenv.cfg - search order from first to last is: $VIRTUAL_ENV_PROMPT, pyvenv.cfg, $VIRTUAL_ENV.

fixes #4670

* make env_name aware of prompt in pyvenv.cfg

prompt.env.env_name is now aware of the "prompt" key in pyvenv.cfg - search order from first to last is: $VIRTUAL_ENV_PROMPT, pyvenv.cfg, $VIRTUAL_ENV.

As the env_name is generated every time the prompt is generated, caching is used to only calculate it once for every venv path.

This introduces the possibility that the user will not get a correct env_name, when they change the cfg file or replace the whole venv and use different prompt settings the second time around. Although this is annoying and potentially confusing, it is still better than the situation before, where the prompt setting was simply ignored, although it is part of venv since python3.6 - so or now this might be seen as acceptable trade-off between speed and correctness.

fixes #4670

* make env_name aware of prompt in pyvenv.cfg

prompt.env.env_name is now aware of the "prompt" key in pyvenv.cfg - search order from first to last is: $VIRTUAL_ENV_PROMPT, pyvenv.cfg, $VIRTUAL_ENV.

As the env_name is generated every time the prompt is generated, caching is used to only calculate it once for every venv path.

This introduces the possibility that the user will not get a correct env_name, when they change the cfg file or replace the whole venv and use different prompt settings the second time around. Although this is annoying and potentially confusing, it is still better than the situation before, where the prompt setting was simply ignored, although it is part of venv since python3.6 - so or now this might be seen as acceptable trade-off between speed and correctness.

fixes #4670

* add type annotations

* always return str

This is more consistent and might also deal with a mypy error only observed on Ubuntu Linux python3.9

* remove unnecessary import

* adapt code to not break the documented API

When restructuring the code, I did not know that this was part of a documented API. This restores the API functions and updates the doc strings. New helper functions have been made private.
2022-02-21 23:39:07 +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
Oliver Bestwalter
5268dd8003
use recommended pytest entry point in docs and comments (#4671)
Since pytest 3.0 (2016) - the recommended commandline invocation is pytest (without the dot).

py.test is still available for backwards compatibility but might be removed at some point in the future and the new entry point is already well established.
2022-02-19 01:45:45 +05:30
zzj
adfa60ead5
refactoring code with starred pythonic idiom (#4666)
* refactoring code with starred pythonic idiom

refactoring code with starred pythonic idiom which is more pythonic, concise, readable and efficient; how do think this change which has practical value?

* removing step
2022-02-11 19:23:00 +05:30
Daniel
dbc71bd1a4
fix: '~' replaced to home/user by bash completion scripts breaks autocompletion (#4667)
* Improve bash_completer (#4664)

* add protection againts bash completion scripts which changes ~ to /home/user

* Add news file

* Run black

* Add new TC covering fix
2022-02-11 17:31:41 +05:30
dev2718
7e84e7b003
feat: make stracktraces behave like in python (#4662)
* feat: better stacktraces

* reraise SystemExit to enable proper exit codes and maintain old
behaviour in repl

* dont ignore exceptions when loading rc-files

* update tests with new SyntaxError formatting, new behavior that main
does not throw user exceptions

* pull return out of finally (flake8, B012)

* hide XonshError traces, fix mypy error, enable circumvention of trace suppression
with XONSH_DEBUG in non-interactive use

* fix mypy error

Co-authored-by: Alexander Firbas <alexander.firbas@gmail.com>
2022-02-04 09:16:44 +05:30
Ryan Delaney
ebba46ca7d
Add xontrib-gruvbox to xontribs_meta.py (#4663)
* Add xontrib-gruvbox to xontribs_meta.py

* Add news item for xontrib-gruvbox

Co-authored-by: Ryan Delaney <ryan.patrick.delaney+github@protonmail.com>
2022-02-04 07:40:53 +05:30
Noortheen Raja
78091a22f3 style: isort imports
fix #4584
2022-01-31 11:16:51 -05:00
Noortheen Raja
8007561fb5 feat: add isort to project 2022-01-31 11:16:51 -05:00
Noortheen Raja
c51f91b259 refactor: update pre-commit hooks 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
Noorhteen Raja NJ
e76115676b
improve completers (#4648)
* fix: pip -r appends spaces at the end

modularize completing output from subproc-out

* docs:

* fix: flake8

* fix: failing pip comp tests

* refactor: naming xonsh conflicts with actual package

the IDE completions don't work.
we add this naming convention instead.

* feat: option to filter after completion returned

this will help reduce some boilerplate, and we can enrich the filtering
behaviour

* feat: add gh completions

* fix: filtering out completions

* refactor: simplify invoking completer interface

* test: add fixture for xsh with os-env

* test: add tests for gh-completions

* fix: flake error

* fix: mypy errors and update gh completer tests

* fix: handle cross-platform line endings

* feat: include man,bash completer only if available

* todo: improve man page completions

* fix: failing man page tests

* fix: py 3.7 compatibility

* fix: qa error

* fix: stop dir completions

* feat: improve man page completions

now shows descriptions, recognizes more number of options correctly

* fix: update man page completions

* feat: support filtering based on display as well

* Update xonsh/completer.py

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

* style:

* test: xfail ptk-shell tests on windows

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
2022-01-27 21:22:36 +05:30
Gil Forsyth
278bd87d7c
chore: fix generated token for docs push (#4658) 2022-01-26 07:52:47 +05:30
Noortheen Raja
8e4cba5176 chore: update libs 2022-01-24 12:35:46 -05:00
dev2718
63bdaee626
feat: implement $SHLVL mirroring bash's implementation (#4651)
* feat: implement $SHLVL mirroring bash's implementation

* reformat and add news entry

* add missing import

* add $SHLVL integration test

Co-authored-by: Alexander Firbas <alexander.firbas@gmail.com>
2022-01-24 07:24:28 +05:30
Angus Hollands
7eceb7f956
Feat: add Aliases.register (#4547)
* Feat: add `Aliases.register`

* Fix: return func from decorator

* Feat: support private name

* Fix: use local name

* Test: test aliases decorator

* Update news/feat-add-alias-decorator.rst

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

* Update feat-add-alias-decorator.rst

* Update test_aliases.py

* Update aliases.py

* Update test_aliases.py

* Update aliases.py

Co-authored-by: Gil Forsyth <gforsyth@users.noreply.github.com>
Co-authored-by: Noorhteen Raja NJ <jnoortheen@gmail.com>
2022-01-21 16:30:23 +05:30
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