charmlibs-snap 1.0.0__tar.gz → 1.0.1__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.
@@ -180,4 +180,5 @@ cython_debug/
180
180
 
181
181
  # uv.lock from example libraries as we don't commit these
182
182
  .example/**/uv.lock
183
+ .tutorial/**/uv.lock
183
184
  interfaces/.example/**/uv.lock
@@ -0,0 +1,11 @@
1
+ # 1.0.1 - 4 November 2025
2
+
3
+ Update the type annotation of `log`'s `num_lines` parameter to indicate that `'all'` is accepted.
4
+
5
+ # 1.0.0.post0 - 14 October 2025
6
+
7
+ Update project URLs.
8
+
9
+ # 1.0.0 - 23 September 2025
10
+
11
+ Initial release of migrated `operator_libs_linux.v2.snap` library (patch version 14).
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: charmlibs-snap
3
- Version: 1.0.0
3
+ Version: 1.0.1
4
4
  Summary: The charmlibs.snap package.
5
- Project-URL: Documentation, https://documentation.ubuntu.com/charmlibs
5
+ Project-URL: Documentation, https://documentation.ubuntu.com/charmlibs/reference/charmlibs/snap/
6
6
  Project-URL: Repository, https://github.com/canonical/charmlibs
7
7
  Project-URL: Issues, https://github.com/canonical/charmlibs/issues
8
8
  Project-URL: Changelog, https://github.com/canonical/charmlibs/blob/main/snap/CHANGELOG.md
@@ -27,7 +27,7 @@ functional = []
27
27
  integration = []
28
28
 
29
29
  [project.urls]
30
- "Documentation" = "https://documentation.ubuntu.com/charmlibs"
30
+ "Documentation" = "https://documentation.ubuntu.com/charmlibs/reference/charmlibs/snap/"
31
31
  "Repository" = "https://github.com/canonical/charmlibs"
32
32
  "Issues" = "https://github.com/canonical/charmlibs/issues"
33
33
  "Changelog" = "https://github.com/canonical/charmlibs/blob/main/snap/CHANGELOG.md"
@@ -424,13 +424,12 @@ class Snap:
424
424
  args = ['stop', '--disable'] if disable else ['stop']
425
425
  self._snap_daemons(args, services)
426
426
 
427
- def logs(self, services: list[str] | None = None, num_lines: int = 10) -> str:
427
+ def logs(self, services: list[str] | None = None, num_lines: int | Literal['all'] = 10) -> str:
428
428
  """Fetch a snap services' logs.
429
429
 
430
430
  Args:
431
- services (list): (optional) list of individual snap services to show logs from
432
- (otherwise all)
433
- num_lines (int): (optional) integer number of log lines to return. Default `10`
431
+ services: individual snap services to show logs from. Includes all by default.
432
+ num_lines: number of log lines to return, or 'all'. Returns 10 by default.
434
433
  """
435
434
  args = ['logs', f'-n={num_lines}'] if num_lines else ['logs']
436
435
  return self._snap_daemons(args, services).stdout
@@ -12,4 +12,4 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- __version__ = '1.0.0'
15
+ __version__ = '1.0.1'
@@ -345,6 +345,14 @@ class TestSnapCache(unittest.TestCase):
345
345
  capture_output=True,
346
346
  )
347
347
 
348
+ foo.logs(num_lines='all')
349
+ mock_subprocess.assert_called_with(
350
+ ['snap', 'logs', '-n=all', 'foo'],
351
+ text=True,
352
+ check=True,
353
+ capture_output=True,
354
+ )
355
+
348
356
  foo.logs(services=['bar', 'baz'], num_lines=0) # falsey num_lines is ignored
349
357
  mock_subprocess.assert_called_with(
350
358
  ['snap', 'logs', 'foo.bar', 'foo.baz'],
File without changes
File without changes
File without changes