fast-clean 1.4.1__tar.gz → 1.4.3__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.
Files changed (80) hide show
  1. {fast_clean-1.4.1 → fast_clean-1.4.3}/PKG-INFO +1 -1
  2. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/depends.py +32 -13
  3. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean.egg-info/PKG-INFO +1 -1
  4. {fast_clean-1.4.1 → fast_clean-1.4.3}/pyproject.toml +1 -1
  5. {fast_clean-1.4.1 → fast_clean-1.4.3}/README.md +0 -0
  6. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/__init__.py +0 -0
  7. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/broker.py +0 -0
  8. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/cli/__init__.py +0 -0
  9. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/cli/cryptography.py +0 -0
  10. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/cli/load_seed.py +0 -0
  11. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/container.py +0 -0
  12. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/contrib/__init__.py +0 -0
  13. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/contrib/healthcheck/__init__.py +0 -0
  14. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/contrib/healthcheck/router.py +0 -0
  15. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/contrib/healthcheck/schemas.py +0 -0
  16. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/contrib/logging/__init__.py +0 -0
  17. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/contrib/logging/enums.py +0 -0
  18. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/contrib/logging/sentry.py +0 -0
  19. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/contrib/monitoring/__init__.py +0 -0
  20. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/contrib/monitoring/middleware.py +0 -0
  21. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/contrib/monitoring/router.py +0 -0
  22. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/contrib/sqlalchemy_utils/__init__.py +0 -0
  23. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/contrib/sqlalchemy_utils/utils.py +0 -0
  24. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/db.py +0 -0
  25. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/enums.py +0 -0
  26. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/exceptions.py +0 -0
  27. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/loggers.py +0 -0
  28. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/middleware.py +0 -0
  29. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/models.py +0 -0
  30. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/py.typed +0 -0
  31. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/repositories/__init__.py +0 -0
  32. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/repositories/cache/__init__.py +0 -0
  33. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/repositories/cache/in_memory.py +0 -0
  34. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/repositories/cache/redis.py +0 -0
  35. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/repositories/crud/__init__.py +0 -0
  36. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/repositories/crud/db.py +0 -0
  37. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/repositories/crud/in_memory.py +0 -0
  38. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/repositories/crud/type_vars.py +0 -0
  39. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/repositories/settings/__init__.py +0 -0
  40. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/repositories/settings/enums.py +0 -0
  41. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/repositories/settings/env.py +0 -0
  42. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/repositories/settings/exceptions.py +0 -0
  43. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/repositories/settings/type_vars.py +0 -0
  44. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/repositories/storage/__init__.py +0 -0
  45. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/repositories/storage/enums.py +0 -0
  46. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/repositories/storage/local.py +0 -0
  47. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/repositories/storage/reader.py +0 -0
  48. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/repositories/storage/s3.py +0 -0
  49. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/repositories/storage/schemas.py +0 -0
  50. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/schemas/__init__.py +0 -0
  51. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/schemas/exceptions.py +0 -0
  52. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/schemas/pagination.py +0 -0
  53. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/schemas/repository.py +0 -0
  54. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/schemas/request_response.py +0 -0
  55. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/services/__init__.py +0 -0
  56. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/services/cryptography/__init__.py +0 -0
  57. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/services/cryptography/aes.py +0 -0
  58. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/services/cryptography/enums.py +0 -0
  59. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/services/lock.py +0 -0
  60. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/services/seed.py +0 -0
  61. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/services/transaction.py +0 -0
  62. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/settings.py +0 -0
  63. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/utils/__init__.py +0 -0
  64. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/utils/process.py +0 -0
  65. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/utils/pydantic.py +0 -0
  66. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/utils/ssl_context.py +0 -0
  67. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/utils/string.py +0 -0
  68. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/utils/thread.py +0 -0
  69. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/utils/time.py +0 -0
  70. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/utils/toml.py +0 -0
  71. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/utils/type_converters.py +0 -0
  72. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean/utils/typer.py +0 -0
  73. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean.egg-info/SOURCES.txt +0 -0
  74. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean.egg-info/dependency_links.txt +0 -0
  75. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean.egg-info/requires.txt +0 -0
  76. {fast_clean-1.4.1 → fast_clean-1.4.3}/fast_clean.egg-info/top_level.txt +0 -0
  77. {fast_clean-1.4.1 → fast_clean-1.4.3}/setup.cfg +0 -0
  78. {fast_clean-1.4.1 → fast_clean-1.4.3}/tests/test_broker.py +0 -0
  79. {fast_clean-1.4.1 → fast_clean-1.4.3}/tests/test_db.py +0 -0
  80. {fast_clean-1.4.1 → fast_clean-1.4.3}/tests/test_exceptions.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fast-clean
3
- Version: 1.4.1
3
+ Version: 1.4.3
4
4
  Summary: FastAPI Clean Architecture implementation
5
5
  Author-email: Luferov Victor <luferovvs@yandex.ru>, Orlov Artem <squakrazv@yandex.ru>, Kashapov Rustam <hardtechnik91@gmail.com>
6
6
  Requires-Python: >=3.13
@@ -10,7 +10,7 @@ from dishka import Provider, Scope, provide
10
10
  from fastapi import Depends, Request
11
11
  from faststream.kafka import KafkaBroker
12
12
  from flatten_dict import unflatten
13
- from sqlalchemy.ext.asyncio import AsyncSession
13
+ from sqlalchemy.ext.asyncio import AsyncSession, async_sessionmaker
14
14
  from starlette.datastructures import FormData
15
15
  from stringcase import snakecase
16
16
 
@@ -81,14 +81,18 @@ class CoreProvider(Provider):
81
81
  Провайдер зависимостей.
82
82
  """
83
83
 
84
- scope = Scope.APP
84
+ scope = Scope.REQUEST
85
85
 
86
86
  # --- repositories ---
87
87
 
88
- settings_repository_factory = provide(SettingsRepositoryFactoryImpl, provides=SettingsRepositoryFactoryProtocol)
89
- storage_repository_factory = provide(StorageRepositoryFactoryImpl, provides=StorageRepositoryFactoryProtocol)
88
+ settings_repository_factory = provide(
89
+ SettingsRepositoryFactoryImpl, provides=SettingsRepositoryFactoryProtocol, scope=Scope.APP
90
+ )
91
+ storage_repository_factory = provide(
92
+ StorageRepositoryFactoryImpl, provides=StorageRepositoryFactoryProtocol, scope=Scope.APP
93
+ )
90
94
 
91
- @provide
95
+ @provide(scope=Scope.APP)
92
96
  @staticmethod
93
97
  async def get_settings_repository(
94
98
  settings_repository_factory: SettingsRepositoryFactoryProtocol,
@@ -98,7 +102,7 @@ class CoreProvider(Provider):
98
102
  """
99
103
  return await settings_repository_factory.make(SettingsSourceEnum.ENV)
100
104
 
101
- @provide
105
+ @provide(scope=Scope.APP)
102
106
  @staticmethod
103
107
  async def get_settings(settings_repository: SettingsRepositoryProtocol) -> CoreSettingsSchema:
104
108
  """
@@ -106,6 +110,15 @@ class CoreProvider(Provider):
106
110
  """
107
111
  return await settings_repository.get(CoreSettingsSchema)
108
112
 
113
+ @provide(scope=Scope.APP)
114
+ @staticmethod
115
+ async def get_cache_settings(settings_repository: SettingsRepositoryProtocol) -> CoreCacheSettingsSchema:
116
+ """
117
+ Получаем настройки кеша.
118
+ """
119
+ return await settings_repository.get(CoreCacheSettingsSchema)
120
+
121
+ @provide
109
122
  @staticmethod
110
123
  async def get_broker_repository(settings_repository: SettingsRepositoryProtocol) -> AsyncIterator[KafkaBroker]:
111
124
  """
@@ -114,7 +127,7 @@ class CoreProvider(Provider):
114
127
  kafka_settings = await settings_repository.get(CoreKafkaSettingsSchema)
115
128
  yield BrokerFactory.make_static(kafka_settings)
116
129
 
117
- @provide
130
+ @provide(scope=Scope.APP)
118
131
  @staticmethod
119
132
  async def get_cache_repository(settings_repository: SettingsRepositoryProtocol) -> CacheRepositoryProtocol:
120
133
  """
@@ -123,7 +136,7 @@ class CoreProvider(Provider):
123
136
  cache_settings = await settings_repository.get(CoreCacheSettingsSchema)
124
137
  return CacheManager.init(cache_settings)
125
138
 
126
- @provide(scope=Scope.REQUEST)
139
+ @provide
127
140
  @staticmethod
128
141
  async def get_storage_repository(
129
142
  settings_repository: SettingsRepositoryProtocol,
@@ -150,13 +163,19 @@ class CoreProvider(Provider):
150
163
 
151
164
  # --- db ---
152
165
 
166
+ @provide(scope=Scope.APP)
167
+ @staticmethod
168
+ async def get_async_sessionmaker(
169
+ settings_repository: SettingsRepositoryProtocol,
170
+ ) -> async_sessionmaker[AsyncSession]:
171
+ return await SessionFactory.make_async_session_dynamic(settings_repository)
172
+
153
173
  @provide
154
174
  @staticmethod
155
- async def get_async_session(settings_repository: SettingsRepositoryProtocol) -> AsyncIterator[AsyncSession]:
175
+ async def get_async_session(session_maker: async_sessionmaker[AsyncSession]) -> AsyncIterator[AsyncSession]:
156
176
  """
157
177
  Получаем асинхронную сессию.
158
178
  """
159
- session_maker = await SessionFactory.make_async_session_dynamic(settings_repository)
160
179
  async with session_maker() as session:
161
180
  yield session
162
181
 
@@ -170,10 +189,10 @@ class CoreProvider(Provider):
170
189
 
171
190
  # --- services ---
172
191
 
173
- seed_service = provide(SeedService)
192
+ seed_service = provide(SeedService, scope=Scope.APP)
174
193
  transaction_service = provide(TransactionService)
175
194
 
176
- @provide
195
+ @provide(scope=Scope.APP)
177
196
  @staticmethod
178
197
  def get_cryptography_service_factory(settings: CoreSettingsSchema) -> CryptographyServiceFactory:
179
198
  """
@@ -191,7 +210,7 @@ class CoreProvider(Provider):
191
210
  """
192
211
  return await cryptography_service_factory.make(CryptographicAlgorithmEnum.AES_GCM)
193
212
 
194
- @provide
213
+ @provide(scope=Scope.APP)
195
214
  @staticmethod
196
215
  def get_lock_service(cache_settings: CoreCacheSettingsSchema) -> LockServiceProtocol:
197
216
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fast-clean
3
- Version: 1.4.1
3
+ Version: 1.4.3
4
4
  Summary: FastAPI Clean Architecture implementation
5
5
  Author-email: Luferov Victor <luferovvs@yandex.ru>, Orlov Artem <squakrazv@yandex.ru>, Kashapov Rustam <hardtechnik91@gmail.com>
6
6
  Requires-Python: >=3.13
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "fast-clean"
3
- version = "1.4.1"
3
+ version = "1.4.3"
4
4
  description = "FastAPI Clean Architecture implementation"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.13"
File without changes
File without changes
File without changes
File without changes