pyvegh 0.6.0__tar.gz → 0.7.0__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.
@@ -0,0 +1,55 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # rust-clippy is a tool that runs a bunch of lints to catch common
6
+ # mistakes in your Rust code and help improve your Rust code.
7
+ # More details at https://github.com/rust-lang/rust-clippy
8
+ # and https://rust-lang.github.io/rust-clippy/
9
+
10
+ name: rust-clippy analyze
11
+
12
+ on:
13
+ push:
14
+ branches: [ "main" ]
15
+ pull_request:
16
+ # The branches below must be a subset of the branches above
17
+ branches: [ "main" ]
18
+ schedule:
19
+ - cron: '32 11 * * 4'
20
+
21
+ jobs:
22
+ rust-clippy-analyze:
23
+ name: Run rust-clippy analyzing
24
+ runs-on: ubuntu-latest
25
+ permissions:
26
+ contents: read
27
+ security-events: write
28
+ actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
29
+ steps:
30
+ - name: Checkout code
31
+ uses: actions/checkout@v4
32
+
33
+ - name: Install Rust toolchain
34
+ uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1
35
+ with:
36
+ profile: minimal
37
+ toolchain: stable
38
+ components: clippy
39
+ override: true
40
+
41
+ - name: Install required cargo
42
+ run: cargo install clippy-sarif sarif-fmt
43
+
44
+ - name: Run rust-clippy
45
+ run:
46
+ cargo clippy
47
+ --all-features
48
+ --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
49
+ continue-on-error: true
50
+
51
+ - name: Upload analysis results to GitHub
52
+ uses: github/codeql-action/upload-sarif@v3
53
+ with:
54
+ sarif_file: rust-clippy-results.sarif
55
+ wait-for-processing: true
@@ -44,6 +44,15 @@ version = "1.5.0"
44
44
  source = "registry+https://github.com/rust-lang/crates.io-index"
45
45
  checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8"
46
46
 
47
+ [[package]]
48
+ name = "bincode"
49
+ version = "1.3.3"
50
+ source = "registry+https://github.com/rust-lang/crates.io-index"
51
+ checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
52
+ dependencies = [
53
+ "serde",
54
+ ]
55
+
47
56
  [[package]]
48
57
  name = "bitflags"
49
58
  version = "2.10.0"
@@ -108,10 +117,24 @@ dependencies = [
108
117
  "iana-time-zone",
109
118
  "js-sys",
110
119
  "num-traits",
120
+ "serde",
111
121
  "wasm-bindgen",
112
122
  "windows-link",
113
123
  ]
114
124
 
125
+ [[package]]
126
+ name = "console"
127
+ version = "0.16.2"
128
+ source = "registry+https://github.com/rust-lang/crates.io-index"
129
+ checksum = "03e45a4a8926227e4197636ba97a9fc9b00477e9f4bd711395687c5f0734bec4"
130
+ dependencies = [
131
+ "encode_unicode",
132
+ "libc",
133
+ "once_cell",
134
+ "unicode-width",
135
+ "windows-sys 0.61.2",
136
+ ]
137
+
115
138
  [[package]]
116
139
  name = "constant_time_eq"
117
140
  version = "0.3.1"
@@ -124,6 +147,15 @@ version = "0.8.7"
124
147
  source = "registry+https://github.com/rust-lang/crates.io-index"
125
148
  checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b"
126
149
 
150
+ [[package]]
151
+ name = "crossbeam-channel"
152
+ version = "0.5.15"
153
+ source = "registry+https://github.com/rust-lang/crates.io-index"
154
+ checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2"
155
+ dependencies = [
156
+ "crossbeam-utils",
157
+ ]
158
+
127
159
  [[package]]
128
160
  name = "crossbeam-deque"
129
161
  version = "0.8.6"
@@ -149,6 +181,26 @@ version = "0.8.21"
149
181
  source = "registry+https://github.com/rust-lang/crates.io-index"
150
182
  checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
151
183
 
184
+ [[package]]
185
+ name = "dashmap"
186
+ version = "6.1.0"
187
+ source = "registry+https://github.com/rust-lang/crates.io-index"
188
+ checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf"
189
+ dependencies = [
190
+ "cfg-if",
191
+ "crossbeam-utils",
192
+ "hashbrown",
193
+ "lock_api",
194
+ "once_cell",
195
+ "parking_lot_core",
196
+ ]
197
+
198
+ [[package]]
199
+ name = "encode_unicode"
200
+ version = "1.0.0"
201
+ source = "registry+https://github.com/rust-lang/crates.io-index"
202
+ checksum = "34aa73646ffb006b8f5147f3dc182bd4bcb190227ce861fc4a4844bf8e3cb2c0"
203
+
152
204
  [[package]]
153
205
  name = "errno"
154
206
  version = "0.3.14"
@@ -159,6 +211,12 @@ dependencies = [
159
211
  "windows-sys 0.61.2",
160
212
  ]
161
213
 
214
+ [[package]]
215
+ name = "fastcdc"
216
+ version = "3.2.1"
217
+ source = "registry+https://github.com/rust-lang/crates.io-index"
218
+ checksum = "bf51ceb43e96afbfe4dd5c6f6082af5dfd60e220820b8123792d61963f2ce6bc"
219
+
162
220
  [[package]]
163
221
  name = "filetime"
164
222
  version = "0.2.26"
@@ -202,6 +260,12 @@ dependencies = [
202
260
  "regex-syntax",
203
261
  ]
204
262
 
263
+ [[package]]
264
+ name = "hashbrown"
265
+ version = "0.14.5"
266
+ source = "registry+https://github.com/rust-lang/crates.io-index"
267
+ checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1"
268
+
205
269
  [[package]]
206
270
  name = "heck"
207
271
  version = "0.5.0"
@@ -254,6 +318,19 @@ dependencies = [
254
318
  "winapi-util",
255
319
  ]
256
320
 
321
+ [[package]]
322
+ name = "indicatif"
323
+ version = "0.18.3"
324
+ source = "registry+https://github.com/rust-lang/crates.io-index"
325
+ checksum = "9375e112e4b463ec1b1c6c011953545c65a30164fbab5b581df32b3abf0dcb88"
326
+ dependencies = [
327
+ "console",
328
+ "portable-atomic",
329
+ "unicode-width",
330
+ "unit-prefix",
331
+ "web-time",
332
+ ]
333
+
257
334
  [[package]]
258
335
  name = "indoc"
259
336
  version = "2.0.7"
@@ -303,7 +380,7 @@ checksum = "3d0b95e02c851351f877147b7deea7b1afb1df71b63aa5f8270716e0c5720616"
303
380
  dependencies = [
304
381
  "bitflags",
305
382
  "libc",
306
- "redox_syscall",
383
+ "redox_syscall 0.7.0",
307
384
  ]
308
385
 
309
386
  [[package]]
@@ -312,6 +389,15 @@ version = "0.11.0"
312
389
  source = "registry+https://github.com/rust-lang/crates.io-index"
313
390
  checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039"
314
391
 
392
+ [[package]]
393
+ name = "lock_api"
394
+ version = "0.4.14"
395
+ source = "registry+https://github.com/rust-lang/crates.io-index"
396
+ checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965"
397
+ dependencies = [
398
+ "scopeguard",
399
+ ]
400
+
315
401
  [[package]]
316
402
  name = "log"
317
403
  version = "0.4.29"
@@ -357,6 +443,19 @@ version = "1.21.3"
357
443
  source = "registry+https://github.com/rust-lang/crates.io-index"
358
444
  checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
359
445
 
446
+ [[package]]
447
+ name = "parking_lot_core"
448
+ version = "0.9.12"
449
+ source = "registry+https://github.com/rust-lang/crates.io-index"
450
+ checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1"
451
+ dependencies = [
452
+ "cfg-if",
453
+ "libc",
454
+ "redox_syscall 0.5.18",
455
+ "smallvec",
456
+ "windows-link",
457
+ ]
458
+
360
459
  [[package]]
361
460
  name = "pkg-config"
362
461
  version = "0.3.32"
@@ -441,15 +540,21 @@ dependencies = [
441
540
 
442
541
  [[package]]
443
542
  name = "pyvegh"
444
- version = "0.6.0"
543
+ version = "0.7.0"
445
544
  dependencies = [
446
545
  "anyhow",
546
+ "bincode",
447
547
  "blake3",
448
548
  "chrono",
549
+ "crossbeam-channel",
550
+ "dashmap",
551
+ "fastcdc",
449
552
  "hex",
450
553
  "ignore",
554
+ "indicatif",
451
555
  "memmap2",
452
556
  "pyo3",
557
+ "redb",
453
558
  "serde",
454
559
  "serde_json",
455
560
  "tar",
@@ -481,6 +586,24 @@ dependencies = [
481
586
  "crossbeam-utils",
482
587
  ]
483
588
 
589
+ [[package]]
590
+ name = "redb"
591
+ version = "3.1.0"
592
+ source = "registry+https://github.com/rust-lang/crates.io-index"
593
+ checksum = "ae323eb086579a3769daa2c753bb96deb95993c534711e0dbe881b5192906a06"
594
+ dependencies = [
595
+ "libc",
596
+ ]
597
+
598
+ [[package]]
599
+ name = "redox_syscall"
600
+ version = "0.5.18"
601
+ source = "registry+https://github.com/rust-lang/crates.io-index"
602
+ checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d"
603
+ dependencies = [
604
+ "bitflags",
605
+ ]
606
+
484
607
  [[package]]
485
608
  name = "redox_syscall"
486
609
  version = "0.7.0"
@@ -535,6 +658,12 @@ dependencies = [
535
658
  "winapi-util",
536
659
  ]
537
660
 
661
+ [[package]]
662
+ name = "scopeguard"
663
+ version = "1.2.0"
664
+ source = "registry+https://github.com/rust-lang/crates.io-index"
665
+ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
666
+
538
667
  [[package]]
539
668
  name = "serde"
540
669
  version = "1.0.228"
@@ -584,6 +713,12 @@ version = "1.3.0"
584
713
  source = "registry+https://github.com/rust-lang/crates.io-index"
585
714
  checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
586
715
 
716
+ [[package]]
717
+ name = "smallvec"
718
+ version = "1.15.1"
719
+ source = "registry+https://github.com/rust-lang/crates.io-index"
720
+ checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03"
721
+
587
722
  [[package]]
588
723
  name = "syn"
589
724
  version = "2.0.114"
@@ -618,12 +753,24 @@ version = "1.0.22"
618
753
  source = "registry+https://github.com/rust-lang/crates.io-index"
619
754
  checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5"
620
755
 
756
+ [[package]]
757
+ name = "unicode-width"
758
+ version = "0.2.2"
759
+ source = "registry+https://github.com/rust-lang/crates.io-index"
760
+ checksum = "b4ac048d71ede7ee76d585517add45da530660ef4390e49b098733c6e897f254"
761
+
621
762
  [[package]]
622
763
  name = "unindent"
623
764
  version = "0.2.4"
624
765
  source = "registry+https://github.com/rust-lang/crates.io-index"
625
766
  checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3"
626
767
 
768
+ [[package]]
769
+ name = "unit-prefix"
770
+ version = "0.5.2"
771
+ source = "registry+https://github.com/rust-lang/crates.io-index"
772
+ checksum = "81e544489bf3d8ef66c953931f56617f423cd4b5494be343d9b9d3dda037b9a3"
773
+
627
774
  [[package]]
628
775
  name = "walkdir"
629
776
  version = "2.5.0"
@@ -688,6 +835,16 @@ dependencies = [
688
835
  "unicode-ident",
689
836
  ]
690
837
 
838
+ [[package]]
839
+ name = "web-time"
840
+ version = "1.1.0"
841
+ source = "registry+https://github.com/rust-lang/crates.io-index"
842
+ checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
843
+ dependencies = [
844
+ "js-sys",
845
+ "wasm-bindgen",
846
+ ]
847
+
691
848
  [[package]]
692
849
  name = "winapi-util"
693
850
  version = "0.1.11"
@@ -0,0 +1,37 @@
1
+ [package]
2
+ name = "pyvegh"
3
+ version = "0.7.0"
4
+ edition = "2024"
5
+ authors = ["CodeTease"]
6
+ readme = "README.md"
7
+
8
+ [lib]
9
+ name = "pyvegh_core"
10
+ crate-type = ["cdylib"]
11
+
12
+ [dependencies]
13
+ pyo3 = { version = "0.27", features = ["extension-module", "abi3-py310"] }
14
+
15
+ # Core Logic Deps (Synced from Vegh 0.4.0)
16
+ tar = "0.4"
17
+ zstd = { version = "0.13", features = ["zstdmt"] }
18
+ ignore = "0.4"
19
+
20
+ # Hashing & CDC
21
+ blake3 = { version = "1.8", features = ["rayon", "mmap"] }
22
+ hex = "0.4"
23
+ memmap2 = "0.9"
24
+ fastcdc = "3.2.1" # Added for CDC support
25
+
26
+ # Storage & Cache
27
+ redb = "3.1.0" # Migrated from JSON cache to Embedded DB
28
+ bincode = "1.3" # Struct serialization
29
+ dashmap = "6.1.0" # Concurrent Map for Deduplication
30
+
31
+ # Utilities
32
+ anyhow = "1.0"
33
+ serde = { version = "1.0", features = ["derive"] }
34
+ serde_json = "1.0"
35
+ chrono = { version = "0.4", features = ["serde"] }
36
+ crossbeam-channel = "0.5" # Pipeline messaging
37
+ indicatif = "0.18"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyvegh
3
- Version: 0.6.0
3
+ Version: 0.7.0
4
4
  Classifier: Programming Language :: Python :: 3.10
5
5
  Classifier: Programming Language :: Python :: 3.11
6
6
  Classifier: Programming Language :: Python :: 3.12
@@ -4,7 +4,7 @@ build-backend = "maturin"
4
4
 
5
5
  [project]
6
6
  name = "pyvegh"
7
- version = "0.6.0"
7
+ version = "0.7.0"
8
8
  description = "Python bindings for Vegh - The Snapshot Tool."
9
9
  authors = [{name = "CodeTease"}]
10
10
  readme = "README.md"
@@ -11,7 +11,7 @@ from ._core import (
11
11
  scan_locs_dir,
12
12
  )
13
13
 
14
- __version__ = "0.6.0"
14
+ __version__ = "0.7.0"
15
15
  __all__ = [
16
16
  "create_snap",
17
17
  "dry_run_snap",
@@ -629,6 +629,7 @@ def snap(
629
629
  ),
630
630
  dry_run: bool = typer.Option(False, "--dry-run", help="Simulate only"),
631
631
  skip_hooks: bool = typer.Option(False, "--skip-hooks", help="Bypass hooks"),
632
+ quiet: bool = typer.Option(False, "--quiet", "-q", help="Use minimal output (hides progress bar)"),
632
633
  ):
633
634
  """Create a snapshot (.vegh) from local folder OR remote repo."""
634
635
 
@@ -682,14 +683,36 @@ def snap(
682
683
  )
683
684
  start = time.time()
684
685
 
685
- with console.status("[bold cyan]Compressing...[/bold cyan]", spinner="dots"):
686
- try:
686
+ # LOGIC UPDATE: Switch between Rust UI (default) and Python Spinner (quiet)
687
+ try:
688
+ if not quiet:
689
+ # Default: Let Rust handle the UI with indicatif (No Python spinner to interfere)
687
690
  count = create_snap(
688
- str(source_path), str(output_path), level, comment, include, exclude
691
+ str(source_path),
692
+ str(output_path),
693
+ level,
694
+ comment,
695
+ include,
696
+ exclude,
697
+ no_cache=offline,
698
+ verbose=True, # Enable Rust Progress Bar
689
699
  )
690
- except Exception as e:
691
- console.print(f"[red]Error:[/red] {e}")
692
- raise typer.Exit(1)
700
+ else:
701
+ # Quiet Mode: Use Python spinner for minimal feedback, suppress Rust UI
702
+ with console.status("[bold cyan]Compressing (Quiet)...[/bold cyan]", spinner="dots"):
703
+ count = create_snap(
704
+ str(source_path),
705
+ str(output_path),
706
+ level,
707
+ comment,
708
+ include,
709
+ exclude,
710
+ no_cache=offline,
711
+ verbose=False, # Silence Rust
712
+ )
713
+ except Exception as e:
714
+ console.print(f"[red]Error:[/red] {e}")
715
+ raise typer.Exit(1)
693
716
 
694
717
  dur = time.time() - start
695
718
  size = output_path.stat().st_size
@@ -712,7 +735,6 @@ def snap(
712
735
  if not execute_hooks(hooks.get("post"), "post"):
713
736
  console.print("[yellow][WARN] Post-snap hooks error.[/yellow]")
714
737
 
715
-
716
738
  @app.command()
717
739
  def restore(
718
740
  file: Path = typer.Argument(..., help=".vegh file"),
@@ -1369,10 +1391,23 @@ def loc(
1369
1391
  cnt = calculate_sloc(str(scan_path))
1370
1392
  results = [(scan_path.name, cnt)]
1371
1393
  else:
1372
- if scan_path.is_dir():
1394
+ if scan_path.is_file():
1395
+ # FIX: Handle single file logic separately
1396
+ # Rust's count_locs expects a .vegh snapshot
1397
+ if scan_path.suffix == ".vegh":
1398
+ results = count_locs(str(scan_path))
1399
+ else:
1400
+ # Plain text file counting in Python
1401
+ try:
1402
+ with open(scan_path, "r", encoding="utf-8", errors="ignore") as f:
1403
+ cnt = sum(1 for _ in f)
1404
+ results = [(scan_path.name, cnt)]
1405
+ except Exception:
1406
+ results = [(scan_path.name, 0)]
1407
+ elif scan_path.is_dir():
1373
1408
  results = scan_locs_dir(str(scan_path))
1374
1409
  else:
1375
- results = count_locs(str(scan_path))
1410
+ results = [] # Should not happen
1376
1411
 
1377
1412
  if render_dashboard and not raw:
1378
1413
  render_dashboard(console, display_name, results, metric_name=metric_name)