jartify 0.2.2__tar.gz → 0.2.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: jartify
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: TUI and CLI for searching JFrog Artifactory artifacts (version, filename, sha256)
5
5
  Author-email: Jakob Holst <code@jakobholst.dk>
6
6
  License: MIT
@@ -134,6 +134,9 @@ jartify-locate --init
134
134
  # commits so Ctrl+C keeps everything already indexed):
135
135
  jartify-locate --init --status=progress
136
136
 
137
+ # Or one AQL per repo, printing the repo name as it goes (commits per repo):
138
+ jartify-locate --init --status=step
139
+
137
140
  # Then search locally:
138
141
  jartify-locate # list everything (respects --repo / --limit)
139
142
  jartify-locate '*.json' # glob
@@ -108,6 +108,9 @@ jartify-locate --init
108
108
  # commits so Ctrl+C keeps everything already indexed):
109
109
  jartify-locate --init --status=progress
110
110
 
111
+ # Or one AQL per repo, printing the repo name as it goes (commits per repo):
112
+ jartify-locate --init --status=step
113
+
111
114
  # Then search locally:
112
115
  jartify-locate # list everything (respects --repo / --limit)
113
116
  jartify-locate '*.json' # glob
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "jartify"
7
- version = "0.2.2"
7
+ version = "0.2.3"
8
8
  description = "TUI and CLI for searching JFrog Artifactory artifacts (version, filename, sha256)"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -0,0 +1 @@
1
+ __version__ = "0.2.3"
@@ -287,6 +287,47 @@ def _init_paginated(
287
287
  return total_appended
288
288
 
289
289
 
290
+ def _init_step(
291
+ client: ArtifactoryClient, repos: list[str] | None
292
+ ) -> int:
293
+ """One AQL request per repo, printing the repo name as it goes."""
294
+ if repos is None:
295
+ all_repos = client.list_repositories()
296
+ repo_keys = [r.get("key") for r in all_repos if r.get("key")]
297
+ if not repo_keys:
298
+ print(" no repos visible to this token.")
299
+ return 0
300
+ else:
301
+ repo_keys = list(repos)
302
+
303
+ conn = _db_connect()
304
+ t0 = time.time()
305
+ total_appended = 0
306
+ skipped = 0
307
+ width = len(str(len(repo_keys)))
308
+ try:
309
+ for i, repo in enumerate(repo_keys, 1):
310
+ prefix = f"[{i:>{width}}/{len(repo_keys)}]"
311
+ print(f"{prefix} {repo} …", flush=True)
312
+ items = client.aql(_aql_query([repo]))
313
+ artifact_rows, location_rows, skip = _build_rows(items)
314
+ with conn:
315
+ _insert_batch(conn, artifact_rows, location_rows)
316
+ total_appended += len(artifact_rows)
317
+ skipped += skip
318
+ indent = " " * (len(prefix) + 1)
319
+ print(f"{indent}{len(artifact_rows):,} files appended "
320
+ f"({len(items):,} received)",
321
+ flush=True)
322
+
323
+ with conn:
324
+ _write_meta(conn)
325
+ _finalize(conn, t0, skipped)
326
+ finally:
327
+ conn.close()
328
+ return total_appended
329
+
330
+
290
331
  def _init_index(
291
332
  client: ArtifactoryClient,
292
333
  repos: list[str] | None,
@@ -296,6 +337,8 @@ def _init_index(
296
337
  print(f"Fetching artifact index for {scope} via AQL…", flush=True)
297
338
  if status == "progress":
298
339
  return _init_paginated(client, repos)
340
+ if status == "step":
341
+ return _init_step(client, repos)
299
342
  return _init_single_shot(client, repos)
300
343
 
301
344
 
@@ -405,10 +448,11 @@ def _build_parser() -> argparse.ArgumentParser:
405
448
  help="Skip TLS cert verification during --init.")
406
449
  p.add_argument(
407
450
  "--status",
408
- choices=("off", "progress"),
451
+ choices=("off", "progress", "step"),
409
452
  default="off",
410
- help="Progress display during --init. 'progress' paginates the AQL "
411
- "query and renders a live bar + count (default: off).",
453
+ help="Progress display during --init. 'progress' paginates AQL and "
454
+ "renders a live bar; 'step' runs one AQL per repo and prints "
455
+ "each repo name as it goes (default: off).",
412
456
  )
413
457
  p.add_argument("--version", action="version", version=f"jartify {__version__}")
414
458
  return p
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: jartify
3
- Version: 0.2.2
3
+ Version: 0.2.3
4
4
  Summary: TUI and CLI for searching JFrog Artifactory artifacts (version, filename, sha256)
5
5
  Author-email: Jakob Holst <code@jakobholst.dk>
6
6
  License: MIT
@@ -134,6 +134,9 @@ jartify-locate --init
134
134
  # commits so Ctrl+C keeps everything already indexed):
135
135
  jartify-locate --init --status=progress
136
136
 
137
+ # Or one AQL per repo, printing the repo name as it goes (commits per repo):
138
+ jartify-locate --init --status=step
139
+
137
140
  # Then search locally:
138
141
  jartify-locate # list everything (respects --repo / --limit)
139
142
  jartify-locate '*.json' # glob
@@ -1 +0,0 @@
1
- __version__ = "0.2.2"
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