greenmining 1.2.0__py3-none-any.whl → 1.2.1__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 +14 -7
- {greenmining-1.2.0.dist-info → greenmining-1.2.1.dist-info}/METADATA +1 -1
- {greenmining-1.2.0.dist-info → greenmining-1.2.1.dist-info}/RECORD +7 -7
- {greenmining-1.2.0.dist-info → greenmining-1.2.1.dist-info}/WHEEL +0 -0
- {greenmining-1.2.0.dist-info → greenmining-1.2.1.dist-info}/licenses/LICENSE +0 -0
- {greenmining-1.2.0.dist-info → greenmining-1.2.1.dist-info}/top_level.txt +0 -0
greenmining/__init__.py
CHANGED
|
@@ -460,12 +460,18 @@ class LocalRepoAnalyzer:
|
|
|
460
460
|
if self.to_date:
|
|
461
461
|
repo_config["to"] = self.to_date
|
|
462
462
|
|
|
463
|
-
#
|
|
464
|
-
|
|
463
|
+
# Use owner_repo format for unique directory names (avoids collisions
|
|
464
|
+
# when multiple repos share the same name, e.g. open-android/Android
|
|
465
|
+
# vs hmkcode/Android vs duckduckgo/Android).
|
|
466
|
+
safe_name = re.sub(r"[^a-z0-9_-]", "_", f"{owner}_{repo_name}".lower())
|
|
467
|
+
clone_parent = self.clone_path / safe_name
|
|
468
|
+
clone_parent.mkdir(parents=True, exist_ok=True)
|
|
469
|
+
local_path = clone_parent / repo_name
|
|
470
|
+
|
|
465
471
|
if local_path.exists():
|
|
466
472
|
shutil.rmtree(local_path)
|
|
467
473
|
|
|
468
|
-
repo_config["clone_repo_to"] = str(
|
|
474
|
+
repo_config["clone_repo_to"] = str(clone_parent)
|
|
469
475
|
|
|
470
476
|
colored_print(f" Cloning to: {local_path}", "cyan")
|
|
471
477
|
|
|
@@ -540,10 +546,11 @@ class LocalRepoAnalyzer:
|
|
|
540
546
|
return result
|
|
541
547
|
|
|
542
548
|
finally:
|
|
543
|
-
# Cleanup if requested
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
549
|
+
# Cleanup if requested (remove the unique parent dir to avoid
|
|
550
|
+
# accumulating empty owner_repo directories)
|
|
551
|
+
if self.cleanup_after and clone_parent.exists():
|
|
552
|
+
colored_print(f" Cleaning up: {clone_parent}", "cyan")
|
|
553
|
+
shutil.rmtree(clone_parent, ignore_errors=True)
|
|
547
554
|
|
|
548
555
|
def _compute_process_metrics(self, repo_path: str) -> Dict[str, Any]:
|
|
549
556
|
# Compute PyDriller process metrics for the repository.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
greenmining/__init__.py,sha256=
|
|
1
|
+
greenmining/__init__.py,sha256=W-CMUfo3U7pWBGAKtwT5XwjcMxbKjF5c42ViFFsOBS4,4096
|
|
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=ZklXdEAc60KeFL83zRYMwW_-2OwMKpfPY7Wrifl0D50,11539
|
|
28
|
-
greenmining/services/local_repo_analyzer.py,sha256=
|
|
28
|
+
greenmining/services/local_repo_analyzer.py,sha256=kdqN9O7GlmOs1_H1iNni1HEcCzF9bBCPeP3wMStGe5Q,25306
|
|
29
29
|
greenmining/services/reports.py,sha256=nhJuYiA5tPD_9AjtgSLEnrpW3x15sZXrwIxpxQEBbh0,23219
|
|
30
|
-
greenmining-1.2.
|
|
31
|
-
greenmining-1.2.
|
|
32
|
-
greenmining-1.2.
|
|
33
|
-
greenmining-1.2.
|
|
34
|
-
greenmining-1.2.
|
|
30
|
+
greenmining-1.2.1.dist-info/licenses/LICENSE,sha256=M7ma3JHGeiIZIs3ea0HTcFl_wLFPX2NZElUliYs4bCA,1083
|
|
31
|
+
greenmining-1.2.1.dist-info/METADATA,sha256=ZmLnx5P5jN8XpRGgfx_gVzykWvUZdsHrTEpg3Plh9-A,10522
|
|
32
|
+
greenmining-1.2.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
33
|
+
greenmining-1.2.1.dist-info/top_level.txt,sha256=nreXgXxZIWI-42yQknQ0HXtUrFnzZ8N1ra4Mdy2KcsI,12
|
|
34
|
+
greenmining-1.2.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|