wheke-sentry 0.1.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.
@@ -0,0 +1,12 @@
1
+ Metadata-Version: 2.4
2
+ Name: wheke-sentry
3
+ Version: 0.1.0
4
+ Summary: Add sentry capabilities to wheke
5
+ Requires-Python: >=3.12
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: sentry-sdk
8
+ Requires-Dist: wheke
9
+
10
+ # Wheke Sentry
11
+
12
+ Add sentry capabilities to wheke
@@ -0,0 +1,3 @@
1
+ # Wheke Sentry
2
+
3
+ Add sentry capabilities to wheke
@@ -0,0 +1,127 @@
1
+ [project]
2
+ name = "wheke-sentry"
3
+ version = "0.1.0"
4
+ description = "Add sentry capabilities to wheke"
5
+ readme = "README.md"
6
+ requires-python = ">=3.12"
7
+ dependencies = [
8
+ "sentry-sdk",
9
+ "wheke",
10
+ ]
11
+
12
+ [dependency-groups]
13
+ dev = [
14
+ "httpx",
15
+ "mypy",
16
+ "pytest",
17
+ "pytest-cov",
18
+ "ruff",
19
+ ]
20
+
21
+ [tool.pytest.ini_options]
22
+ pythonpath = [
23
+ "src"
24
+ ]
25
+
26
+ [tool.coverage.run]
27
+ relative_files = true
28
+ branch = true
29
+ parallel = true
30
+ omit = []
31
+
32
+ [tool.coverage.report]
33
+ show_missing = true
34
+ exclude_lines = [
35
+ "no cov",
36
+ "if __name__ == .__main__.:",
37
+ "if TYPE_CHECKING:",
38
+ ]
39
+
40
+ [tool.isort]
41
+ profile = "black"
42
+ skip = [
43
+ ".env",
44
+ ".hatch",
45
+ ".mypy_cache",
46
+ ".venv",
47
+ "__pycache__",
48
+ "env",
49
+ "venv",
50
+ ]
51
+
52
+ [tool.mypy]
53
+ disallow_incomplete_defs = true
54
+ check_untyped_defs = true
55
+ warn_unused_ignores = true
56
+ exclude = """
57
+ .env
58
+ | .hatch
59
+ | .mypy_cache
60
+ | .venv
61
+ | __pycache__
62
+ | env
63
+ | venv
64
+ """
65
+
66
+ [tool.ruff]
67
+ exclude = [
68
+ ".env",
69
+ ".hatch",
70
+ ".mypy_cache",
71
+ ".venv",
72
+ "__pycache__",
73
+ "env",
74
+ "venv",
75
+ ]
76
+
77
+ [tool.ruff.lint]
78
+ select = [
79
+ "A",
80
+ "ARG",
81
+ "B",
82
+ "C",
83
+ "DTZ",
84
+ "E",
85
+ "EM",
86
+ "F",
87
+ "FBT",
88
+ "I",
89
+ "ICN",
90
+ "ISC",
91
+ "N",
92
+ "PLC",
93
+ "PLE",
94
+ "PLR",
95
+ "PLW",
96
+ "Q",
97
+ "RUF",
98
+ "S",
99
+ "T",
100
+ "TID",
101
+ "UP",
102
+ "W",
103
+ "YTT",
104
+ ]
105
+ ignore = [
106
+ # Same line string implicit string concatenation
107
+ "ISC001",
108
+ # Allow non-abstract empty methods in abstract base classes
109
+ "B027",
110
+ # Ignore checks for possible passwords
111
+ "S105", "S106", "S107",
112
+ # Ignore complexity
113
+ "C901", "PLR0911", "PLR0912", "PLR0913", "PLR0915",
114
+ # Relative imports
115
+ "TID252",
116
+ ]
117
+ unfixable = [
118
+ # Don't touch unused imports
119
+ "F401",
120
+ ]
121
+
122
+ [tool.ruff.lint.isort]
123
+ known-first-party = ["wheke_sentry"]
124
+
125
+ [tool.ruff.lint.per-file-ignores]
126
+ # Tests can use magic values, assertions, and relative imports
127
+ "tests/**/*" = ["PLR2004", "S101", "TID252"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,9 @@
1
+ from ._pod import sentry_pod
2
+ from ._service import SentryService
3
+ from ._settings import SentrySettings
4
+
5
+ __all__ = [
6
+ "SentryService",
7
+ "SentrySettings",
8
+ "sentry_pod",
9
+ ]
@@ -0,0 +1,14 @@
1
+ from wheke import Pod, ServiceConfig
2
+
3
+ from ._service import SentryService, sentry_service_factory
4
+
5
+ sentry_pod = Pod(
6
+ "sentry",
7
+ services=[
8
+ ServiceConfig(
9
+ SentryService,
10
+ sentry_service_factory,
11
+ is_singleton=True,
12
+ ),
13
+ ],
14
+ )
@@ -0,0 +1,20 @@
1
+ import sentry_sdk
2
+ from svcs import Container
3
+ from wheke import WhekeSettings, get_settings
4
+
5
+ from ._settings import SentrySettings
6
+
7
+
8
+ class SentryService:
9
+ settings: SentrySettings
10
+
11
+ def __init__(self, *, settings: SentrySettings) -> None:
12
+ self.settings = settings
13
+ sentry_sdk.init(dsn=settings.dsn, send_default_pii=True)
14
+
15
+
16
+ def sentry_service_factory(container: Container) -> SentryService:
17
+ settings = get_settings(container, WhekeSettings).get_feature(SentrySettings)
18
+ service = SentryService(settings=settings)
19
+
20
+ return service
@@ -0,0 +1,9 @@
1
+ from typing import ClassVar
2
+
3
+ from wheke import FeatureSettings
4
+
5
+
6
+ class SentrySettings(FeatureSettings):
7
+ __feature_name__: ClassVar[str] = "sentry"
8
+
9
+ dsn: str = "https://ingest.url.sentry.io/projectcode"
File without changes
@@ -0,0 +1,12 @@
1
+ Metadata-Version: 2.4
2
+ Name: wheke-sentry
3
+ Version: 0.1.0
4
+ Summary: Add sentry capabilities to wheke
5
+ Requires-Python: >=3.12
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: sentry-sdk
8
+ Requires-Dist: wheke
9
+
10
+ # Wheke Sentry
11
+
12
+ Add sentry capabilities to wheke
@@ -0,0 +1,13 @@
1
+ README.md
2
+ pyproject.toml
3
+ src/wheke_sentry/__init__.py
4
+ src/wheke_sentry/_pod.py
5
+ src/wheke_sentry/_service.py
6
+ src/wheke_sentry/_settings.py
7
+ src/wheke_sentry/py.typed
8
+ src/wheke_sentry.egg-info/PKG-INFO
9
+ src/wheke_sentry.egg-info/SOURCES.txt
10
+ src/wheke_sentry.egg-info/dependency_links.txt
11
+ src/wheke_sentry.egg-info/requires.txt
12
+ src/wheke_sentry.egg-info/top_level.txt
13
+ tests/test_app.py
@@ -0,0 +1,2 @@
1
+ sentry-sdk
2
+ wheke
@@ -0,0 +1 @@
1
+ wheke_sentry
@@ -0,0 +1,7 @@
1
+ from fastapi import status
2
+ from fastapi.testclient import TestClient
3
+
4
+
5
+ def test_test_app(client: TestClient) -> None:
6
+ response = client.get("/docs")
7
+ assert response.status_code == status.HTTP_200_OK