/
usr
/
lib
/
rads
/
venv
/
lib
/
python3.13
/
site-packages
/
_pytest
/
/usr/lib/rads/venv/lib/python3.13/site-packages/_pytest
mkdir
upload
Name
Size
Mode
Actions
assertion/
-
0755
rm
config/
-
0755
rm
mark/
-
0755
rm
_code/
-
0755
rm
_io/
-
0755
rm
_py/
-
0755
rm
__pycache__/
-
0755
rm
cacheprovider.py
22375
0644
edit
dl
rm
capture.py
36829
0644
edit
dl
rm
compat.py
10662
0644
edit
dl
rm
debugging.py
13947
0644
edit
dl
rm
deprecated.py
3147
0644
edit
dl
rm
doctest.py
26259
0644
edit
dl
rm
faulthandler.py
3683
0644
edit
dl
rm
fixtures.py
77746
0644
edit
dl
rm
freeze_support.py
1300
0644
edit
dl
rm
helpconfig.py
9386
0644
edit
dl
rm
hookspec.py
42849
0644
edit
dl
rm
junitxml.py
25441
0644
edit
dl
rm
legacypath.py
16588
0644
edit
dl
rm
logging.py
35234
0644
edit
dl
rm
main.py
37689
0644
edit
dl
rm
monkeypatch.py
14625
0644
edit
dl
rm
nodes.py
26540
0644
edit
dl
rm
outcomes.py
10502
0644
edit
dl
rm
pastebin.py
4155
0644
edit
dl
rm
pathlib.py
37622
0644
edit
dl
rm
py.typed
0
0644
edit
dl
rm
pytester.py
61960
0644
edit
dl
rm
pytester_assertions.py
2253
0644
edit
dl
rm
python.py
66627
0644
edit
dl
rm
python_api.py
31323
0644
edit
dl
rm
raises.py
60196
0644
edit
dl
rm
recwarn.py
13245
0644
edit
dl
rm
reports.py
21406
0644
edit
dl
rm
runner.py
19543
0644
edit
dl
rm
scope.py
2738
0644
edit
dl
rm
setuponly.py
3167
0644
edit
dl
rm
setupplan.py
1184
0644
edit
dl
rm
skipping.py
10623
0644
edit
dl
rm
stash.py
3090
0644
edit
dl
rm
stepwise.py
7689
0644
edit
dl
rm
terminal.py
60419
0644
edit
dl
rm
threadexception.py
4953
0644
edit
dl
rm
timing.py
3065
0644
edit
dl
rm
tmpdir.py
11263
0644
edit
dl
rm
tracemalloc.py
778
0644
edit
dl
rm
unittest.py
19249
0644
edit
dl
rm
unraisableexception.py
5179
0644
edit
dl
rm
warnings.py
5237
0644
edit
dl
rm
warning_types.py
4239
0644
edit
dl
rm
_argcomplete.py
3776
0644
edit
dl
rm
_version.py
704
0644
edit
dl
rm
__init__.py
391
0644
edit
dl
rm
Edit:
/usr/lib/rads/venv/lib/python3.13/site-packages/_pytest/_argcomplete.py
(3776B)
"""Allow bash-completion for argparse with argcomplete if installed. Needs argcomplete>=0.5.6 for python 3.2/3.3 (older versions fail to find the magic string, so _ARGCOMPLETE env. var is never set, and this does not need special code). Function try_argcomplete(parser) should be called directly before the call to ArgumentParser.parse_args(). The filescompleter is what you normally would use on the positional arguments specification, in order to get "dirname/" after "dirn<TAB>" instead of the default "dirname ": optparser.add_argument(Config._file_or_dir, nargs='*').completer=filescompleter Other, application specific, completers should go in the file doing the add_argument calls as they need to be specified as .completer attributes as well. (If argcomplete is not installed, the function the attribute points to will not be used). SPEEDUP ======= The generic argcomplete script for bash-completion (/etc/bash_completion.d/python-argcomplete.sh) uses a python program to determine startup script generated by pip. You can speed up completion somewhat by changing this script to include # PYTHON_ARGCOMPLETE_OK so the python-argcomplete-check-easy-install-script does not need to be called to find the entry point of the code and see if that is marked with PYTHON_ARGCOMPLETE_OK. INSTALL/DEBUGGING ================= To include this support in another application that has setup.py generated scripts: - Add the line: # PYTHON_ARGCOMPLETE_OK near the top of the main python entry point. - Include in the file calling parse_args(): from _argcomplete import try_argcomplete, filescompleter Call try_argcomplete just before parse_args(), and optionally add filescompleter to the positional arguments' add_argument(). If things do not work right away: - Switch on argcomplete debugging with (also helpful when doing custom completers): export _ARC_DEBUG=1 - Run: python-argcomplete-check-easy-install-script $(which appname) echo $? will echo 0 if the magic line has been found, 1 if not. - Sometimes it helps to find early on errors using: _ARGCOMPLETE=1 _ARC_DEBUG=1 appname which should throw a KeyError: 'COMPLINE' (which is properly set by the global argcomplete script). """ from __future__ import annotations import argparse from glob import glob import os import sys from typing import Any class FastFilesCompleter: """Fast file completer class.""" def __init__(self, directories: bool = True) -> None: self.directories = directories def __call__(self, prefix: str, **kwargs: Any) -> list[str]: # Only called on non option completions. if os.sep in prefix[1:]: prefix_dir = len(os.path.dirname(prefix) + os.sep) else: prefix_dir = 0 completion = [] globbed = [] if "*" not in prefix and "?" not in prefix: # We are on unix, otherwise no bash. if not prefix or prefix[-1] == os.sep: globbed.extend(glob(prefix + ".*")) prefix += "*" globbed.extend(glob(prefix)) for x in sorted(globbed): if os.path.isdir(x): x += "/" # Append stripping the prefix (like bash, not like compgen). completion.append(x[prefix_dir:]) return completion if os.environ.get("_ARGCOMPLETE"): try: import argcomplete.completers except ImportError: sys.exit(-1) filescompleter: FastFilesCompleter | None = FastFilesCompleter() def try_argcomplete(parser: argparse.ArgumentParser) -> None: argcomplete.autocomplete(parser, always_complete_options=False) else: def try_argcomplete(parser: argparse.ArgumentParser) -> None: pass filescompleter = None
Save
cmd:
run