greenmining 1.2.7__tar.gz → 1.2.8__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.
Files changed (42) hide show
  1. {greenmining-1.2.7/greenmining.egg-info → greenmining-1.2.8}/PKG-INFO +1 -1
  2. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/__init__.py +1 -1
  3. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/services/local_repo_analyzer.py +27 -27
  4. {greenmining-1.2.7 → greenmining-1.2.8/greenmining.egg-info}/PKG-INFO +1 -1
  5. {greenmining-1.2.7 → greenmining-1.2.8}/pyproject.toml +1 -1
  6. {greenmining-1.2.7 → greenmining-1.2.8}/CHANGELOG.md +0 -0
  7. {greenmining-1.2.7 → greenmining-1.2.8}/LICENSE +0 -0
  8. {greenmining-1.2.7 → greenmining-1.2.8}/MANIFEST.in +0 -0
  9. {greenmining-1.2.7 → greenmining-1.2.8}/README.md +0 -0
  10. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/__main__.py +0 -0
  11. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/analyzers/__init__.py +0 -0
  12. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/analyzers/code_diff_analyzer.py +0 -0
  13. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/analyzers/metrics_power_correlator.py +0 -0
  14. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/analyzers/statistical_analyzer.py +0 -0
  15. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/analyzers/temporal_analyzer.py +0 -0
  16. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/controllers/__init__.py +0 -0
  17. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/controllers/repository_controller.py +0 -0
  18. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/energy/__init__.py +0 -0
  19. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/energy/base.py +0 -0
  20. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/energy/carbon_reporter.py +0 -0
  21. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/energy/codecarbon_meter.py +0 -0
  22. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/energy/cpu_meter.py +0 -0
  23. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/energy/rapl.py +0 -0
  24. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/gsf_patterns.py +0 -0
  25. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/models/__init__.py +0 -0
  26. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/models/aggregated_stats.py +0 -0
  27. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/models/analysis_result.py +0 -0
  28. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/models/commit.py +0 -0
  29. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/models/repository.py +0 -0
  30. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/services/__init__.py +0 -0
  31. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/services/commit_extractor.py +0 -0
  32. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/services/data_aggregator.py +0 -0
  33. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/services/data_analyzer.py +0 -0
  34. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/services/github_graphql_fetcher.py +0 -0
  35. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/services/reports.py +0 -0
  36. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining/utils.py +0 -0
  37. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining.egg-info/SOURCES.txt +0 -0
  38. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining.egg-info/dependency_links.txt +0 -0
  39. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining.egg-info/requires.txt +0 -0
  40. {greenmining-1.2.7 → greenmining-1.2.8}/greenmining.egg-info/top_level.txt +0 -0
  41. {greenmining-1.2.7 → greenmining-1.2.8}/setup.cfg +0 -0
  42. {greenmining-1.2.7 → greenmining-1.2.8}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: greenmining
3
- Version: 1.2.7
3
+ Version: 1.2.8
4
4
  Summary: An empirical Python library for Mining Software Repositories (MSR) in Green IT research
5
5
  Author-email: Adam Bouafia <a.bouafia@student.vu.nl>
6
6
  License: MIT
@@ -8,7 +8,7 @@ from greenmining.gsf_patterns import (
8
8
  is_green_aware,
9
9
  )
10
10
 
11
- __version__ = "1.2.7"
11
+ __version__ = "1.2.8"
12
12
 
13
13
 
14
14
  def fetch_repositories(
@@ -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 before PyDriller (much faster!)
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=180,
503
+ timeout=300,
504
504
  )
505
505
  except subprocess.TimeoutExpired:
506
- colored_print(" Clone timeout after 180s", "yellow")
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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: greenmining
3
- Version: 1.2.7
3
+ Version: 1.2.8
4
4
  Summary: An empirical Python library for Mining Software Repositories (MSR) in Green IT research
5
5
  Author-email: Adam Bouafia <a.bouafia@student.vu.nl>
6
6
  License: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "greenmining"
7
- version = "1.2.7"
7
+ version = "1.2.8"
8
8
  description = "An empirical Python library for Mining Software Repositories (MSR) in Green IT research"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes