powercli 0.3.2__tar.gz → 0.3.4__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.
- {powercli-0.3.2/src/powercli.egg-info → powercli-0.3.4}/PKG-INFO +3 -2
- {powercli-0.3.2 → powercli-0.3.4}/README.md +1 -0
- {powercli-0.3.2 → powercli-0.3.4}/pyproject.toml +4 -8
- {powercli-0.3.2 → powercli-0.3.4}/src/cli/commands/commands.py +10 -1
- {powercli-0.3.2 → powercli-0.3.4}/src/cli/commands/runner.py +4 -4
- {powercli-0.3.2 → powercli-0.3.4}/src/cli/output/progress.py +8 -3
- {powercli-0.3.2 → powercli-0.3.4/src/powercli.egg-info}/PKG-INFO +3 -2
- {powercli-0.3.2 → powercli-0.3.4}/tests/test_cli_entry_point.py +2 -1
- {powercli-0.3.2 → powercli-0.3.4}/tests/test_progress.py +4 -3
- {powercli-0.3.2 → powercli-0.3.4}/tests/test_runner.py +2 -1
- {powercli-0.3.2 → powercli-0.3.4}/LICENSE +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/setup.cfg +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/src/cli/__init__.py +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/src/cli/cli/__init__.py +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/src/cli/cli/entry_point.py +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/src/cli/commands/__init__.py +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/src/cli/commands/install.py +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/src/cli/commands/open_.py +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/src/cli/commands/run.py +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/src/cli/input.py +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/src/cli/models/__init__.py +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/src/cli/models/models.py +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/src/cli/output/__init__.py +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/src/cli/output/console.py +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/src/cli/output/message.py +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/src/cli/output/rich.py +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/src/cli/output/status.py +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/src/cli/py.typed +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/src/powercli.egg-info/SOURCES.txt +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/src/powercli.egg-info/dependency_links.txt +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/src/powercli.egg-info/entry_points.txt +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/src/powercli.egg-info/requires.txt +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/src/powercli.egg-info/top_level.txt +0 -0
- {powercli-0.3.2 → powercli-0.3.4}/tests/test_message.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: powercli
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: High-level CLI interaction
|
|
5
5
|
Author-email: Quinten Roets <qdr2104@columbia.edu>
|
|
6
6
|
License: MIT
|
|
@@ -17,6 +17,7 @@ Requires-Dist: superpathlib<3,>=2.0.2; extra == "dev"
|
|
|
17
17
|
|
|
18
18
|
# PowerCLI
|
|
19
19
|
[](https://badge.fury.io/py/powercli)
|
|
20
|
+

|
|
20
21
|

|
|
21
22
|

|
|
22
23
|

|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# PowerCLI
|
|
2
2
|
[](https://badge.fury.io/py/powercli)
|
|
3
|
+

|
|
3
4
|

|
|
4
5
|

|
|
5
6
|

|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "powercli"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.4"
|
|
4
4
|
description = "High-level CLI interaction"
|
|
5
5
|
authors = [{name = "Quinten Roets", email = "qdr2104@columbia.edu"}]
|
|
6
6
|
license = {text = "MIT"}
|
|
@@ -56,16 +56,12 @@ fix = true
|
|
|
56
56
|
[tool.ruff.lint]
|
|
57
57
|
select = ["ALL"]
|
|
58
58
|
ignore = [
|
|
59
|
-
"ANN101", # annotate self
|
|
60
|
-
"ANN102", # annotate cls
|
|
61
59
|
"ANN401", # annotated with Any
|
|
62
|
-
"D",
|
|
63
|
-
"
|
|
60
|
+
"D", # docstrings
|
|
61
|
+
"G004", # logging f-string
|
|
62
|
+
"S101", # assert used
|
|
64
63
|
]
|
|
65
64
|
|
|
66
|
-
[tool.ruff.lint.isort]
|
|
67
|
-
known-first-party = ["src"]
|
|
68
|
-
|
|
69
65
|
[tool.ruff.lint.per-file-ignores]
|
|
70
66
|
"__init__.py" = ["F401"]
|
|
71
67
|
|
|
@@ -49,7 +49,16 @@ class CommandPreparer:
|
|
|
49
49
|
if self.title is not None:
|
|
50
50
|
command = self.create_title_command() + command
|
|
51
51
|
shell = os.getenv("SHELL") or "/bin/bash"
|
|
52
|
-
commands = (
|
|
52
|
+
commands = (
|
|
53
|
+
"konsole",
|
|
54
|
+
"--new-tab",
|
|
55
|
+
"--workdir",
|
|
56
|
+
str(Path.cwd()),
|
|
57
|
+
"-e",
|
|
58
|
+
shell,
|
|
59
|
+
"-c",
|
|
60
|
+
command,
|
|
61
|
+
)
|
|
53
62
|
else:
|
|
54
63
|
commands = (command,)
|
|
55
64
|
return commands
|
|
@@ -93,11 +93,11 @@ class Runner(Generic[T1]):
|
|
|
93
93
|
self,
|
|
94
94
|
capture_output: bool, # noqa: FBT001
|
|
95
95
|
) -> subprocess.CompletedProcess[T1]:
|
|
96
|
-
return subprocess.run(
|
|
96
|
+
return subprocess.run( # noqa: S603
|
|
97
97
|
self.command_parts,
|
|
98
98
|
text=self.text,
|
|
99
99
|
check=self.check,
|
|
100
|
-
shell=self.shell,
|
|
100
|
+
shell=self.shell,
|
|
101
101
|
capture_output=capture_output,
|
|
102
102
|
input=self.input,
|
|
103
103
|
stdout=self.stdout,
|
|
@@ -117,10 +117,10 @@ class Runner(Generic[T1]):
|
|
|
117
117
|
return self.run_with_exception_handling(self._launch)
|
|
118
118
|
|
|
119
119
|
def _launch(self) -> subprocess.Popen[str]:
|
|
120
|
-
return subprocess.Popen(
|
|
120
|
+
return subprocess.Popen( # noqa: S603
|
|
121
121
|
self.command_parts,
|
|
122
122
|
text=self.text,
|
|
123
|
-
shell=self.shell,
|
|
123
|
+
shell=self.shell,
|
|
124
124
|
stdout=self.stdout,
|
|
125
125
|
stderr=self.stderr,
|
|
126
126
|
**self.subprocess_kwargs,
|
|
@@ -5,7 +5,7 @@ from functools import cached_property
|
|
|
5
5
|
from typing import TYPE_CHECKING, TypeVar
|
|
6
6
|
|
|
7
7
|
if TYPE_CHECKING:
|
|
8
|
-
from collections.abc import Iterable
|
|
8
|
+
from collections.abc import Iterable, Iterator
|
|
9
9
|
|
|
10
10
|
from rich.progress import Progress
|
|
11
11
|
|
|
@@ -46,13 +46,18 @@ def track_progress(
|
|
|
46
46
|
*,
|
|
47
47
|
cleanup_after_finish: bool = False,
|
|
48
48
|
# cleanup_after_finish makes completed progressbar appear twice
|
|
49
|
-
) ->
|
|
49
|
+
) -> Iterator[T]:
|
|
50
50
|
progress = progress_manager.progress
|
|
51
51
|
progress.__enter__()
|
|
52
52
|
|
|
53
53
|
task_id = progress.add_task(description=description, unit=unit)
|
|
54
54
|
progress_manager.number_of_active_progress_tracks += 1
|
|
55
|
-
yield from progress.track(
|
|
55
|
+
yield from progress.track(
|
|
56
|
+
sequence=sequence,
|
|
57
|
+
total=total,
|
|
58
|
+
task_id=task_id,
|
|
59
|
+
description=description,
|
|
60
|
+
)
|
|
56
61
|
progress_manager.number_of_active_progress_tracks -= 1
|
|
57
62
|
if cleanup_after_finish and progress_manager.number_of_active_progress_tracks == 0:
|
|
58
63
|
progress.__exit__(None, None, None)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: powercli
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: High-level CLI interaction
|
|
5
5
|
Author-email: Quinten Roets <qdr2104@columbia.edu>
|
|
6
6
|
License: MIT
|
|
@@ -17,6 +17,7 @@ Requires-Dist: superpathlib<3,>=2.0.2; extra == "dev"
|
|
|
17
17
|
|
|
18
18
|
# PowerCLI
|
|
19
19
|
[](https://badge.fury.io/py/powercli)
|
|
20
|
+

|
|
20
21
|

|
|
21
22
|

|
|
22
23
|

|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import time
|
|
2
2
|
from collections.abc import Iterable
|
|
3
3
|
|
|
4
|
-
import cli
|
|
5
4
|
import pytest
|
|
6
5
|
|
|
6
|
+
import cli
|
|
7
|
+
|
|
7
8
|
SLEEP_INTERVAL = 0.01
|
|
8
9
|
ITERATIONS = 200
|
|
9
10
|
|
|
@@ -11,12 +12,12 @@ ITERATIONS = 200
|
|
|
11
12
|
# Best to inspect these tests manually
|
|
12
13
|
|
|
13
14
|
|
|
14
|
-
@pytest.fixture
|
|
15
|
+
@pytest.fixture
|
|
15
16
|
def sequence() -> range:
|
|
16
17
|
return range(ITERATIONS)
|
|
17
18
|
|
|
18
19
|
|
|
19
|
-
@pytest.fixture
|
|
20
|
+
@pytest.fixture
|
|
20
21
|
def tracked_sequence(sequence: range) -> Iterable[int]:
|
|
21
22
|
return cli.track_progress(sequence, description="counting", unit="items")
|
|
22
23
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import string
|
|
3
3
|
|
|
4
|
-
import cli
|
|
5
4
|
import pytest
|
|
6
5
|
from hypothesis import given, settings, strategies
|
|
7
6
|
from hypothesis.strategies import SearchStrategy
|
|
8
7
|
from superpathlib import Path
|
|
9
8
|
|
|
9
|
+
import cli
|
|
10
|
+
|
|
10
11
|
linux_only_test = pytest.mark.skipif(
|
|
11
12
|
os.name != "posix",
|
|
12
13
|
reason="Bash specific syntax used for tests",
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|