Skip to content

Commit ce3a3fd

Browse files
authored
Merge pull request #1493 from saulpw/develop
Prep for v2.10 release
2 parents 6b36c5b + 7b7872e commit ce3a3fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+1485
-926
lines changed

.circleci/config.yml

-51
This file was deleted.

.envrc

-7
This file was deleted.

.github/workflows/main.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: visidata-ci-build
2+
on:
3+
pull_request:
4+
branches:
5+
- stable
6+
- develop
7+
push:
8+
branches:
9+
- stable
10+
- develop
11+
12+
jobs:
13+
run-tests:
14+
15+
strategy:
16+
matrix:
17+
python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
18+
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v2
22+
23+
- name: Set up Python ${{ matrix.pythonversion }}
24+
uses: actions/setup-python@v2
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Create .visidatarc
29+
run: touch ~/.visidatarc
30+
31+
- name: Set up Environment
32+
run: |
33+
export PYTHONPATH=~/visidata:~/visidata/visidata
34+
locale
35+
36+
- name: Install Base VisiData
37+
run: pip3 install .
38+
39+
- name: Ensure VisiData works with Base Dependencies
40+
run: vd --version
41+
42+
- name: Install optional dependencies
43+
run: |
44+
pip3 install -r requirements.txt
45+
pip3 install pytest
46+
47+
- name: Run test_commands
48+
run: |
49+
pytest -sv visidata/tests/test_commands.py
50+
51+
- name: Run Cmdlog Tests
52+
run: dev/test.sh
53+
shell: bash
54+

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ visidata.egg-info/
1212
tags
1313
/tests/log/
1414
# Mac files
15-
.DS_Store
15+
.DS_Store
16+
.direnv

CHANGELOG.md

+67
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,72 @@
11
# VisiData version history
22

3+
# v2.10 (2022-08-28)
4+
5+
- [plugins] load all entry points in `visidata.plugins` group before config load
6+
- add entry_points={'visidata.plugins': 'foo=foo'} to plugin load plugin automatically when launching VisiData
7+
8+
- [deps] require `importlib_metadata` >= 3.6
9+
- following https://github.com/pypa/twine/pull/732
10+
11+
## Improvements
12+
13+
- [draw] redraw only every 100 ms if any keys pending (requested by @ansoncg #1459)
14+
- [IndexSheet] shown name is only final name component
15+
- [loaders html] add table of all links on page (requested by @dufferzafar #1424)
16+
- [loaders html] `open-row` on **LinksSheet** to open url (requested by @dufferzafar #1424)
17+
- [options] add `options.http_req_*` to send headers/etc to requests (requested by @daviewales #1446)
18+
- [options pyobj] add `options.fmt_expand_dict` and `options.fmt_expand_list` for formatting expanded
19+
list and dict column names (requested by @joe-opensrc #1457)
20+
- [threads-sheet] add `z Ctrl+T` (`threads-sheet`) to open **ThreadsSheet** for current sheet
21+
- [threads-sheet] add `g Ctrl+C` (`cancel-all`) to **ThreadsSheet**
22+
- [zsh] add scripts for zsh completion (PR by @Freed-Wu #1455)
23+
- tutorial: https://visidata.org/docs/shell/
24+
25+
## Bugfixes
26+
27+
- [addcol-] set cursor at added column for `addcol-new`/`addcol-bulk` (reported by @jsvine #1445)
28+
- [cmdlog] `Ctrl+S` from a **CommandLog** now defaults to `.vdj` (reported by @jsvine #1443)
29+
- [display] format entire string for undetermined width (reported by and fixed by @jsvine #1442)
30+
- [formatter] fix len format strings
31+
- [LastInputsSheet] catch other exceptions during reload
32+
- [loader npz] fix .npz loader (reported by @Shahin-rmz #1440)
33+
- [loader geojson] fix plotting and saving geojson files (fixed by @mwayne #1477)
34+
- [loader geojson] improve feature property manipulation (fixed by @mwayne #1477)
35+
- [menu] upon menu item keypress, move to item (reported by @reagle #1470)
36+
- [menu] fix `ALT+<keystroke>` navigation while within menu (reported by @reagle #1470)
37+
- now requires two `ESC` to exit
38+
- [open] allow binary files from archives (reported by @frosencrantz #1430)
39+
- [save] do not save unknown filetype as `save_filetype`
40+
- [save visidatarc] only save rows on **OptionsSheet** to visidatarc
41+
- [sheets] fix name reconstruction for files with multiple and no suffixes (#1450)
42+
- [sheets] do not include empty name parts in sheet name
43+
- [unzip-http] **FreqTableSheet** `open-row` now loads links (reported by @frosencrantz #1458)
44+
- [zip] use correct rowdef in extract (reported by @frosencrantz #1430)
45+
- [zip] do not create directory for extract
46+
47+
## snippets
48+
49+
- add snippets/scrolloff.py which mimics vim's scrollof context lines (requested by @gennaro-tedesco #1441)
50+
51+
## vdplus
52+
53+
- `open-memusage` was moved to vdplus
54+
55+
## API
56+
57+
- add InferColumnsSheet
58+
- it infers the columns and their types from the rows it gets which are dicts
59+
- used by json, npy loader
60+
- add vd.printout and vd.printerr for builtins.print to stdout and stderr
61+
- add `vd.view()`
62+
- fix Extensible.init() to work with classes with no `__init__`
63+
- add `Sheet.sidebar` and `Sheet.sidebar_title` properties
64+
65+
## Deprecated
66+
67+
- remove VisiDataSheet
68+
- remove vdmenu
69+
370
# v2.9.1 (2022-07-21)
471

572
- [unzip-http] move urllib3 to optional dependencies

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
# VisiData v2.9.1 [![twitter @VisiData][1.1]][1] [![CircleCI](https://circleci.com/gh/saulpw/visidata/tree/stable.svg?style=svg)](https://circleci.com/gh/saulpw/visidata/tree/stable) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/saulpw/visidata)
2+
# VisiData v2.10 [![twitter @VisiData][1.1]][1] [![CircleCI](https://circleci.com/gh/saulpw/visidata/tree/stable.svg?style=svg)](https://circleci.com/gh/saulpw/visidata/tree/stable) [![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/saulpw/visidata)
33

44
A terminal interface for exploring and arranging tabular data.
55

dev/checklists/manual-tests.md

+3-5
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
- numerical, boolean and string option
1717
- sheet-specific and global
1818
- motd_url
19-
9. using the pandas loader
20-
- select
21-
- edit
22-
- frequency table
2319
10. large dataset (311)
2420
12. Options
2521
- local + global options should be set appropriately
@@ -87,10 +83,12 @@
8783
17. Anything new in this release (should it have its own automated test?)
8884
18. `edit-cell` and then `Ctrl+O` to launch editor.
8985
19. Save to a non-existent format.
90-
- Saves to tsv by default
86+
- Saves to save-filetype by default
87+
- If save-filetype is a non-existent format, blocks
9188
- Save to it a second time, asks for confirmation, if confirm_overwrite=True
9289
20. Save multiple sheets to a single non-embeddable format
9390
- save name makes sense
9491
- fails if not offered a directory
9592
- succeeds if offered a directory
9693
21. Test macro-record.
94+
22. Test `open-row` on an html link: https://hls.gsfc.nasa.gov/data/

dev/test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ for i in $TESTS ; do
2020
outbase=${i##tests/}
2121
if [ "${i%-nosave.vd*}-nosave" == "${i%.vd*}" ];
2222
then
23-
PYTHONPATH=. bin/vd --play "$i" --batch --config tests/.visidatarc --visidata-dir tests/.visidata
23+
echo "$1"
2424
else
2525
for goldfn in tests/golden/${outbase%.vd*}.*; do
2626
PYTHONPATH=. bin/vd --confirm-overwrite=False --play "$i" --batch --output "$goldfn" --config tests/.visidatarc --visidata-dir tests/.visidata

dev/zsh-completion.in

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#compdef vd visidata
2+
3+
(( $+functions[_vd_files] )) ||
4+
_vd_files () {
5+
case $PREFIX in
6+
(*) _files $* ;;
7+
esac
8+
case $PREFIX in
9+
(+) _message -e 'toplevel:subsheet:col:row' ;;
10+
(+<1->) _message -e 'toplevel' ;;
11+
(+<1->:) _message -e 'subsheet' ;;
12+
(+<1->:<1->:) _message -e 'col' ;;
13+
(+<1->:<1->:<1->:) _message -e 'row' ;;
14+
esac
15+
}
16+
17+
_arguments -S \
18+
{{flags}} \
19+
'(-p --play -w --replay-wait -b --batch -o --output --replay-movement)*:file:_vd_files'

dev/zsh-completion.py

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/usr/bin/env python
2+
from __future__ import unicode_literals
3+
4+
import os
5+
from os.path import dirname as dirn
6+
import sys
7+
import re
8+
9+
sys.path.insert(0, dirn(dirn((os.path.abspath(__file__)))))
10+
from visidata import vd
11+
from visidata.main import option_aliases
12+
13+
ZSH_COMPLETION_FILE = "_visidata"
14+
ZSH_COMPLETION_TEMPLATE = "dev/zsh-completion.in"
15+
pat_class = re.compile("'(.*)'")
16+
pat_select = re.compile("^\([^)]*\)")
17+
18+
19+
def generate_completion(opt):
20+
prefix = "--" + opt.name
21+
shortnames = [key for key, value in option_aliases.items() if value[0] == opt.name]
22+
if len(shortnames):
23+
if len(shortnames[0]) == 1:
24+
shortname = "-" + shortnames[0]
25+
else:
26+
shortname = "--" + shortnames[0]
27+
prefix = "{" + f"{shortname},{prefix}" + "}"
28+
if isinstance(opt.value, bool):
29+
completion = ""
30+
else:
31+
completion = ":" + pat_class.findall(str(opt.value.__class__))[0]
32+
if opt.name in ["play", "output", "visidata_dir", "config"]:
33+
completion += ":_files"
34+
elif opt.name in ["plugins_url", "motd_url"]:
35+
completion += ":_urls"
36+
helpstr = opt.helpstr.replace("[", "\\[").replace("]", "\\]")
37+
selections = pat_select.findall(helpstr)
38+
if len(selections):
39+
completion += f":{selections[0].replace('/', ' ')}"
40+
# TODO: use `zstyle ':completion:*' extra-verbose true`
41+
# to control the display of default value
42+
helpstr = helpstr + f" (default: {opt.value})"
43+
return f"{prefix}'[{helpstr}]{completion}'"
44+
45+
46+
flags = [generate_completion(vd._options[opt]["default"]) for opt in vd._options]
47+
48+
with open(ZSH_COMPLETION_TEMPLATE) as f:
49+
template = f.read()
50+
51+
template = template.replace("{{flags}}", " \\\n ".join(flags))
52+
53+
with open(ZSH_COMPLETION_FILE, "w") as f:
54+
f.write(template)

0 commit comments

Comments
 (0)