pydepin 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.
pydepin-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,7 @@
1
+ Metadata-Version: 2.4
2
+ Name: pydepin
3
+ Version: 0.1.0
4
+ Summary: Dependency injection package
5
+ Requires-Python: >=3.13
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: fastapi[standard]>=0.123.5
File without changes
@@ -0,0 +1,9 @@
1
+ from depin.internal.container import Container, Inject, Scope
2
+ from depin.internal.request_scope import RequestScopeService
3
+
4
+ __all__ = [
5
+ 'RequestScopeService',
6
+ 'Container',
7
+ 'Scope',
8
+ 'Inject',
9
+ ]
@@ -0,0 +1,22 @@
1
+ from typing import override
2
+
3
+ from fastapi import Request
4
+ from starlette.middleware.base import BaseHTTPMiddleware
5
+
6
+ from depin.internal.request_scope import RequestScopeService
7
+
8
+
9
+ class RequestScopeMiddleware(BaseHTTPMiddleware):
10
+ @override
11
+ async def dispatch(self, request: Request, call_next):
12
+ token = RequestScopeService.enter_request_scope()
13
+ print('[RequestScopeMiddleware] entered request scope')
14
+
15
+ RequestScopeService.set_current_request(request)
16
+
17
+ try:
18
+ response = await call_next(request)
19
+ return response
20
+ finally:
21
+ await RequestScopeService.aexit_request_scope(token)
22
+ print('[RequestScopeMiddleware] exited request scope')
@@ -0,0 +1,7 @@
1
+ Metadata-Version: 2.4
2
+ Name: pydepin
3
+ Version: 0.1.0
4
+ Summary: Dependency injection package
5
+ Requires-Python: >=3.13
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: fastapi[standard]>=0.123.5
@@ -0,0 +1,9 @@
1
+ README.md
2
+ pyproject.toml
3
+ depin/__init__.py
4
+ depin/extensions/fastapi.py
5
+ pydepin.egg-info/PKG-INFO
6
+ pydepin.egg-info/SOURCES.txt
7
+ pydepin.egg-info/dependency_links.txt
8
+ pydepin.egg-info/requires.txt
9
+ pydepin.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ fastapi[standard]>=0.123.5
@@ -0,0 +1 @@
1
+ depin
@@ -0,0 +1,88 @@
1
+ [project]
2
+ name = "pydepin"
3
+ version = "0.1.0"
4
+ description = "Dependency injection package"
5
+ readme = "README.md"
6
+ requires-python = ">=3.13"
7
+
8
+ dependencies = ["fastapi[standard]>=0.123.5"]
9
+
10
+ [build-system]
11
+ requires = ["setuptools"]
12
+ build-backend = "setuptools.build_meta"
13
+
14
+ [dependency-groups]
15
+ dev = [
16
+ "mypy>=1.19.0",
17
+ "pytest>=8.4.2",
18
+ "pytest-asyncio>=1.3.0",
19
+ "pytest-cov>=7.0.0",
20
+ "httpx>=0.28.1",
21
+ "httpie>=3.2.4",
22
+ "rich>=14.2.0",
23
+ ]
24
+
25
+ [tool.ruff]
26
+ line-length = 120
27
+ exclude = ["**/migrations/versions"]
28
+
29
+ [tool.ruff.format]
30
+ preview = true
31
+ quote-style = 'single'
32
+
33
+ [tool.ruff.lint]
34
+ preview = true
35
+ select = ['I', 'F', 'E', 'W', 'PT']
36
+
37
+ [tool.ruff.lint.isort]
38
+ case-sensitive = true
39
+
40
+ [tool.mypy]
41
+ exclude = ["^.venv/", "^venv/"]
42
+ explicit_package_bases = true
43
+ mypy_path = ["."]
44
+
45
+ strict = true
46
+
47
+ disallow_untyped_calls = false
48
+ disallow_untyped_defs = false
49
+ warn_return_any = false
50
+ disallow_incomplete_defs = false
51
+ allow_redefinition = false
52
+
53
+ disable_error_code = ["misc"]
54
+ enable_error_code = ["ignore-without-code", "redundant-self"]
55
+
56
+ [[tool.mypy.overrides]]
57
+ module = ["pytest.*"]
58
+ ignore_missing_imports = true
59
+
60
+
61
+ [tool.basedpyright]
62
+ exclude = [
63
+ '**/node_modules',
64
+ '**/__pycache__',
65
+ '**/migrations/versions',
66
+ '**/.*',
67
+ ]
68
+
69
+ typeCheckingMode = 'recommended'
70
+
71
+ reportMissingTypeStubs = false
72
+ reportUnknownVariableType = false
73
+ reportUnannotatedClassAttribute = false
74
+ reportUnknownMemberType = false
75
+ reportUnusedCallResult = false
76
+ reportMissingParameterType = false
77
+ reportUnknownParameterType = false
78
+ reportAny = false
79
+ reportExplicitAny = false
80
+ reportUnknownArgumentType = false
81
+ reportUnusedParameter = "hint"
82
+ reportImportCycles = "hint"
83
+
84
+ reportImplicitOverride = true
85
+
86
+ [tool.setuptools.packages.find]
87
+ include = ["depin*"]
88
+ exclude = ["depin.internal*"]
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+