tensors 0.1.4__tar.gz → 0.1.5__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: tensors
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary: Read safetensor metadata and fetch CivitAI model information
5
5
  Requires-Python: >=3.12
6
6
  Requires-Dist: httpx>=0.27.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "tensors"
3
- version = "0.1.4"
3
+ version = "0.1.5"
4
4
  description = "Read safetensor metadata and fetch CivitAI model information"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -4,6 +4,7 @@ from __future__ import annotations
4
4
 
5
5
  import json
6
6
  import sys
7
+ from importlib.metadata import version
7
8
  from pathlib import Path
8
9
  from typing import Annotated, Any
9
10
 
@@ -41,11 +42,28 @@ from tensors.safetensor import compute_sha256, get_base_name, read_safetensor_me
41
42
  # Key masking threshold
42
43
  MIN_KEY_LENGTH_FOR_MASKING = 8
43
44
 
45
+
46
+ def _version_callback(value: bool) -> None:
47
+ if value:
48
+ print(f"tsr {version('tensors')}")
49
+ raise typer.Exit
50
+
51
+
44
52
  app = typer.Typer(
45
53
  name="tsr",
46
54
  help="Read safetensor metadata, search and download CivitAI models.",
47
55
  no_args_is_help=True,
48
56
  )
57
+
58
+
59
+ @app.callback()
60
+ def _main(
61
+ _version: Annotated[
62
+ bool,
63
+ typer.Option("--version", "-V", callback=_version_callback, is_eager=True, help="Show version and exit."),
64
+ ] = False,
65
+ ) -> None:
66
+ """Read safetensor metadata, search and download CivitAI models."""
49
67
  console = Console()
50
68
 
51
69
 
@@ -574,7 +574,7 @@ wheels = [
574
574
 
575
575
  [[package]]
576
576
  name = "tensors"
577
- version = "0.1.3"
577
+ version = "0.1.4"
578
578
  source = { editable = "." }
579
579
  dependencies = [
580
580
  { name = "httpx" },
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