greenmining 1.2.7__py3-none-any.whl → 1.2.9__py3-none-any.whl
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.
- greenmining/__init__.py +1 -1
- greenmining/services/local_repo_analyzer.py +27 -27
- {greenmining-1.2.7.dist-info → greenmining-1.2.9.dist-info}/METADATA +1 -1
- {greenmining-1.2.7.dist-info → greenmining-1.2.9.dist-info}/RECORD +7 -7
- {greenmining-1.2.7.dist-info → greenmining-1.2.9.dist-info}/WHEEL +0 -0
- {greenmining-1.2.7.dist-info → greenmining-1.2.9.dist-info}/licenses/LICENSE +0 -0
- {greenmining-1.2.7.dist-info → greenmining-1.2.9.dist-info}/top_level.txt +0 -0
greenmining/__init__.py
CHANGED
|
@@ -480,7 +480,7 @@ class LocalRepoAnalyzer:
|
|
|
480
480
|
clone_parent.mkdir(parents=True, exist_ok=True)
|
|
481
481
|
local_path = clone_parent / repo_name
|
|
482
482
|
|
|
483
|
-
# Perform shallow clone manually
|
|
483
|
+
# Perform shallow clone manually, then unshallow for full history
|
|
484
484
|
if not local_path.exists():
|
|
485
485
|
import subprocess
|
|
486
486
|
|
|
@@ -500,14 +500,36 @@ class LocalRepoAnalyzer:
|
|
|
500
500
|
capture_output=True,
|
|
501
501
|
text=True,
|
|
502
502
|
check=True,
|
|
503
|
-
timeout=
|
|
503
|
+
timeout=300,
|
|
504
504
|
)
|
|
505
505
|
except subprocess.TimeoutExpired:
|
|
506
|
-
colored_print(" Clone timeout after
|
|
506
|
+
colored_print(" Clone timeout after 300s", "yellow")
|
|
507
507
|
raise
|
|
508
508
|
except subprocess.CalledProcessError as e:
|
|
509
509
|
colored_print(f" Clone failed: {e.stderr}", "red")
|
|
510
510
|
raise
|
|
511
|
+
|
|
512
|
+
# Immediately unshallow to get full history for accurate analysis
|
|
513
|
+
# This is still faster than a full clone: shallow clone negotiates
|
|
514
|
+
# objects quickly, then unshallow fetches the remainder incrementally
|
|
515
|
+
if self.shallow_clone:
|
|
516
|
+
colored_print(" Fetching full history...", "cyan")
|
|
517
|
+
try:
|
|
518
|
+
subprocess.run(
|
|
519
|
+
["git", "fetch", "--unshallow"],
|
|
520
|
+
cwd=str(local_path),
|
|
521
|
+
capture_output=True,
|
|
522
|
+
text=True,
|
|
523
|
+
check=True,
|
|
524
|
+
timeout=300,
|
|
525
|
+
)
|
|
526
|
+
except subprocess.CalledProcessError:
|
|
527
|
+
pass # Already unshallowed or not shallow
|
|
528
|
+
except subprocess.TimeoutExpired:
|
|
529
|
+
colored_print(
|
|
530
|
+
" Warning: Full history fetch timed out, some metrics may be incomplete",
|
|
531
|
+
"yellow",
|
|
532
|
+
)
|
|
511
533
|
else:
|
|
512
534
|
colored_print(f" Using existing clone: {local_path}", "cyan")
|
|
513
535
|
|
|
@@ -557,32 +579,10 @@ class LocalRepoAnalyzer:
|
|
|
557
579
|
except Exception:
|
|
558
580
|
pass
|
|
559
581
|
|
|
560
|
-
# Compute process metrics if enabled
|
|
582
|
+
# Compute process metrics if enabled (full history already available
|
|
583
|
+
# from the unshallow step that runs right after cloning)
|
|
561
584
|
process_metrics = {}
|
|
562
585
|
if self.compute_process_metrics and local_path.exists():
|
|
563
|
-
# Unshallow the repo before process metrics — they need full history
|
|
564
|
-
# for metrics like CommitsCount, ContributorsExperience, HistoryComplexity
|
|
565
|
-
if self.shallow_clone:
|
|
566
|
-
colored_print(" Deepening clone for process metrics...", "cyan")
|
|
567
|
-
try:
|
|
568
|
-
import subprocess
|
|
569
|
-
|
|
570
|
-
subprocess.run(
|
|
571
|
-
["git", "fetch", "--unshallow"],
|
|
572
|
-
cwd=str(local_path),
|
|
573
|
-
capture_output=True,
|
|
574
|
-
text=True,
|
|
575
|
-
check=True,
|
|
576
|
-
timeout=120,
|
|
577
|
-
)
|
|
578
|
-
except subprocess.CalledProcessError:
|
|
579
|
-
# Already unshallowed or not a shallow repo — safe to ignore
|
|
580
|
-
pass
|
|
581
|
-
except subprocess.TimeoutExpired:
|
|
582
|
-
colored_print(
|
|
583
|
-
" Warning: Unshallow timed out, process metrics may be incomplete",
|
|
584
|
-
"yellow",
|
|
585
|
-
)
|
|
586
586
|
colored_print(" Computing process metrics...", "cyan")
|
|
587
587
|
process_metrics = self._compute_process_metrics(str(local_path))
|
|
588
588
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
greenmining/__init__.py,sha256=
|
|
1
|
+
greenmining/__init__.py,sha256=UC0D_OFqk13R3NhFHuND0rhbgv7pglPtoVeG5Ic7dhE,4789
|
|
2
2
|
greenmining/__main__.py,sha256=NYOVS7D4w2XDLn6SyXHXPKE5GrNGOeoWSTb_KazgK5c,590
|
|
3
3
|
greenmining/gsf_patterns.py,sha256=UvNJPY3HlAx1SicwUqci40TlLg8lCL0tszSOH4haxQs,55921
|
|
4
4
|
greenmining/utils.py,sha256=-dnLUw9taCzvQ2dk6uc66GAohOFiXJFKs9TLSEPk5kM,2893
|
|
@@ -25,10 +25,10 @@ greenmining/services/commit_extractor.py,sha256=qBM9QpGzPZRmGMFufJ6gP8eWIuufTowL
|
|
|
25
25
|
greenmining/services/data_aggregator.py,sha256=BU_HUb-8c0n0sa_7VZRB8jIVnaVhRLf-E6KA4ASh-08,19427
|
|
26
26
|
greenmining/services/data_analyzer.py,sha256=0XqW-slrnt7RotrHDweOqKtoN8XIA7y6p7s2Jau6cMg,7431
|
|
27
27
|
greenmining/services/github_graphql_fetcher.py,sha256=WhSbQGMdkb0D4uLcMKW6xZK77c5AkW-nZf718issap4,11527
|
|
28
|
-
greenmining/services/local_repo_analyzer.py,sha256=
|
|
28
|
+
greenmining/services/local_repo_analyzer.py,sha256=n-znklcb0MeN6nGha7pD6PCt7Z8SpN1rcIKthTFrt70,28634
|
|
29
29
|
greenmining/services/reports.py,sha256=QCJZhET3hRkH83htxLkbEP58dE3-7jIZh82Pp60hQcc,23218
|
|
30
|
-
greenmining-1.2.
|
|
31
|
-
greenmining-1.2.
|
|
32
|
-
greenmining-1.2.
|
|
33
|
-
greenmining-1.2.
|
|
34
|
-
greenmining-1.2.
|
|
30
|
+
greenmining-1.2.9.dist-info/licenses/LICENSE,sha256=M7ma3JHGeiIZIs3ea0HTcFl_wLFPX2NZElUliYs4bCA,1083
|
|
31
|
+
greenmining-1.2.9.dist-info/METADATA,sha256=eUVdF19HE6XMcGZUO3oIUSwTUYw-eHo1OzF5sZjj9X8,10522
|
|
32
|
+
greenmining-1.2.9.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
33
|
+
greenmining-1.2.9.dist-info/top_level.txt,sha256=nreXgXxZIWI-42yQknQ0HXtUrFnzZ8N1ra4Mdy2KcsI,12
|
|
34
|
+
greenmining-1.2.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|