pydoctor-cli 0.1.3__tar.gz → 2.0.0__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.
- {pydoctor_cli-0.1.3/pydoctor_cli.egg-info → pydoctor_cli-2.0.0}/PKG-INFO +17 -2
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/README.md +15 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/__init__.py +1 -1
- pydoctor_cli-2.0.0/pydoctor/analysis/health_score.py +82 -0
- pydoctor_cli-2.0.0/pydoctor/cli/main.py +550 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/core/analyzer.py +3 -1
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/core/project.py +184 -42
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/core/report.py +3 -0
- pydoctor_cli-2.0.0/pydoctor/performance/parallel.py +40 -0
- pydoctor_cli-2.0.0/pydoctor/reports/table_formatter.py +253 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/reports/terminal_colors.py +9 -5
- pydoctor_cli-2.0.0/pydoctor/scanners/ci_scanner.py +141 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/scanners/outdated_package_scanner.py +20 -1
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/scanners/unused_package_scanner.py +57 -24
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/security/osv_client.py +31 -3
- pydoctor_cli-2.0.0/pydoctor/utils/__init__.py +5 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/utils/file_utils.py +24 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/utils/pip_utils.py +10 -5
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/utils/subprocess_utils.py +1 -1
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0/pydoctor_cli.egg-info}/PKG-INFO +17 -2
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor_cli.egg-info/SOURCES.txt +4 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pyproject.toml +2 -2
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/tests/conftest.py +3 -4
- pydoctor_cli-2.0.0/tests/test_ci_scanner.py +39 -0
- pydoctor_cli-2.0.0/tests/test_cli_ux.py +38 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/tests/test_env_scanner.py +0 -2
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/tests/test_unused_scanner.py +0 -3
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/tests/test_vulnerability_scanner.py +0 -1
- pydoctor_cli-0.1.3/pydoctor/analysis/health_score.py +0 -66
- pydoctor_cli-0.1.3/pydoctor/cli/main.py +0 -723
- pydoctor_cli-0.1.3/pydoctor/reports/table_formatter.py +0 -285
- pydoctor_cli-0.1.3/pydoctor/utils/__init__.py +0 -1
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/LICENSE +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/analysis/__init__.py +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/cache/__init__.py +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/cache/cache_manager.py +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/cli/__init__.py +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/config/__init__.py +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/config/settings.py +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/core/__init__.py +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/performance/__init__.py +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/performance/executor.py +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/reports/__init__.py +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/reports/json_formatter.py +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/scanners/__init__.py +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/scanners/dependency_scanner.py +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/scanners/env_scanner.py +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/scanners/vulnerability_scanner.py +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/security/__init__.py +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor/utils/parser_utils.py +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor_cli.egg-info/dependency_links.txt +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor_cli.egg-info/entry_points.txt +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor_cli.egg-info/requires.txt +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/pydoctor_cli.egg-info/top_level.txt +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/setup.cfg +0 -0
- {pydoctor_cli-0.1.3 → pydoctor_cli-2.0.0}/tests/test_dependency_scanner.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pydoctor-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 2.0.0
|
|
4
4
|
Summary: Premium Python environment diagnostic CLI — your project's personal physician.
|
|
5
5
|
Author-email: Favour Bamgboye <demiladebamgboye@gmail.com>
|
|
6
6
|
Maintainer-email: Favour Bamgboye <demiladebamgboye@gmail.com>
|
|
@@ -208,7 +208,7 @@ License: Apache License
|
|
|
208
208
|
|
|
209
209
|
Project-URL: Homepage, https://pydoctor.vercel.app
|
|
210
210
|
Project-URL: Repository, https://github.com/iamAgbaCoder/pydoctor-cli
|
|
211
|
-
Project-URL: Documentation, https://
|
|
211
|
+
Project-URL: Documentation, https://pydoctor.vercel.app/docs
|
|
212
212
|
Project-URL: Bug Tracker, https://github.com/iamAgbaCoder/pydoctor-cli/issues
|
|
213
213
|
Project-URL: Changelog, https://github.com/iamAgbaCoder/pydoctor-cli/releases
|
|
214
214
|
Keywords: pydoctor,diagnosis,dependency-checker,vulnerability-scanner,python-health,cli-tool,security-audit,static-analysis
|
|
@@ -323,6 +323,21 @@ pydoctor fix
|
|
|
323
323
|
|
|
324
324
|
## Release History
|
|
325
325
|
|
|
326
|
+
### v2.0.0
|
|
327
|
+
|
|
328
|
+
- **🚀 Major UI/UX Revamp**: Introduced a premium "kernel/hacker" aesthetic with boxed reports, dynamic progress animations, and improved readability.
|
|
329
|
+
- **🛡️ CI/CD Guard Mode**: New `pydoctor check --ci` command to detect exposed secrets (AWS, GitHub, PyPI tokens) and insecure workflow patterns in GitHub Actions/GitLab CI.
|
|
330
|
+
- **🐳 Docker Support**: New `pydoctor docker` command to diagnose Python issues inside containers and audit Dockerfiles.
|
|
331
|
+
- **🐙 GitHub Integration**: New `pydoctor github` command for repository-wide health scans and local git configuration audits.
|
|
332
|
+
- **📈 Advanced Health Scoring**: Refined the 0-100 scoring algorithm with granular penalties for security vulnerabilities and CI/CD risks.
|
|
333
|
+
- **⚡ Performance Boost**: Parallel execution engine for scanning large codebases faster.
|
|
334
|
+
- **🔍 Smart Environment Detection**: Now automatically prompts users when no venv is found, preventing accidental system-wide changes.
|
|
335
|
+
- **🎯 Context-Aware Reporting**: Targeted commands (like `pydoctor scan-unused` or `pydoctor github`) now intelligently suppress unrelated scanner noise.
|
|
336
|
+
- **🧠 OSV Deep-Fetching**: Overcame upstream OSV API batch limits by implementing dynamic real-time fetching and caching of full vulnerability advisories natively.
|
|
337
|
+
- **🔗 Transitive Dependency Tracking**: PyDoctor now uniquely segregates mathematical/transitive dependencies from pure unused bloat, effectively preventing `pydoctor fix` from uninstalling required sub-packages.
|
|
338
|
+
- **🛠️ Refined Git Discovery**: Utilizes native git heuristics (`--is-inside-work-tree` & `--show-toplevel`) to flawlessly map out project roots and repository states, even when scanning from deeply nested sub-directories.
|
|
339
|
+
- **🔮 Dynamic Fix Suggestions**: The `🚀 Next Steps` terminal guide now dynamically rules out the currently running command and gracefully self-hides when a project achieves a perfect 100/100 health rating.
|
|
340
|
+
|
|
326
341
|
### v0.1.3
|
|
327
342
|
|
|
328
343
|
- **Enhanced Package Detection**: Pydoctor now intelligently detects and uses your project's specific virtual environment (Poetry, UV, PDM, or standard venv) to run all scans and diagnoses.
|
|
@@ -74,6 +74,21 @@ pydoctor fix
|
|
|
74
74
|
|
|
75
75
|
## Release History
|
|
76
76
|
|
|
77
|
+
### v2.0.0
|
|
78
|
+
|
|
79
|
+
- **🚀 Major UI/UX Revamp**: Introduced a premium "kernel/hacker" aesthetic with boxed reports, dynamic progress animations, and improved readability.
|
|
80
|
+
- **🛡️ CI/CD Guard Mode**: New `pydoctor check --ci` command to detect exposed secrets (AWS, GitHub, PyPI tokens) and insecure workflow patterns in GitHub Actions/GitLab CI.
|
|
81
|
+
- **🐳 Docker Support**: New `pydoctor docker` command to diagnose Python issues inside containers and audit Dockerfiles.
|
|
82
|
+
- **🐙 GitHub Integration**: New `pydoctor github` command for repository-wide health scans and local git configuration audits.
|
|
83
|
+
- **📈 Advanced Health Scoring**: Refined the 0-100 scoring algorithm with granular penalties for security vulnerabilities and CI/CD risks.
|
|
84
|
+
- **⚡ Performance Boost**: Parallel execution engine for scanning large codebases faster.
|
|
85
|
+
- **🔍 Smart Environment Detection**: Now automatically prompts users when no venv is found, preventing accidental system-wide changes.
|
|
86
|
+
- **🎯 Context-Aware Reporting**: Targeted commands (like `pydoctor scan-unused` or `pydoctor github`) now intelligently suppress unrelated scanner noise.
|
|
87
|
+
- **🧠 OSV Deep-Fetching**: Overcame upstream OSV API batch limits by implementing dynamic real-time fetching and caching of full vulnerability advisories natively.
|
|
88
|
+
- **🔗 Transitive Dependency Tracking**: PyDoctor now uniquely segregates mathematical/transitive dependencies from pure unused bloat, effectively preventing `pydoctor fix` from uninstalling required sub-packages.
|
|
89
|
+
- **🛠️ Refined Git Discovery**: Utilizes native git heuristics (`--is-inside-work-tree` & `--show-toplevel`) to flawlessly map out project roots and repository states, even when scanning from deeply nested sub-directories.
|
|
90
|
+
- **🔮 Dynamic Fix Suggestions**: The `🚀 Next Steps` terminal guide now dynamically rules out the currently running command and gracefully self-hides when a project achieves a perfect 100/100 health rating.
|
|
91
|
+
|
|
77
92
|
### v0.1.3
|
|
78
93
|
|
|
79
94
|
- **Enhanced Package Detection**: Pydoctor now intelligently detects and uses your project's specific virtual environment (Poetry, UV, PDM, or standard venv) to run all scans and diagnoses.
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"""
|
|
2
|
+
pydoctor/analysis/health_score.py
|
|
3
|
+
──────────────────────────────────
|
|
4
|
+
Calculates the numerical project health score and verdict.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
from dataclasses import dataclass
|
|
10
|
+
|
|
11
|
+
from pydoctor.core.report import DiagnosisReport, Issue
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@dataclass
|
|
15
|
+
class HealthMetrics:
|
|
16
|
+
score: int
|
|
17
|
+
verdict: str
|
|
18
|
+
message: str
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def calculate_health(report: DiagnosisReport) -> HealthMetrics:
|
|
22
|
+
"""
|
|
23
|
+
Calculate project health score (0-100) based on identified issues.
|
|
24
|
+
"""
|
|
25
|
+
score = _compute_score(report)
|
|
26
|
+
categories = list({i.category for i in report.issues})
|
|
27
|
+
return _get_verdict(score, categories)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _compute_score(report: DiagnosisReport) -> int:
|
|
31
|
+
score = 100
|
|
32
|
+
for issue in report.issues:
|
|
33
|
+
score -= _calculate_issue_penalty(issue)
|
|
34
|
+
return max(0, score)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def _calculate_issue_penalty(issue: Issue) -> int:
|
|
38
|
+
sev = issue.severity.lower()
|
|
39
|
+
if sev in ("ok", "info"):
|
|
40
|
+
return 0
|
|
41
|
+
|
|
42
|
+
if issue.category == "security":
|
|
43
|
+
if sev == "critical":
|
|
44
|
+
return 25 # Increased penalty for security
|
|
45
|
+
if sev == "error":
|
|
46
|
+
return 12
|
|
47
|
+
return 6
|
|
48
|
+
if issue.category == "dependencies":
|
|
49
|
+
return 8
|
|
50
|
+
if issue.category == "outdated":
|
|
51
|
+
return 3
|
|
52
|
+
if issue.category == "unused":
|
|
53
|
+
return 2
|
|
54
|
+
if issue.category == "environment":
|
|
55
|
+
return 15 if sev in ("error", "critical") else 5
|
|
56
|
+
if issue.category == "ci":
|
|
57
|
+
return 20 if sev == "critical" else 10
|
|
58
|
+
return 0
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def _get_verdict(score: int, categories: list[str]) -> HealthMetrics:
|
|
62
|
+
is_partial = len(categories) == 1
|
|
63
|
+
cat_name = categories[0].capitalize() if is_partial else "Project"
|
|
64
|
+
|
|
65
|
+
if score >= 90:
|
|
66
|
+
verdict = "Excellent"
|
|
67
|
+
message = (
|
|
68
|
+
f"Your {cat_name} is healthy and ready for production."
|
|
69
|
+
if is_partial
|
|
70
|
+
else "Your project is healthy and ready for production."
|
|
71
|
+
)
|
|
72
|
+
elif score >= 70:
|
|
73
|
+
verdict = "Good"
|
|
74
|
+
message = f"Your {cat_name} is functional but has some minor issues to clear up."
|
|
75
|
+
elif score >= 50:
|
|
76
|
+
verdict = "Needs Attention"
|
|
77
|
+
message = f"Your {cat_name} has notable risks. Consider addressing warnings carefully."
|
|
78
|
+
else:
|
|
79
|
+
verdict = "Critical"
|
|
80
|
+
message = f"Your {cat_name} contains severe risks that should be fixed before production deployment."
|
|
81
|
+
|
|
82
|
+
return HealthMetrics(score=score, verdict=verdict, message=message)
|