metripy 0.3.3__py3-none-any.whl → 0.3.5__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.
Potentially problematic release.
This version of metripy might be problematic. Click here for more details.
- metripy/Application/Config/File/ConfigFileReaderInterface.py +1 -1
- metripy/Application/Info.py +29 -4
- metripy/Report/Html/TrendsPageRenderer.py +23 -0
- {metripy-0.3.3.dist-info → metripy-0.3.5.dist-info}/METADATA +2 -2
- {metripy-0.3.3.dist-info → metripy-0.3.5.dist-info}/RECORD +9 -9
- {metripy-0.3.3.dist-info → metripy-0.3.5.dist-info}/WHEEL +0 -0
- {metripy-0.3.3.dist-info → metripy-0.3.5.dist-info}/entry_points.txt +0 -0
- {metripy-0.3.3.dist-info → metripy-0.3.5.dist-info}/licenses/LICENSE +0 -0
- {metripy-0.3.3.dist-info → metripy-0.3.5.dist-info}/top_level.txt +0 -0
metripy/Application/Info.py
CHANGED
|
@@ -1,17 +1,42 @@
|
|
|
1
|
+
from importlib.metadata import version, metadata
|
|
1
2
|
import toml
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
class Info:
|
|
5
6
|
def __init__(self):
|
|
6
|
-
|
|
7
|
-
self.
|
|
8
|
-
self.url = data["project"]["urls"]["Homepage"]
|
|
7
|
+
self.version = self._get_version()
|
|
8
|
+
self.url = self._get_homepage_url()
|
|
9
9
|
|
|
10
|
-
def
|
|
10
|
+
def _get_pyproject_data(self) -> dict:
|
|
11
11
|
with open("pyproject.toml", "r") as file:
|
|
12
12
|
data = toml.load(file)
|
|
13
13
|
return data
|
|
14
14
|
|
|
15
|
+
def _get_version(self) -> str:
|
|
16
|
+
"""Get version from installed package metadata"""
|
|
17
|
+
try:
|
|
18
|
+
return version("metripy")
|
|
19
|
+
except Exception:
|
|
20
|
+
# Fallback for development if not installed
|
|
21
|
+
return self._get_pyproject_data()["project"]["version"]
|
|
22
|
+
|
|
23
|
+
def _get_homepage_url(self) -> str:
|
|
24
|
+
"""Get homepage URL from installed package metadata"""
|
|
25
|
+
try:
|
|
26
|
+
meta = metadata("metripy")
|
|
27
|
+
# Try to get Home-Page from metadata
|
|
28
|
+
homepage = meta.get("Home-Page")
|
|
29
|
+
if not homepage:
|
|
30
|
+
# Try Project-URL field
|
|
31
|
+
for line in meta.get_all("Project-URL") or []:
|
|
32
|
+
if line.startswith("Homepage"):
|
|
33
|
+
homepage = line.split(",", 1)[1].strip()
|
|
34
|
+
break
|
|
35
|
+
return homepage or "no homepage found"
|
|
36
|
+
except Exception:
|
|
37
|
+
# Fallback
|
|
38
|
+
return self._get_pyproject_data()["project"]["urls"]["Homepage"]
|
|
39
|
+
|
|
15
40
|
def get_version(self) -> str:
|
|
16
41
|
return self.version
|
|
17
42
|
|
|
@@ -22,6 +22,29 @@ class TrendsPageRenderer(PageRenderer):
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
def render(self, metrics: ProjectMetrics):
|
|
25
|
+
if metrics.total_code_metrics.trend is None:
|
|
26
|
+
self.render_template(
|
|
27
|
+
"trends.html",
|
|
28
|
+
{
|
|
29
|
+
"has_trend_data": False,
|
|
30
|
+
"trend_data": {
|
|
31
|
+
"top_improved_complexity": [],
|
|
32
|
+
"top_improved_maintainability": [],
|
|
33
|
+
"top_worsened_complexity": [],
|
|
34
|
+
"top_worsened_maintainability": [],
|
|
35
|
+
"loc_segments_current": {},
|
|
36
|
+
"loc_segments_prev": {},
|
|
37
|
+
"complexity_segments_current": {},
|
|
38
|
+
"complexity_segments_prev": {},
|
|
39
|
+
"maintainability_segments_current": {},
|
|
40
|
+
"maintainability_segments_prev": {},
|
|
41
|
+
"method_size_segments_current": {},
|
|
42
|
+
"method_size_segments_prev": {},
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
)
|
|
46
|
+
return
|
|
47
|
+
|
|
25
48
|
# Top improved complexity (complexity went down - negative delta)
|
|
26
49
|
top_improved_complexity = [
|
|
27
50
|
x
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: metripy
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.5
|
|
4
4
|
Summary: A Python tool to generate multi project, multi language code metric reports
|
|
5
5
|
Author-email: Yannick Zimmermann <yannick.zimmermann@proton.me>
|
|
6
6
|
License: MIT
|
|
@@ -19,7 +19,7 @@ Description-Content-Type: text/markdown
|
|
|
19
19
|
License-File: LICENSE
|
|
20
20
|
Requires-Dist: lizard==1.18.0
|
|
21
21
|
Requires-Dist: GitPython==3.1.45
|
|
22
|
-
Requires-Dist: py-template-engine>=0.
|
|
22
|
+
Requires-Dist: py-template-engine>=0.2.6
|
|
23
23
|
Requires-Dist: radon==6.0.1
|
|
24
24
|
Requires-Dist: requests==2.32.5
|
|
25
25
|
Requires-Dist: packaging==25.0
|
|
@@ -2,7 +2,7 @@ metripy/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
2
2
|
metripy/metripy.py,sha256=Iiggyf5cMv3xoJyyec6MpqPLb0afYnPyOYY26oiq6ro,266
|
|
3
3
|
metripy/Application/Analyzer.py,sha256=anomekJMKve_lZEl69yeQEFYas_hTltTqEJmujg5VSo,4953
|
|
4
4
|
metripy/Application/Application.py,sha256=XaSLgZurNVv29KVsIF8Kqu9eI4LOvvDZ6CHgdkLoRwQ,2332
|
|
5
|
-
metripy/Application/Info.py,sha256=
|
|
5
|
+
metripy/Application/Info.py,sha256=7xdjqwDRwazenFme2sP5soHZogPeE4EEanBSP19bQL0,1882
|
|
6
6
|
metripy/Application/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
metripy/Application/Config/Config.py,sha256=QX_uTUJEcAaL0Oyug0dlpVgRVEKliDtXgS-3J10OZQA,1503
|
|
8
8
|
metripy/Application/Config/GitConfig.py,sha256=4y676GYv-FH6QyLxh6IQn64gUG9xOQciMgkXH9pJtb4,220
|
|
@@ -10,7 +10,7 @@ metripy/Application/Config/Parser.py,sha256=zK_o7j3XaobSFAYhY4xznGhUTcyYSgQSzde1
|
|
|
10
10
|
metripy/Application/Config/ProjectConfig.py,sha256=qY1TpU93LEiRNilQ3Yt0vQxxx9USt8QimhmTaZJzM-s,3078
|
|
11
11
|
metripy/Application/Config/ReportConfig.py,sha256=Vh3S1n2nyH5YNmt8JrfGRTcmYZuqLMxyFnFF5mmxu_4,259
|
|
12
12
|
metripy/Application/Config/File/ConfigFileReaderFactory.py,sha256=EYPRxfjixjMtCp-O-Tx9xBOWq_gO2_NhyG1iYc52YHI,981
|
|
13
|
-
metripy/Application/Config/File/ConfigFileReaderInterface.py,sha256=
|
|
13
|
+
metripy/Application/Config/File/ConfigFileReaderInterface.py,sha256=e_7caWHo2CCU_2tgqzDcqJSfYhBS_ka-4b5jNxWjZB8,2647
|
|
14
14
|
metripy/Application/Config/File/JsonConfigFileReader.py,sha256=s4f1D7l9Od7gzpMa6-WFyJeY7vjJFTQx3xKC76wSWEs,478
|
|
15
15
|
metripy/Application/Config/File/YamlConfigFileReader.py,sha256=kDgWrf9wbVstgQGZ1a1b3zY5L9Lx61NhoXfypZU0w3s,483
|
|
16
16
|
metripy/Component/Debug/Debugger.py,sha256=LhkHzUGNSEPvIvcjZJJob5Fjg5NQhk7Rs43y1Bkc7hw,423
|
|
@@ -69,7 +69,7 @@ metripy/Report/Html/PageRenderer.py,sha256=hWbZ11eO5GEqCwtJTtnstx0Ni0u3OQTHwnYA-
|
|
|
69
69
|
metripy/Report/Html/PageRendererFactory.py,sha256=NnieU-d0rK3n1AmU8duTBVwEkYvllXiKtphwq34NdA8,1710
|
|
70
70
|
metripy/Report/Html/Reporter.py,sha256=mrSOgaqI9gjD7lZtzfZXbF62idwKsryEcaKdT4ddZnM,6545
|
|
71
71
|
metripy/Report/Html/TopOffendersPageRenderer.py,sha256=QTxoLuqaeiD7Ulxe0QaLXVEN5kcW6t8d0O96q-MM1U8,3136
|
|
72
|
-
metripy/Report/Html/TrendsPageRenderer.py,sha256=
|
|
72
|
+
metripy/Report/Html/TrendsPageRenderer.py,sha256=ouDqQvMgTx4qW1Qmpl98yjfThsYx7WDIxmaqd8nQdks,5844
|
|
73
73
|
metripy/Report/Json/AbstractJsonReporter.py,sha256=yqpBOO6MAN2HdhwoWOZ7Ler38WbV8DcG5g2oASXe-i8,343
|
|
74
74
|
metripy/Report/Json/GitJsonReporter.py,sha256=kzWXKgoPF1k19bXL8gc728qZT4PlBZdWXXUXG20o0oc,968
|
|
75
75
|
metripy/Report/Json/JsonReporter.py,sha256=teDETahhX0XdvM3TT8U8rqAyQrs_VTMq1aaz7vkD3YQ,607
|
|
@@ -88,9 +88,9 @@ metripy/templates/html_report/images/logo.svg,sha256=59gZXNLrZdKaefBoZMog8UPyyNj
|
|
|
88
88
|
metripy/templates/html_report/js/charts.js,sha256=1L3me_UVWBjLVyNyKQ9v19etd0u31jnCvbpyGaX-0Go,10127
|
|
89
89
|
metripy/templates/html_report/js/dashboard.js,sha256=RdV2GTFEm5Cc7oqGPxfsYUCt3lTmOzaZ9sUN60Vl1mE,19965
|
|
90
90
|
metripy/templates/html_report/js/git_analysis.js,sha256=GxtmRyouS55bgKPvdko4-AxywFvx1V7x3HuCjRZczk4,12798
|
|
91
|
-
metripy-0.3.
|
|
92
|
-
metripy-0.3.
|
|
93
|
-
metripy-0.3.
|
|
94
|
-
metripy-0.3.
|
|
95
|
-
metripy-0.3.
|
|
96
|
-
metripy-0.3.
|
|
91
|
+
metripy-0.3.5.dist-info/licenses/LICENSE,sha256=7I-LBXpo2Lveofzf06uDAmq0wPN7zbMwInrQZiQCiwc,1063
|
|
92
|
+
metripy-0.3.5.dist-info/METADATA,sha256=rkYtxDFWjkHJVeZLnyNnP9-5NHZO7mUdS9LBC1cbxrI,4190
|
|
93
|
+
metripy-0.3.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
94
|
+
metripy-0.3.5.dist-info/entry_points.txt,sha256=vZI1vreNyXX9XGDUQlOnE2cSBRWNyXOlXXFnEBsVNIA,49
|
|
95
|
+
metripy-0.3.5.dist-info/top_level.txt,sha256=Z-tn-27QGcxzNrsRq7BNPQv2BlXJnMCp8bp2sPdde1Y,8
|
|
96
|
+
metripy-0.3.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|