@theihtisham/dev-pulse 1.0.0 → 1.1.0
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.
- package/.editorconfig +12 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +43 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +33 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +18 -0
- package/.github/dependabot.yml +16 -0
- package/.github/workflows/ci.yml +33 -0
- package/CODE_OF_CONDUCT.md +27 -0
- package/Dockerfile +8 -0
- package/LICENSE +21 -21
- package/README.md +135 -39
- package/SECURITY.md +22 -0
- package/devpulse/__init__.py +4 -4
- package/devpulse/api/__init__.py +1 -1
- package/devpulse/api/app.py +371 -371
- package/devpulse/cli/__init__.py +1 -1
- package/devpulse/cli/dashboard.py +131 -131
- package/devpulse/cli/main.py +678 -678
- package/devpulse/cli/render.py +175 -175
- package/devpulse/core/__init__.py +34 -34
- package/devpulse/core/analytics.py +487 -487
- package/devpulse/core/config.py +77 -77
- package/devpulse/core/database.py +612 -612
- package/devpulse/core/github_client.py +281 -281
- package/devpulse/core/models.py +142 -142
- package/devpulse/core/report_generator.py +454 -454
- package/devpulse/static/.gitkeep +1 -1
- package/devpulse/templates/report.html +64 -64
- package/package.json +35 -35
- package/pyproject.toml +80 -80
- package/requirements.txt +14 -14
- package/tests/__init__.py +1 -1
- package/tests/conftest.py +208 -208
- package/tests/test_analytics.py +284 -284
- package/tests/test_api.py +313 -313
- package/tests/test_cli.py +204 -204
- package/tests/test_config.py +47 -47
- package/tests/test_database.py +255 -255
- package/tests/test_models.py +107 -107
- package/tests/test_report_generator.py +173 -173
- package/jest.config.js +0 -7
package/devpulse/core/config.py
CHANGED
|
@@ -1,77 +1,77 @@
|
|
|
1
|
-
"""Configuration management for DevPulse."""
|
|
2
|
-
|
|
3
|
-
import os
|
|
4
|
-
from pathlib import Path
|
|
5
|
-
from typing import Optional
|
|
6
|
-
|
|
7
|
-
from pydantic_settings import BaseSettings
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class Settings(BaseSettings):
|
|
11
|
-
"""Application settings loaded from environment variables."""
|
|
12
|
-
|
|
13
|
-
# GitHub
|
|
14
|
-
github_token: str = ""
|
|
15
|
-
github_username: str = ""
|
|
16
|
-
github_org: Optional[str] = None
|
|
17
|
-
github_api_url: str = "https://api.github.com"
|
|
18
|
-
github_repos: list[str] = []
|
|
19
|
-
|
|
20
|
-
# Database
|
|
21
|
-
database_path: str = ""
|
|
22
|
-
|
|
23
|
-
# API Server
|
|
24
|
-
api_host: str = "127.0.0.1"
|
|
25
|
-
api_port: int = 8742
|
|
26
|
-
api_workers: int = 1
|
|
27
|
-
|
|
28
|
-
# Rate limiting
|
|
29
|
-
github_rate_limit_rpm: int = 40
|
|
30
|
-
github_cache_ttl_seconds: int = 300
|
|
31
|
-
|
|
32
|
-
# Reports
|
|
33
|
-
reports_dir: str = ""
|
|
34
|
-
export_dir: str = ""
|
|
35
|
-
|
|
36
|
-
# AI insights (local heuristic engine)
|
|
37
|
-
insight_lookback_days: int = 30
|
|
38
|
-
burnout_threshold: float = 0.75
|
|
39
|
-
sprint_velocity_window: int = 4
|
|
40
|
-
|
|
41
|
-
# Logging
|
|
42
|
-
log_level: str = "INFO"
|
|
43
|
-
redact_sensitive: bool = True
|
|
44
|
-
|
|
45
|
-
model_config = {
|
|
46
|
-
"env_prefix": "DEVPULSE_",
|
|
47
|
-
"env_file": ".env",
|
|
48
|
-
"env_file_encoding": "utf-8",
|
|
49
|
-
"case_sensitive": False,
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
def model_post_init(self, __context: object) -> None:
|
|
53
|
-
"""Set defaults that depend on runtime state."""
|
|
54
|
-
base = Path(os.getcwd()) / "devpulse_data"
|
|
55
|
-
if not self.database_path:
|
|
56
|
-
self.database_path = str(base / "devpulse.db")
|
|
57
|
-
if not self.reports_dir:
|
|
58
|
-
self.reports_dir = str(base / "reports")
|
|
59
|
-
if not self.export_dir:
|
|
60
|
-
self.export_dir = str(base / "exports")
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
_settings: Optional[Settings] = None
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
def get_settings() -> Settings:
|
|
67
|
-
"""Return cached settings instance."""
|
|
68
|
-
global _settings
|
|
69
|
-
if _settings is None:
|
|
70
|
-
_settings = Settings()
|
|
71
|
-
return _settings
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
def reset_settings() -> None:
|
|
75
|
-
"""Reset cached settings (useful for testing)."""
|
|
76
|
-
global _settings
|
|
77
|
-
_settings = None
|
|
1
|
+
"""Configuration management for DevPulse."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Optional
|
|
6
|
+
|
|
7
|
+
from pydantic_settings import BaseSettings
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class Settings(BaseSettings):
|
|
11
|
+
"""Application settings loaded from environment variables."""
|
|
12
|
+
|
|
13
|
+
# GitHub
|
|
14
|
+
github_token: str = ""
|
|
15
|
+
github_username: str = ""
|
|
16
|
+
github_org: Optional[str] = None
|
|
17
|
+
github_api_url: str = "https://api.github.com"
|
|
18
|
+
github_repos: list[str] = []
|
|
19
|
+
|
|
20
|
+
# Database
|
|
21
|
+
database_path: str = ""
|
|
22
|
+
|
|
23
|
+
# API Server
|
|
24
|
+
api_host: str = "127.0.0.1"
|
|
25
|
+
api_port: int = 8742
|
|
26
|
+
api_workers: int = 1
|
|
27
|
+
|
|
28
|
+
# Rate limiting
|
|
29
|
+
github_rate_limit_rpm: int = 40
|
|
30
|
+
github_cache_ttl_seconds: int = 300
|
|
31
|
+
|
|
32
|
+
# Reports
|
|
33
|
+
reports_dir: str = ""
|
|
34
|
+
export_dir: str = ""
|
|
35
|
+
|
|
36
|
+
# AI insights (local heuristic engine)
|
|
37
|
+
insight_lookback_days: int = 30
|
|
38
|
+
burnout_threshold: float = 0.75
|
|
39
|
+
sprint_velocity_window: int = 4
|
|
40
|
+
|
|
41
|
+
# Logging
|
|
42
|
+
log_level: str = "INFO"
|
|
43
|
+
redact_sensitive: bool = True
|
|
44
|
+
|
|
45
|
+
model_config = {
|
|
46
|
+
"env_prefix": "DEVPULSE_",
|
|
47
|
+
"env_file": ".env",
|
|
48
|
+
"env_file_encoding": "utf-8",
|
|
49
|
+
"case_sensitive": False,
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
def model_post_init(self, __context: object) -> None:
|
|
53
|
+
"""Set defaults that depend on runtime state."""
|
|
54
|
+
base = Path(os.getcwd()) / "devpulse_data"
|
|
55
|
+
if not self.database_path:
|
|
56
|
+
self.database_path = str(base / "devpulse.db")
|
|
57
|
+
if not self.reports_dir:
|
|
58
|
+
self.reports_dir = str(base / "reports")
|
|
59
|
+
if not self.export_dir:
|
|
60
|
+
self.export_dir = str(base / "exports")
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
_settings: Optional[Settings] = None
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def get_settings() -> Settings:
|
|
67
|
+
"""Return cached settings instance."""
|
|
68
|
+
global _settings
|
|
69
|
+
if _settings is None:
|
|
70
|
+
_settings = Settings()
|
|
71
|
+
return _settings
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def reset_settings() -> None:
|
|
75
|
+
"""Reset cached settings (useful for testing)."""
|
|
76
|
+
global _settings
|
|
77
|
+
_settings = None
|