greenmining 1.0.1__tar.gz → 1.0.2__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 (45) hide show
  1. {greenmining-1.0.1/greenmining.egg-info → greenmining-1.0.2}/PKG-INFO +1 -1
  2. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/__version__.py +1 -1
  3. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/services/commit_extractor.py +12 -8
  4. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/services/data_aggregator.py +8 -2
  5. {greenmining-1.0.1 → greenmining-1.0.2/greenmining.egg-info}/PKG-INFO +1 -1
  6. {greenmining-1.0.1 → greenmining-1.0.2}/pyproject.toml +1 -1
  7. {greenmining-1.0.1 → greenmining-1.0.2}/CHANGELOG.md +0 -0
  8. {greenmining-1.0.1 → greenmining-1.0.2}/LICENSE +0 -0
  9. {greenmining-1.0.1 → greenmining-1.0.2}/MANIFEST.in +0 -0
  10. {greenmining-1.0.1 → greenmining-1.0.2}/README.md +0 -0
  11. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/__init__.py +0 -0
  12. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/__main__.py +0 -0
  13. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/analyzers/__init__.py +0 -0
  14. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/analyzers/code_diff_analyzer.py +0 -0
  15. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/analyzers/ml_feature_extractor.py +0 -0
  16. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/analyzers/nlp_analyzer.py +0 -0
  17. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/analyzers/qualitative_analyzer.py +0 -0
  18. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/analyzers/statistical_analyzer.py +0 -0
  19. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/analyzers/temporal_analyzer.py +0 -0
  20. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/cli.py +0 -0
  21. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/config.py +0 -0
  22. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/controllers/__init__.py +0 -0
  23. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/controllers/repository_controller.py +0 -0
  24. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/gsf_patterns.py +0 -0
  25. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/main.py +0 -0
  26. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/models/__init__.py +0 -0
  27. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/models/aggregated_stats.py +0 -0
  28. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/models/analysis_result.py +0 -0
  29. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/models/commit.py +0 -0
  30. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/models/repository.py +0 -0
  31. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/presenters/__init__.py +0 -0
  32. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/presenters/console_presenter.py +0 -0
  33. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/services/__init__.py +0 -0
  34. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/services/data_analyzer.py +0 -0
  35. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/services/github_fetcher.py +0 -0
  36. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/services/reports.py +0 -0
  37. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining/utils.py +0 -0
  38. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining.egg-info/SOURCES.txt +0 -0
  39. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining.egg-info/dependency_links.txt +0 -0
  40. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining.egg-info/entry_points.txt +0 -0
  41. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining.egg-info/requires.txt +0 -0
  42. {greenmining-1.0.1 → greenmining-1.0.2}/greenmining.egg-info/top_level.txt +0 -0
  43. {greenmining-1.0.1 → greenmining-1.0.2}/pytest.ini +0 -0
  44. {greenmining-1.0.1 → greenmining-1.0.2}/setup.cfg +0 -0
  45. {greenmining-1.0.1 → greenmining-1.0.2}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: greenmining
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Analyze GitHub repositories to identify green software engineering patterns and energy-efficient practices
5
5
  Author-email: Adam Bouafia <a.bouafia@student.vu.nl>
6
6
  License: MIT
@@ -1,3 +1,3 @@
1
1
  """Version information for greenmining."""
2
2
 
3
- __version__ = "1.0.1"
3
+ __version__ = "1.0.2"
@@ -12,6 +12,7 @@ from github import Github
12
12
  from tqdm import tqdm
13
13
 
14
14
  from greenmining.config import get_config
15
+ from greenmining.models.repository import Repository
15
16
  from greenmining.utils import (
16
17
  colored_print,
17
18
  format_timestamp,
@@ -49,11 +50,11 @@ class CommitExtractor:
49
50
  self.github = Github(github_token) if github_token else None
50
51
  self.timeout = timeout
51
52
 
52
- def extract_from_repositories(self, repositories: list[dict[str, Any]]) -> list[dict[str, Any]]:
53
+ def extract_from_repositories(self, repositories: list[dict[str, Any] | Repository]) -> list[dict[str, Any]]:
53
54
  """Extract commits from list of repositories.
54
55
 
55
56
  Args:
56
- repositories: List of repository metadata
57
+ repositories: List of repository metadata (dicts or Repository objects)
57
58
 
58
59
  Returns:
59
60
  List of commit data dictionaries
@@ -89,15 +90,17 @@ class CommitExtractor:
89
90
  pbar.update(1)
90
91
  except TimeoutError:
91
92
  signal.alarm(0) # Cancel alarm
93
+ repo_name = repo.full_name if isinstance(repo, Repository) else repo["full_name"]
92
94
  colored_print(
93
- f"\nTimeout processing {repo['full_name']} (>{self.timeout}s)", "yellow"
95
+ f"\nTimeout processing {repo_name} (>{self.timeout}s)", "yellow"
94
96
  )
95
- failed_repos.append(repo["full_name"])
97
+ failed_repos.append(repo_name)
96
98
  pbar.update(1)
97
99
  except Exception as e:
98
100
  signal.alarm(0) # Cancel alarm
99
- colored_print(f"\nError processing {repo['full_name']}: {e}", "yellow")
100
- failed_repos.append(repo["full_name"])
101
+ repo_name = repo.full_name if isinstance(repo, Repository) else repo["full_name"]
102
+ colored_print(f"\nError processing {repo_name}: {e}", "yellow")
103
+ failed_repos.append(repo_name)
101
104
  pbar.update(1)
102
105
 
103
106
  if failed_repos:
@@ -114,13 +117,14 @@ class CommitExtractor:
114
117
  """Extract commits from a single repository using GitHub API.
115
118
 
116
119
  Args:
117
- repo: Repository metadata dictionary
120
+ repo: Repository metadata (dict or Repository object)
118
121
 
119
122
  Returns:
120
123
  List of commit dictionaries
121
124
  """
122
125
  commits = []
123
- repo_name = repo["full_name"]
126
+ # Handle both Repository objects and dicts
127
+ repo_name = repo.full_name if isinstance(repo, Repository) else repo["full_name"]
124
128
 
125
129
  try:
126
130
  # Get repository from GitHub API
@@ -16,6 +16,7 @@ from greenmining.analyzers import (
16
16
  QualitativeAnalyzer,
17
17
  )
18
18
  from greenmining.config import get_config
19
+ from greenmining.models.repository import Repository
19
20
  from greenmining.utils import (
20
21
  colored_print,
21
22
  format_number,
@@ -270,8 +271,13 @@ class DataAggregator:
270
271
  self, results: list[dict[str, Any]], repos: list[dict[str, Any]]
271
272
  ) -> list[dict[str, Any]]:
272
273
  """Generate per-language statistics."""
273
- # Create repo name to language mapping
274
- repo_language_map = {repo["full_name"]: repo.get("language", "Unknown") for repo in repos}
274
+ # Create repo name to language mapping (handle both Repository objects and dicts)
275
+ repo_language_map = {}
276
+ for repo in repos:
277
+ if isinstance(repo, Repository):
278
+ repo_language_map[repo.full_name] = repo.language or "Unknown"
279
+ else:
280
+ repo_language_map[repo["full_name"]] = repo.get("language", "Unknown")
275
281
 
276
282
  # Group commits by language
277
283
  language_commits = defaultdict(list)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: greenmining
3
- Version: 1.0.1
3
+ Version: 1.0.2
4
4
  Summary: Analyze GitHub repositories to identify green software engineering patterns and energy-efficient practices
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.0.1"
7
+ version = "1.0.2"
8
8
  description = "Analyze GitHub repositories to identify green software engineering patterns and energy-efficient practices"
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
File without changes