shexec 2.3.0__tar.gz → 2.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {shexec-2.3.0/shexec.egg-info → shexec-2.4.0}/PKG-INFO +4 -4
- {shexec-2.3.0 → shexec-2.4.0}/README.rst +1 -1
- {shexec-2.3.0 → shexec-2.4.0}/pyproject.toml +1 -1
- {shexec-2.3.0 → shexec-2.4.0}/shexec/__init__.py +1 -1
- {shexec-2.3.0 → shexec-2.4.0}/shexec/plugin.py +4 -5
- {shexec-2.3.0 → shexec-2.4.0/shexec.egg-info}/PKG-INFO +4 -4
- {shexec-2.3.0 → shexec-2.4.0}/shexec.egg-info/requires.txt +2 -2
- {shexec-2.3.0 → shexec-2.4.0}/tests/test_cli.py +16 -2
- {shexec-2.3.0 → shexec-2.4.0}/tests/test_plugin.py +5 -2
- {shexec-2.3.0 → shexec-2.4.0}/LICENSE +0 -0
- {shexec-2.3.0 → shexec-2.4.0}/setup.cfg +0 -0
- {shexec-2.3.0 → shexec-2.4.0}/shexec/__main__.py +0 -0
- {shexec-2.3.0 → shexec-2.4.0}/shexec/models.py +0 -0
- {shexec-2.3.0 → shexec-2.4.0}/shexec/shexec.py +0 -0
- {shexec-2.3.0 → shexec-2.4.0}/shexec.egg-info/SOURCES.txt +0 -0
- {shexec-2.3.0 → shexec-2.4.0}/shexec.egg-info/dependency_links.txt +0 -0
- {shexec-2.3.0 → shexec-2.4.0}/shexec.egg-info/entry_points.txt +0 -0
- {shexec-2.3.0 → shexec-2.4.0}/shexec.egg-info/top_level.txt +0 -0
- {shexec-2.3.0 → shexec-2.4.0}/tests/test_shexec.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: shexec
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.0
|
|
4
4
|
Summary: Run a shell-type command over every file of an input tree: a ChRIS DS plugin on pfdo_run
|
|
5
5
|
Home-page: https://github.com/FNNDSC/pl-shexec
|
|
6
6
|
Author: FNNDSC
|
|
@@ -18,8 +18,8 @@ Requires-Python: >=3.11
|
|
|
18
18
|
Description-Content-Type: text/x-rst
|
|
19
19
|
License-File: LICENSE
|
|
20
20
|
Requires-Dist: chris_plugin>=0.4.0
|
|
21
|
-
Requires-Dist: pfdo>=6.
|
|
22
|
-
Requires-Dist: pfdo_run>=4.
|
|
21
|
+
Requires-Dist: pfdo>=6.3.0
|
|
22
|
+
Requires-Dist: pfdo_run>=4.3.0
|
|
23
23
|
Requires-Dist: hostlib>=1.2.0
|
|
24
24
|
Requires-Dist: pflog>=2.0.0
|
|
25
25
|
Provides-Extra: dev
|
|
@@ -159,7 +159,7 @@ From the command line, with the image:
|
|
|
159
159
|
fnndsc/pl-shexec shexec --fileFilter txt \
|
|
160
160
|
--exec "wc -l %{inputWorkingDir}/%{inputWorkingFile}" /incoming /outgoing
|
|
161
161
|
|
|
162
|
-
docker run --rm fnndsc/pl-shexec shexec --man
|
|
162
|
+
docker run --rm fnndsc/pl-shexec shexec --man
|
|
163
163
|
|
|
164
164
|
With Apptainer, ``apptainer exec docker://fnndsc/pl-shexec shexec ...``. The image carries the coreutils, zip and unzip, bc, perl, tar, ImageMagick and the DCMTK tools.
|
|
165
165
|
|
|
@@ -130,7 +130,7 @@ From the command line, with the image:
|
|
|
130
130
|
fnndsc/pl-shexec shexec --fileFilter txt \
|
|
131
131
|
--exec "wc -l %{inputWorkingDir}/%{inputWorkingFile}" /incoming /outgoing
|
|
132
132
|
|
|
133
|
-
docker run --rm fnndsc/pl-shexec shexec --man
|
|
133
|
+
docker run --rm fnndsc/pl-shexec shexec --man
|
|
134
134
|
|
|
135
135
|
With Apptainer, ``apptainer exec docker://fnndsc/pl-shexec shexec ...``. The image carries the coreutils, zip and unzip, bc, perl, tar, ImageMagick and the DCMTK tools.
|
|
136
136
|
|
|
@@ -13,7 +13,7 @@ authors = [{ email = "dev@babyMRI.org" }]
|
|
|
13
13
|
# fields, which the [project] table does not emit; setup.cfg supplies them, and the
|
|
14
14
|
# author name lives there alone so Author-email stays a bare address.
|
|
15
15
|
requires-python = ">=3.11"
|
|
16
|
-
dependencies = ["chris_plugin>=0.4.0", "pfdo>=6.
|
|
16
|
+
dependencies = ["chris_plugin>=0.4.0", "pfdo>=6.3.0", "pfdo_run>=4.3.0", "hostlib>=1.2.0", "pflog>=2.0.0"]
|
|
17
17
|
classifiers = [
|
|
18
18
|
"Programming Language :: Python :: 3",
|
|
19
19
|
"Programming Language :: Python :: 3.11",
|
|
@@ -38,7 +38,7 @@ from pathlib import Path
|
|
|
38
38
|
from chris_plugin import chris_plugin
|
|
39
39
|
from pfdo_run.__main__ import ARGS_SYNOPSIS_DS, CLI_DS, TAG_HELP, parser_build
|
|
40
40
|
from pflog import timed
|
|
41
|
-
from pftree.manual import Manual,
|
|
41
|
+
from pftree.manual import Manual, manual_attach
|
|
42
42
|
|
|
43
43
|
from shexec.models import Plugin, PluginSpec
|
|
44
44
|
from shexec.shexec import plugin_run
|
|
@@ -189,11 +189,13 @@ def parser_forSpec(spec: PluginSpec) -> argparse.ArgumentParser:
|
|
|
189
189
|
The defaults are set on the parser rather than applied afterwards, so the
|
|
190
190
|
description ``chris_plugin_info`` serialises carries them and ChRIS shows them.
|
|
191
191
|
They are set after the omission, so a spec can pin an omitted flag to a value
|
|
192
|
-
of its own.
|
|
192
|
+
of its own. ``--man`` and ``--synopsis`` print the plugin's own manual and exit as
|
|
193
|
+
they are read, so they need no ``inputdir outputdir``.
|
|
193
194
|
"""
|
|
194
195
|
parser: argparse.ArgumentParser = parser_build(standalone=False, command=spec.name, version=spec.version)
|
|
195
196
|
parser_omit(parser, spec.omit)
|
|
196
197
|
parser.set_defaults(**spec.defaults)
|
|
198
|
+
manual_attach(parser, manual_build(spec))
|
|
197
199
|
return parser
|
|
198
200
|
|
|
199
201
|
|
|
@@ -217,9 +219,6 @@ def plugin_build(spec: PluginSpec, singleton: bool = True) -> Plugin:
|
|
|
217
219
|
manual: Manual = manual_build(spec)
|
|
218
220
|
|
|
219
221
|
def body(options: argparse.Namespace, inputdir: Path, outputdir: Path) -> int:
|
|
220
|
-
if options.man or options.synopsis:
|
|
221
|
-
manual_print(manual, shortOnly=not options.man)
|
|
222
|
-
return 0
|
|
223
222
|
return plugin_run(options, inputdir, outputdir)
|
|
224
223
|
|
|
225
224
|
body.__name__ = spec.name
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: shexec
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.0
|
|
4
4
|
Summary: Run a shell-type command over every file of an input tree: a ChRIS DS plugin on pfdo_run
|
|
5
5
|
Home-page: https://github.com/FNNDSC/pl-shexec
|
|
6
6
|
Author: FNNDSC
|
|
@@ -18,8 +18,8 @@ Requires-Python: >=3.11
|
|
|
18
18
|
Description-Content-Type: text/x-rst
|
|
19
19
|
License-File: LICENSE
|
|
20
20
|
Requires-Dist: chris_plugin>=0.4.0
|
|
21
|
-
Requires-Dist: pfdo>=6.
|
|
22
|
-
Requires-Dist: pfdo_run>=4.
|
|
21
|
+
Requires-Dist: pfdo>=6.3.0
|
|
22
|
+
Requires-Dist: pfdo_run>=4.3.0
|
|
23
23
|
Requires-Dist: hostlib>=1.2.0
|
|
24
24
|
Requires-Dist: pflog>=2.0.0
|
|
25
25
|
Provides-Extra: dev
|
|
@@ -159,7 +159,7 @@ From the command line, with the image:
|
|
|
159
159
|
fnndsc/pl-shexec shexec --fileFilter txt \
|
|
160
160
|
--exec "wc -l %{inputWorkingDir}/%{inputWorkingFile}" /incoming /outgoing
|
|
161
161
|
|
|
162
|
-
docker run --rm fnndsc/pl-shexec shexec --man
|
|
162
|
+
docker run --rm fnndsc/pl-shexec shexec --man
|
|
163
163
|
|
|
164
164
|
With Apptainer, ``apptainer exec docker://fnndsc/pl-shexec shexec ...``. The image carries the coreutils, zip and unzip, bc, perl, tar, ImageMagick and the DCMTK tools.
|
|
165
165
|
|
|
@@ -17,11 +17,15 @@ from shexec.plugin import synopsis_build
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
def test_manual_andSynopsis(tmp_path: Path, capsys: pytest.CaptureFixture[str]) -> None:
|
|
20
|
-
|
|
20
|
+
with pytest.raises(SystemExit) as exc:
|
|
21
|
+
parser.parse_args(["--man"])
|
|
22
|
+
assert exc.value.code == 0
|
|
21
23
|
out: str = capsys.readouterr().out
|
|
22
24
|
body: str = out.split("DESCRIPTION", 1)[1]
|
|
23
25
|
assert "`" not in body and "TAGS" in body and "<inputDir>" in body and "shexec" in body
|
|
24
|
-
|
|
26
|
+
with pytest.raises(SystemExit) as exc:
|
|
27
|
+
parser.parse_args(["--synopsis"])
|
|
28
|
+
assert exc.value.code == 0
|
|
25
29
|
assert "TAGS" not in capsys.readouterr().out
|
|
26
30
|
|
|
27
31
|
|
|
@@ -62,3 +66,13 @@ def test_chris_plugin_info_describesThePlugin() -> None:
|
|
|
62
66
|
assert description["documentation"] == "https://github.com/FNNDSC/pl-shexec"
|
|
63
67
|
assert description["authors"] == "FNNDSC <dev@babyMRI.org>"
|
|
64
68
|
assert any(p["name"] == "exec" for p in description["parameters"])
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def test_consoleScript_manNeedsNoDirectories(
|
|
72
|
+
monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str]
|
|
73
|
+
) -> None:
|
|
74
|
+
monkeypatch.setattr("sys.argv", ["shexec", "--man"])
|
|
75
|
+
with pytest.raises(SystemExit) as exc:
|
|
76
|
+
main()
|
|
77
|
+
assert exc.value.code == 0
|
|
78
|
+
assert "TAGS" in capsys.readouterr().out
|
|
@@ -76,7 +76,9 @@ def test_derivedPlugin_describesItself_forChris() -> None:
|
|
|
76
76
|
|
|
77
77
|
def test_derivedPlugin_manualAndVersion_areItsOwn(tmp_path: Path, capsys: pytest.CaptureFixture[str]) -> None:
|
|
78
78
|
plugin: Plugin = plugin_build(spec_make(), singleton=False)
|
|
79
|
-
|
|
79
|
+
with pytest.raises(SystemExit) as exc:
|
|
80
|
+
plugin.parser.parse_args(["--man"])
|
|
81
|
+
assert exc.value.code == 0
|
|
80
82
|
out: str = capsys.readouterr().out
|
|
81
83
|
assert "linecount" in out and "Counts lines." in out and "9.9.9" in out and "TAGS" in out
|
|
82
84
|
with pytest.raises(SystemExit):
|
|
@@ -105,7 +107,8 @@ def test_omittedFlags_absentFromParserDescriptionAndManual_valuePinned(
|
|
|
105
107
|
plugin.parser.parse_args(["--threads", "4"])
|
|
106
108
|
assert raised.value.code == 2
|
|
107
109
|
capsys.readouterr()
|
|
108
|
-
|
|
110
|
+
with pytest.raises(SystemExit):
|
|
111
|
+
plugin.parser.parse_args(["--man"])
|
|
109
112
|
manual: str = capsys.readouterr().out
|
|
110
113
|
assert "[--threads" not in manual and "[--threadsSplit" not in manual
|
|
111
114
|
assert "[--verbosity" in manual
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|