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.
Files changed (34) hide show
  1. {powercli-0.3.2/src/powercli.egg-info → powercli-0.3.4}/PKG-INFO +3 -2
  2. {powercli-0.3.2 → powercli-0.3.4}/README.md +1 -0
  3. {powercli-0.3.2 → powercli-0.3.4}/pyproject.toml +4 -8
  4. {powercli-0.3.2 → powercli-0.3.4}/src/cli/commands/commands.py +10 -1
  5. {powercli-0.3.2 → powercli-0.3.4}/src/cli/commands/runner.py +4 -4
  6. {powercli-0.3.2 → powercli-0.3.4}/src/cli/output/progress.py +8 -3
  7. {powercli-0.3.2 → powercli-0.3.4/src/powercli.egg-info}/PKG-INFO +3 -2
  8. {powercli-0.3.2 → powercli-0.3.4}/tests/test_cli_entry_point.py +2 -1
  9. {powercli-0.3.2 → powercli-0.3.4}/tests/test_progress.py +4 -3
  10. {powercli-0.3.2 → powercli-0.3.4}/tests/test_runner.py +2 -1
  11. {powercli-0.3.2 → powercli-0.3.4}/LICENSE +0 -0
  12. {powercli-0.3.2 → powercli-0.3.4}/setup.cfg +0 -0
  13. {powercli-0.3.2 → powercli-0.3.4}/src/cli/__init__.py +0 -0
  14. {powercli-0.3.2 → powercli-0.3.4}/src/cli/cli/__init__.py +0 -0
  15. {powercli-0.3.2 → powercli-0.3.4}/src/cli/cli/entry_point.py +0 -0
  16. {powercli-0.3.2 → powercli-0.3.4}/src/cli/commands/__init__.py +0 -0
  17. {powercli-0.3.2 → powercli-0.3.4}/src/cli/commands/install.py +0 -0
  18. {powercli-0.3.2 → powercli-0.3.4}/src/cli/commands/open_.py +0 -0
  19. {powercli-0.3.2 → powercli-0.3.4}/src/cli/commands/run.py +0 -0
  20. {powercli-0.3.2 → powercli-0.3.4}/src/cli/input.py +0 -0
  21. {powercli-0.3.2 → powercli-0.3.4}/src/cli/models/__init__.py +0 -0
  22. {powercli-0.3.2 → powercli-0.3.4}/src/cli/models/models.py +0 -0
  23. {powercli-0.3.2 → powercli-0.3.4}/src/cli/output/__init__.py +0 -0
  24. {powercli-0.3.2 → powercli-0.3.4}/src/cli/output/console.py +0 -0
  25. {powercli-0.3.2 → powercli-0.3.4}/src/cli/output/message.py +0 -0
  26. {powercli-0.3.2 → powercli-0.3.4}/src/cli/output/rich.py +0 -0
  27. {powercli-0.3.2 → powercli-0.3.4}/src/cli/output/status.py +0 -0
  28. {powercli-0.3.2 → powercli-0.3.4}/src/cli/py.typed +0 -0
  29. {powercli-0.3.2 → powercli-0.3.4}/src/powercli.egg-info/SOURCES.txt +0 -0
  30. {powercli-0.3.2 → powercli-0.3.4}/src/powercli.egg-info/dependency_links.txt +0 -0
  31. {powercli-0.3.2 → powercli-0.3.4}/src/powercli.egg-info/entry_points.txt +0 -0
  32. {powercli-0.3.2 → powercli-0.3.4}/src/powercli.egg-info/requires.txt +0 -0
  33. {powercli-0.3.2 → powercli-0.3.4}/src/powercli.egg-info/top_level.txt +0 -0
  34. {powercli-0.3.2 → powercli-0.3.4}/tests/test_message.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: powercli
3
- Version: 0.3.2
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
  [![PyPI version](https://badge.fury.io/py/powercli.svg)](https://badge.fury.io/py/powercli)
20
+ ![PyPI downloads](https://img.shields.io/pypi/dm/powercli)
20
21
  ![Python version](https://img.shields.io/badge/python-3.10+-brightgreen)
21
22
  ![Operating system](https://img.shields.io/badge/os-linux%20%7c%20macOS%20%7c%20windows-brightgreen)
22
23
  ![Coverage](https://img.shields.io/badge/coverage-82%25-brightgreen)
@@ -1,5 +1,6 @@
1
1
  # PowerCLI
2
2
  [![PyPI version](https://badge.fury.io/py/powercli.svg)](https://badge.fury.io/py/powercli)
3
+ ![PyPI downloads](https://img.shields.io/pypi/dm/powercli)
3
4
  ![Python version](https://img.shields.io/badge/python-3.10+-brightgreen)
4
5
  ![Operating system](https://img.shields.io/badge/os-linux%20%7c%20macOS%20%7c%20windows-brightgreen)
5
6
  ![Coverage](https://img.shields.io/badge/coverage-82%25-brightgreen)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "powercli"
3
- version = "0.3.2"
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", # docstrings
63
- "S101", # assert used
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 = ("konsole", "--new-tab", "-e", shell, "-c", command)
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, # noqa: S603
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, # noqa: S603
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
- ) -> Iterable[T]:
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(sequence, total, task_id, description)
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
1
+ Metadata-Version: 2.2
2
2
  Name: powercli
3
- Version: 0.3.2
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
  [![PyPI version](https://badge.fury.io/py/powercli.svg)](https://badge.fury.io/py/powercli)
20
+ ![PyPI downloads](https://img.shields.io/pypi/dm/powercli)
20
21
  ![Python version](https://img.shields.io/badge/python-3.10+-brightgreen)
21
22
  ![Operating system](https://img.shields.io/badge/os-linux%20%7c%20macOS%20%7c%20windows-brightgreen)
22
23
  ![Coverage](https://img.shields.io/badge/coverage-82%25-brightgreen)
@@ -1,8 +1,9 @@
1
1
  import contextlib
2
2
 
3
- from cli import cli
4
3
  from package_dev_utils.tests.args import cli_args
5
4
 
5
+ from cli import cli
6
+
6
7
 
7
8
  @cli_args("ls")
8
9
  def test_entry_point() -> None:
@@ -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