withcache 0.4.2__tar.gz → 0.4.3__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: withcache
3
- Version: 0.4.2
3
+ Version: 0.4.3
4
4
  Summary: Operator-curated, URL-keyed artifact cache for a small lab (CUDA/ROCm/DOCA/firmware)
5
5
  Project-URL: Homepage, https://github.com/safl/withcache
6
6
  Author-email: "Simon A. F. Lund" <safl@safl.dk>
@@ -2,7 +2,7 @@
2
2
  .name = .withcache_shim,
3
3
  // Zig requires a literal here; keep it in lockstep with the project's
4
4
  // single source (src/withcache/__init__.py) via `make bump` / `make version-check`.
5
- .version = "0.4.2",
5
+ .version = "0.4.3",
6
6
  .fingerprint = 0xd7d96c5ed212ccaa,
7
7
  .minimum_zig_version = "0.16.0",
8
8
  .paths = .{
@@ -12,6 +12,6 @@ All modules are stdlib-only and self-contained.
12
12
 
13
13
  from .client import blob_url, cache_base, is_cached, serve_url
14
14
 
15
- __version__ = "0.4.2"
15
+ __version__ = "0.4.3"
16
16
 
17
17
  __all__ = ["__version__", "blob_url", "cache_base", "is_cached", "serve_url"]
@@ -41,8 +41,10 @@ import urllib.request
41
41
  from dataclasses import dataclass, field
42
42
  from datetime import datetime, timezone
43
43
 
44
+ from . import __version__
45
+
44
46
  CHUNK = 64 * 1024
45
- USER_AGENT = "withcache-cache/0.1"
47
+ USER_AGENT = f"withcache-cache/{__version__}"
46
48
  # Resume budget for a single store_from_origin call. A truncated
47
49
  # upstream stream re-fetches with ``Range: bytes=<got>-`` so the
48
50
  # next attempt picks up where the cut happened. Five tries cover
@@ -566,7 +568,7 @@ def _set_progress(job: Job, done: int, total: int | None):
566
568
  # HTTP handler
567
569
  # --------------------------------------------------------------------------
568
570
  class Handler(http.server.BaseHTTPRequestHandler):
569
- server_version = "withcache/0.1"
571
+ server_version = f"withcache/{__version__}"
570
572
  protocol_version = "HTTP/1.1"
571
573
 
572
574
  @property
@@ -859,7 +861,10 @@ class Handler(http.server.BaseHTTPRequestHandler):
859
861
  return f"""{self._head("withcache — login")}
860
862
  <body><main class="container">
861
863
  <article style="max-width: 24rem; margin: 4rem auto;">
862
- <hgroup><h2>withcache</h2><p>operator login</p></hgroup>
864
+ <hgroup>
865
+ <h2>withcache <small class="mono">v{html.escape(__version__)}</small></h2>
866
+ <p>operator login</p>
867
+ </hgroup>
863
868
  {err}
864
869
  <form method="post" action="/ui/login">
865
870
  <input type="password" name="password" placeholder="Admin password" autofocus required>
@@ -879,7 +884,10 @@ class Handler(http.server.BaseHTTPRequestHandler):
879
884
  return f"""{self._head("withcache cache-host")}
880
885
  <body><main class="container">
881
886
  <nav>
882
- <ul><li><strong>withcache</strong> &nbsp;<small>cache-host</small></li></ul>
887
+ <ul><li>
888
+ <strong>withcache</strong> &nbsp;<small>cache-host</small>
889
+ &nbsp;<small class="mono">v{html.escape(__version__)}</small>
890
+ </li></ul>
883
891
  <ul>
884
892
  <li><progress id="spin" class="htmx-indicator"></progress></li>
885
893
  {logout}
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes