fast-clean 1.4.2__tar.gz → 1.4.4__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.2 → fast_clean-1.4.4}/PKG-INFO +1 -1
  2. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/depends.py +27 -15
  3. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean.egg-info/PKG-INFO +1 -1
  4. {fast_clean-1.4.2 → fast_clean-1.4.4}/pyproject.toml +1 -1
  5. {fast_clean-1.4.2 → fast_clean-1.4.4}/README.md +0 -0
  6. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/__init__.py +0 -0
  7. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/broker.py +0 -0
  8. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/cli/__init__.py +0 -0
  9. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/cli/cryptography.py +0 -0
  10. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/cli/load_seed.py +0 -0
  11. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/container.py +0 -0
  12. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/contrib/__init__.py +0 -0
  13. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/contrib/healthcheck/__init__.py +0 -0
  14. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/contrib/healthcheck/router.py +0 -0
  15. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/contrib/healthcheck/schemas.py +0 -0
  16. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/contrib/logging/__init__.py +0 -0
  17. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/contrib/logging/enums.py +0 -0
  18. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/contrib/logging/sentry.py +0 -0
  19. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/contrib/monitoring/__init__.py +0 -0
  20. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/contrib/monitoring/middleware.py +0 -0
  21. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/contrib/monitoring/router.py +0 -0
  22. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/contrib/sqlalchemy_utils/__init__.py +0 -0
  23. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/contrib/sqlalchemy_utils/utils.py +0 -0
  24. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/db.py +0 -0
  25. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/enums.py +0 -0
  26. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/exceptions.py +0 -0
  27. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/loggers.py +0 -0
  28. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/middleware.py +0 -0
  29. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/models.py +0 -0
  30. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/py.typed +0 -0
  31. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/repositories/__init__.py +0 -0
  32. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/repositories/cache/__init__.py +0 -0
  33. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/repositories/cache/in_memory.py +0 -0
  34. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/repositories/cache/redis.py +0 -0
  35. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/repositories/crud/__init__.py +0 -0
  36. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/repositories/crud/db.py +0 -0
  37. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/repositories/crud/in_memory.py +0 -0
  38. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/repositories/crud/type_vars.py +0 -0
  39. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/repositories/settings/__init__.py +0 -0
  40. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/repositories/settings/enums.py +0 -0
  41. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/repositories/settings/env.py +0 -0
  42. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/repositories/settings/exceptions.py +0 -0
  43. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/repositories/settings/type_vars.py +0 -0
  44. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/repositories/storage/__init__.py +0 -0
  45. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/repositories/storage/enums.py +0 -0
  46. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/repositories/storage/local.py +0 -0
  47. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/repositories/storage/reader.py +0 -0
  48. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/repositories/storage/s3.py +0 -0
  49. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/repositories/storage/schemas.py +0 -0
  50. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/schemas/__init__.py +0 -0
  51. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/schemas/exceptions.py +0 -0
  52. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/schemas/pagination.py +0 -0
  53. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/schemas/repository.py +0 -0
  54. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/schemas/request_response.py +0 -0
  55. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/services/__init__.py +0 -0
  56. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/services/cryptography/__init__.py +0 -0
  57. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/services/cryptography/aes.py +0 -0
  58. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/services/cryptography/enums.py +0 -0
  59. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/services/lock.py +0 -0
  60. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/services/seed.py +0 -0
  61. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/services/transaction.py +0 -0
  62. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/settings.py +0 -0
  63. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/utils/__init__.py +0 -0
  64. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/utils/process.py +0 -0
  65. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/utils/pydantic.py +0 -0
  66. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/utils/ssl_context.py +0 -0
  67. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/utils/string.py +0 -0
  68. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/utils/thread.py +0 -0
  69. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/utils/time.py +0 -0
  70. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/utils/toml.py +0 -0
  71. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/utils/type_converters.py +0 -0
  72. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean/utils/typer.py +0 -0
  73. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean.egg-info/SOURCES.txt +0 -0
  74. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean.egg-info/dependency_links.txt +0 -0
  75. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean.egg-info/requires.txt +0 -0
  76. {fast_clean-1.4.2 → fast_clean-1.4.4}/fast_clean.egg-info/top_level.txt +0 -0
  77. {fast_clean-1.4.2 → fast_clean-1.4.4}/setup.cfg +0 -0
  78. {fast_clean-1.4.2 → fast_clean-1.4.4}/tests/test_broker.py +0 -0
  79. {fast_clean-1.4.2 → fast_clean-1.4.4}/tests/test_db.py +0 -0
  80. {fast_clean-1.4.2 → fast_clean-1.4.4}/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.2
3
+ Version: 1.4.4
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,7 +110,7 @@ class CoreProvider(Provider):
106
110
  """
107
111
  return await settings_repository.get(CoreSettingsSchema)
108
112
 
109
- @provide
113
+ @provide(scope=Scope.APP)
110
114
  @staticmethod
111
115
  async def get_cache_settings(settings_repository: SettingsRepositoryProtocol) -> CoreCacheSettingsSchema:
112
116
  """
@@ -114,6 +118,7 @@ class CoreProvider(Provider):
114
118
  """
115
119
  return await settings_repository.get(CoreCacheSettingsSchema)
116
120
 
121
+ @provide
117
122
  @staticmethod
118
123
  async def get_broker_repository(settings_repository: SettingsRepositoryProtocol) -> AsyncIterator[KafkaBroker]:
119
124
  """
@@ -122,7 +127,7 @@ class CoreProvider(Provider):
122
127
  kafka_settings = await settings_repository.get(CoreKafkaSettingsSchema)
123
128
  yield BrokerFactory.make_static(kafka_settings)
124
129
 
125
- @provide
130
+ @provide(scope=Scope.APP)
126
131
  @staticmethod
127
132
  async def get_cache_repository(settings_repository: SettingsRepositoryProtocol) -> CacheRepositoryProtocol:
128
133
  """
@@ -131,7 +136,7 @@ class CoreProvider(Provider):
131
136
  cache_settings = await settings_repository.get(CoreCacheSettingsSchema)
132
137
  return CacheManager.init(cache_settings)
133
138
 
134
- @provide(scope=Scope.REQUEST)
139
+ @provide
135
140
  @staticmethod
136
141
  async def get_storage_repository(
137
142
  settings_repository: SettingsRepositoryProtocol,
@@ -154,17 +159,24 @@ class CoreProvider(Provider):
154
159
  )
155
160
  async with storage_repository:
156
161
  yield storage_repository
157
- raise NotImplementedError(f'Storage {storage_settings.provider} not allowed')
162
+ else:
163
+ raise NotImplementedError(f'Storage {storage_settings.provider} is not allowed')
158
164
 
159
165
  # --- db ---
160
166
 
167
+ @provide(scope=Scope.APP)
168
+ @staticmethod
169
+ async def get_async_sessionmaker(
170
+ settings_repository: SettingsRepositoryProtocol,
171
+ ) -> async_sessionmaker[AsyncSession]:
172
+ return await SessionFactory.make_async_session_dynamic(settings_repository)
173
+
161
174
  @provide
162
175
  @staticmethod
163
- async def get_async_session(settings_repository: SettingsRepositoryProtocol) -> AsyncIterator[AsyncSession]:
176
+ async def get_async_session(session_maker: async_sessionmaker[AsyncSession]) -> AsyncIterator[AsyncSession]:
164
177
  """
165
178
  Получаем асинхронную сессию.
166
179
  """
167
- session_maker = await SessionFactory.make_async_session_dynamic(settings_repository)
168
180
  async with session_maker() as session:
169
181
  yield session
170
182
 
@@ -178,10 +190,10 @@ class CoreProvider(Provider):
178
190
 
179
191
  # --- services ---
180
192
 
181
- seed_service = provide(SeedService)
193
+ seed_service = provide(SeedService, scope=Scope.REQUEST)
182
194
  transaction_service = provide(TransactionService)
183
195
 
184
- @provide
196
+ @provide(scope=Scope.APP)
185
197
  @staticmethod
186
198
  def get_cryptography_service_factory(settings: CoreSettingsSchema) -> CryptographyServiceFactory:
187
199
  """
@@ -199,7 +211,7 @@ class CoreProvider(Provider):
199
211
  """
200
212
  return await cryptography_service_factory.make(CryptographicAlgorithmEnum.AES_GCM)
201
213
 
202
- @provide
214
+ @provide(scope=Scope.APP)
203
215
  @staticmethod
204
216
  def get_lock_service(cache_settings: CoreCacheSettingsSchema) -> LockServiceProtocol:
205
217
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fast-clean
3
- Version: 1.4.2
3
+ Version: 1.4.4
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.2"
3
+ version = "1.4.4"
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