yweb 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.
- yweb-0.1.0/LICENSE +21 -0
- yweb-0.1.0/PKG-INFO +76 -0
- yweb-0.1.0/pyproject.toml +214 -0
- yweb-0.1.0/setup.cfg +4 -0
- yweb-0.1.0/yweb/__init__.py +454 -0
- yweb-0.1.0/yweb/auth/__init__.py +359 -0
- yweb-0.1.0/yweb/auth/api/__init__.py +34 -0
- yweb-0.1.0/yweb/auth/api/auth_api.py +263 -0
- yweb-0.1.0/yweb/auth/api/login_record_api.py +84 -0
- yweb-0.1.0/yweb/auth/api/oauth2_api.py +444 -0
- yweb-0.1.0/yweb/auth/api/oidc_api.py +104 -0
- yweb-0.1.0/yweb/auth/api/user_api.py +232 -0
- yweb-0.1.0/yweb/auth/api_key.py +583 -0
- yweb-0.1.0/yweb/auth/audit.py +348 -0
- yweb-0.1.0/yweb/auth/base.py +394 -0
- yweb-0.1.0/yweb/auth/dependencies.py +336 -0
- yweb-0.1.0/yweb/auth/jwt.py +519 -0
- yweb-0.1.0/yweb/auth/ldap.py +660 -0
- yweb-0.1.0/yweb/auth/mfa/__init__.py +55 -0
- yweb-0.1.0/yweb/auth/mfa/base.py +135 -0
- yweb-0.1.0/yweb/auth/mfa/manager.py +320 -0
- yweb-0.1.0/yweb/auth/mfa/otp.py +425 -0
- yweb-0.1.0/yweb/auth/mfa/recovery.py +243 -0
- yweb-0.1.0/yweb/auth/mfa/totp.py +316 -0
- yweb-0.1.0/yweb/auth/mixins.py +425 -0
- yweb-0.1.0/yweb/auth/models.py +607 -0
- yweb-0.1.0/yweb/auth/oauth2/__init__.py +86 -0
- yweb-0.1.0/yweb/auth/oauth2/client.py +180 -0
- yweb-0.1.0/yweb/auth/oauth2/grants.py +514 -0
- yweb-0.1.0/yweb/auth/oauth2/manager.py +813 -0
- yweb-0.1.0/yweb/auth/oauth2/provider.py +283 -0
- yweb-0.1.0/yweb/auth/oauth2/token.py +196 -0
- yweb-0.1.0/yweb/auth/oidc.py +559 -0
- yweb-0.1.0/yweb/auth/password.py +241 -0
- yweb-0.1.0/yweb/auth/rate_limiter.py +245 -0
- yweb-0.1.0/yweb/auth/schemas.py +68 -0
- yweb-0.1.0/yweb/auth/service.py +607 -0
- yweb-0.1.0/yweb/auth/session.py +628 -0
- yweb-0.1.0/yweb/auth/setup.py +1084 -0
- yweb-0.1.0/yweb/auth/token_store.py +526 -0
- yweb-0.1.0/yweb/auth/validators.py +457 -0
- yweb-0.1.0/yweb/cache/__init__.py +103 -0
- yweb-0.1.0/yweb/cache/api.py +254 -0
- yweb-0.1.0/yweb/cache/backends.py +361 -0
- yweb-0.1.0/yweb/cache/decorators.py +744 -0
- yweb-0.1.0/yweb/cache/invalidation.py +353 -0
- yweb-0.1.0/yweb/config/__init__.py +73 -0
- yweb-0.1.0/yweb/config/loader.py +346 -0
- yweb-0.1.0/yweb/config/settings.py +515 -0
- yweb-0.1.0/yweb/exceptions/__init__.py +73 -0
- yweb-0.1.0/yweb/exceptions/exceptions.py +498 -0
- yweb-0.1.0/yweb/exceptions/handlers.py +579 -0
- yweb-0.1.0/yweb/log/__init__.py +92 -0
- yweb-0.1.0/yweb/log/filter_hooks.py +285 -0
- yweb-0.1.0/yweb/log/handlers.py +790 -0
- yweb-0.1.0/yweb/log/logger.py +518 -0
- yweb-0.1.0/yweb/middleware/__init__.py +54 -0
- yweb-0.1.0/yweb/middleware/current_user.py +278 -0
- yweb-0.1.0/yweb/middleware/ip_access.py +523 -0
- yweb-0.1.0/yweb/middleware/performance.py +57 -0
- yweb-0.1.0/yweb/middleware/request_id.py +74 -0
- yweb-0.1.0/yweb/middleware/request_logging.py +477 -0
- yweb-0.1.0/yweb/organization/__init__.py +251 -0
- yweb-0.1.0/yweb/organization/api/__init__.py +219 -0
- yweb-0.1.0/yweb/organization/api/department_api.py +449 -0
- yweb-0.1.0/yweb/organization/api/employee_api.py +476 -0
- yweb-0.1.0/yweb/organization/api/organization_api.py +161 -0
- yweb-0.1.0/yweb/organization/enums.py +118 -0
- yweb-0.1.0/yweb/organization/factory.py +714 -0
- yweb-0.1.0/yweb/organization/helpers.py +403 -0
- yweb-0.1.0/yweb/organization/models/__init__.py +21 -0
- yweb-0.1.0/yweb/organization/models/department.py +341 -0
- yweb-0.1.0/yweb/organization/models/dept_leader.py +80 -0
- yweb-0.1.0/yweb/organization/models/emp_dept_rel.py +94 -0
- yweb-0.1.0/yweb/organization/models/emp_org_rel.py +160 -0
- yweb-0.1.0/yweb/organization/models/employee.py +180 -0
- yweb-0.1.0/yweb/organization/models/organization.py +124 -0
- yweb-0.1.0/yweb/organization/schemas/__init__.py +54 -0
- yweb-0.1.0/yweb/organization/schemas/department.py +102 -0
- yweb-0.1.0/yweb/organization/schemas/employee.py +228 -0
- yweb-0.1.0/yweb/organization/schemas/organization.py +66 -0
- yweb-0.1.0/yweb/organization/services/__init__.py +23 -0
- yweb-0.1.0/yweb/organization/services/dept_service.py +419 -0
- yweb-0.1.0/yweb/organization/services/emp_service.py +634 -0
- yweb-0.1.0/yweb/organization/services/org_service.py +326 -0
- yweb-0.1.0/yweb/organization/services/sync_service.py +658 -0
- yweb-0.1.0/yweb/orm/__init__.py +352 -0
- yweb-0.1.0/yweb/orm/base_dto.py +367 -0
- yweb-0.1.0/yweb/orm/base_model.py +99 -0
- yweb-0.1.0/yweb/orm/base_schemas.py +103 -0
- yweb-0.1.0/yweb/orm/core_model.py +1448 -0
- yweb-0.1.0/yweb/orm/db_session.py +689 -0
- yweb-0.1.0/yweb/orm/fields.py +836 -0
- yweb-0.1.0/yweb/orm/history/__init__.py +51 -0
- yweb-0.1.0/yweb/orm/history/current_user.py +203 -0
- yweb-0.1.0/yweb/orm/history/history_helper.py +720 -0
- yweb-0.1.0/yweb/orm/id_model.py +243 -0
- yweb-0.1.0/yweb/orm/orm_extensions/__init__.py +66 -0
- yweb-0.1.0/yweb/orm/orm_extensions/cascade_soft_delete.py +326 -0
- yweb-0.1.0/yweb/orm/orm_extensions/soft_delete_hook.py +155 -0
- yweb-0.1.0/yweb/orm/orm_extensions/soft_delete_ignored_table.py +31 -0
- yweb-0.1.0/yweb/orm/orm_extensions/soft_delete_mixin.py +191 -0
- yweb-0.1.0/yweb/orm/orm_extensions/soft_delete_rewriter.py +203 -0
- yweb-0.1.0/yweb/orm/primary_key_config.py +217 -0
- yweb-0.1.0/yweb/orm/primary_key_generators.py +354 -0
- yweb-0.1.0/yweb/orm/sortable/__init__.py +43 -0
- yweb-0.1.0/yweb/orm/sortable/sortable_fields.py +49 -0
- yweb-0.1.0/yweb/orm/sortable/sortable_mixin.py +594 -0
- yweb-0.1.0/yweb/orm/statemachine/__init__.py +85 -0
- yweb-0.1.0/yweb/orm/statemachine/exceptions.py +153 -0
- yweb-0.1.0/yweb/orm/statemachine/state_field.py +86 -0
- yweb-0.1.0/yweb/orm/statemachine/state_history.py +380 -0
- yweb-0.1.0/yweb/orm/statemachine/state_machine.py +701 -0
- yweb-0.1.0/yweb/orm/taggable/__init__.py +65 -0
- yweb-0.1.0/yweb/orm/taggable/tag_model.py +400 -0
- yweb-0.1.0/yweb/orm/taggable/taggable_mixin.py +538 -0
- yweb-0.1.0/yweb/orm/transaction/__init__.py +100 -0
- yweb-0.1.0/yweb/orm/transaction/context.py +506 -0
- yweb-0.1.0/yweb/orm/transaction/exceptions.py +103 -0
- yweb-0.1.0/yweb/orm/transaction/hooks.py +224 -0
- yweb-0.1.0/yweb/orm/transaction/manager.py +474 -0
- yweb-0.1.0/yweb/orm/transaction/propagation.py +75 -0
- yweb-0.1.0/yweb/orm/transaction/retry.py +151 -0
- yweb-0.1.0/yweb/orm/transaction/state.py +57 -0
- yweb-0.1.0/yweb/orm/tree/__init__.py +70 -0
- yweb-0.1.0/yweb/orm/tree/tree_fields.py +114 -0
- yweb-0.1.0/yweb/orm/tree/tree_mixin.py +513 -0
- yweb-0.1.0/yweb/orm/tree/tree_utils.py +357 -0
- yweb-0.1.0/yweb/orm/utils.py +103 -0
- yweb-0.1.0/yweb/permission/__init__.py +270 -0
- yweb-0.1.0/yweb/permission/api/__init__.py +240 -0
- yweb-0.1.0/yweb/permission/api/api_resource_api.py +369 -0
- yweb-0.1.0/yweb/permission/api/cache_api.py +112 -0
- yweb-0.1.0/yweb/permission/api/permission_api.py +221 -0
- yweb-0.1.0/yweb/permission/api/role_api.py +459 -0
- yweb-0.1.0/yweb/permission/api/subject_api.py +345 -0
- yweb-0.1.0/yweb/permission/cache.py +426 -0
- yweb-0.1.0/yweb/permission/decorators.py +252 -0
- yweb-0.1.0/yweb/permission/dependencies.py +432 -0
- yweb-0.1.0/yweb/permission/enums.py +59 -0
- yweb-0.1.0/yweb/permission/exceptions.py +195 -0
- yweb-0.1.0/yweb/permission/factory.py +537 -0
- yweb-0.1.0/yweb/permission/helpers.py +217 -0
- yweb-0.1.0/yweb/permission/mixins.py +114 -0
- yweb-0.1.0/yweb/permission/models/__init__.py +42 -0
- yweb-0.1.0/yweb/permission/models/api_resource.py +207 -0
- yweb-0.1.0/yweb/permission/models/permission.py +141 -0
- yweb-0.1.0/yweb/permission/models/role.py +185 -0
- yweb-0.1.0/yweb/permission/models/role_permission.py +161 -0
- yweb-0.1.0/yweb/permission/models/subject_permission.py +180 -0
- yweb-0.1.0/yweb/permission/models/subject_role.py +209 -0
- yweb-0.1.0/yweb/permission/schemas/__init__.py +46 -0
- yweb-0.1.0/yweb/permission/schemas/assignment.py +135 -0
- yweb-0.1.0/yweb/permission/schemas/permission.py +109 -0
- yweb-0.1.0/yweb/permission/schemas/role.py +123 -0
- yweb-0.1.0/yweb/permission/services/__init__.py +13 -0
- yweb-0.1.0/yweb/permission/services/permission_service.py +709 -0
- yweb-0.1.0/yweb/permission/services/role_service.py +470 -0
- yweb-0.1.0/yweb/permission/types.py +157 -0
- yweb-0.1.0/yweb/response/__init__.py +93 -0
- yweb-0.1.0/yweb/response/base_response.py +576 -0
- yweb-0.1.0/yweb/scheduler/__init__.py +214 -0
- yweb-0.1.0/yweb/scheduler/api/__init__.py +89 -0
- yweb-0.1.0/yweb/scheduler/api/execution_api.py +113 -0
- yweb-0.1.0/yweb/scheduler/api/job_api.py +115 -0
- yweb-0.1.0/yweb/scheduler/api/stats_api.py +104 -0
- yweb-0.1.0/yweb/scheduler/builder.py +356 -0
- yweb-0.1.0/yweb/scheduler/context.py +66 -0
- yweb-0.1.0/yweb/scheduler/events.py +88 -0
- yweb-0.1.0/yweb/scheduler/executors/__init__.py +17 -0
- yweb-0.1.0/yweb/scheduler/executors/async_executor.py +89 -0
- yweb-0.1.0/yweb/scheduler/executors/thread_executor.py +119 -0
- yweb-0.1.0/yweb/scheduler/factory.py +491 -0
- yweb-0.1.0/yweb/scheduler/history.py +591 -0
- yweb-0.1.0/yweb/scheduler/http_job.py +324 -0
- yweb-0.1.0/yweb/scheduler/job.py +219 -0
- yweb-0.1.0/yweb/scheduler/locks/__init__.py +16 -0
- yweb-0.1.0/yweb/scheduler/locks/base.py +52 -0
- yweb-0.1.0/yweb/scheduler/locks/redis_lock.py +311 -0
- yweb-0.1.0/yweb/scheduler/models.py +234 -0
- yweb-0.1.0/yweb/scheduler/retry.py +291 -0
- yweb-0.1.0/yweb/scheduler/scheduler.py +1814 -0
- yweb-0.1.0/yweb/scheduler/stores/__init__.py +16 -0
- yweb-0.1.0/yweb/scheduler/stores/base.py +84 -0
- yweb-0.1.0/yweb/scheduler/stores/memory.py +71 -0
- yweb-0.1.0/yweb/scheduler/stores/orm.py +334 -0
- yweb-0.1.0/yweb/scheduler/triggers.py +189 -0
- yweb-0.1.0/yweb/storage/__init__.py +234 -0
- yweb-0.1.0/yweb/storage/backends/__init__.py +54 -0
- yweb-0.1.0/yweb/storage/backends/local.py +504 -0
- yweb-0.1.0/yweb/storage/backends/memory.py +367 -0
- yweb-0.1.0/yweb/storage/backends/oss.py +484 -0
- yweb-0.1.0/yweb/storage/backends/s3.py +532 -0
- yweb-0.1.0/yweb/storage/base.py +327 -0
- yweb-0.1.0/yweb/storage/config.py +396 -0
- yweb-0.1.0/yweb/storage/exceptions.py +322 -0
- yweb-0.1.0/yweb/storage/integrations/__init__.py +26 -0
- yweb-0.1.0/yweb/storage/integrations/fastapi.py +319 -0
- yweb-0.1.0/yweb/storage/integrations/fastapi_multipart.py +401 -0
- yweb-0.1.0/yweb/storage/manager.py +515 -0
- yweb-0.1.0/yweb/storage/metrics.py +506 -0
- yweb-0.1.0/yweb/storage/multipart.py +521 -0
- yweb-0.1.0/yweb/storage/secure_url.py +546 -0
- yweb-0.1.0/yweb/storage/validators.py +552 -0
- yweb-0.1.0/yweb/storage/versioning.py +470 -0
- yweb-0.1.0/yweb/utils/__init__.py +65 -0
- yweb-0.1.0/yweb/utils/encryption.py +145 -0
- yweb-0.1.0/yweb/utils/file_size.py +198 -0
- yweb-0.1.0/yweb/utils/generate_id.py +8 -0
- yweb-0.1.0/yweb/utils/ip.py +151 -0
- yweb-0.1.0/yweb/utils/test_collector.py +258 -0
- yweb-0.1.0/yweb/validators/__init__.py +79 -0
- yweb-0.1.0/yweb/validators/constraints.py +361 -0
- yweb-0.1.0/yweb/version.py +5 -0
- yweb-0.1.0/yweb.egg-info/PKG-INFO +76 -0
- yweb-0.1.0/yweb.egg-info/SOURCES.txt +217 -0
- yweb-0.1.0/yweb.egg-info/dependency_links.txt +1 -0
- yweb-0.1.0/yweb.egg-info/requires.txt +57 -0
- yweb-0.1.0/yweb.egg-info/top_level.txt +1 -0
yweb-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 YAFO-AI Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
yweb-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: yweb
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: FastAPI基础类库,提供响应封装、中间件、ORM、认证、日志等基础功能
|
|
5
|
+
Author: YAFO-AI Team
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/yourusername/yweb
|
|
8
|
+
Project-URL: Documentation, https://github.com/yourusername/yweb#readme
|
|
9
|
+
Project-URL: Repository, https://github.com/yourusername/yweb.git
|
|
10
|
+
Project-URL: Issues, https://github.com/yourusername/yweb/issues
|
|
11
|
+
Keywords: fastapi,sqlalchemy,orm,middleware,jwt,authentication,logging
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Framework :: FastAPI
|
|
23
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
|
|
24
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
+
Requires-Python: >=3.8
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Requires-Dist: fastapi>=0.100.0
|
|
29
|
+
Requires-Dist: sqlalchemy>=2.0.0
|
|
30
|
+
Requires-Dist: pydantic>=2.0.0
|
|
31
|
+
Requires-Dist: pydantic-settings>=2.0.0
|
|
32
|
+
Requires-Dist: python-multipart>=0.0.6
|
|
33
|
+
Requires-Dist: starlette>=0.27.0
|
|
34
|
+
Requires-Dist: bcrypt>=4.0.0
|
|
35
|
+
Requires-Dist: cachetools>=5.2.0
|
|
36
|
+
Requires-Dist: python-jose[cryptography]>=3.3.0
|
|
37
|
+
Requires-Dist: pyyaml>=6.0
|
|
38
|
+
Provides-Extra: ldap
|
|
39
|
+
Requires-Dist: ldap3>=2.9.0; extra == "ldap"
|
|
40
|
+
Provides-Extra: async
|
|
41
|
+
Requires-Dist: aiofiles>=23.0.0; extra == "async"
|
|
42
|
+
Provides-Extra: oss
|
|
43
|
+
Requires-Dist: oss2>=2.18.0; extra == "oss"
|
|
44
|
+
Provides-Extra: s3
|
|
45
|
+
Requires-Dist: boto3>=1.28.0; extra == "s3"
|
|
46
|
+
Provides-Extra: redis
|
|
47
|
+
Requires-Dist: redis>=4.5.0; extra == "redis"
|
|
48
|
+
Provides-Extra: validation
|
|
49
|
+
Requires-Dist: python-magic>=0.4.27; extra == "validation"
|
|
50
|
+
Requires-Dist: pillow>=10.0.0; extra == "validation"
|
|
51
|
+
Provides-Extra: storage-all
|
|
52
|
+
Requires-Dist: aiofiles>=23.0.0; extra == "storage-all"
|
|
53
|
+
Requires-Dist: oss2>=2.18.0; extra == "storage-all"
|
|
54
|
+
Requires-Dist: boto3>=1.28.0; extra == "storage-all"
|
|
55
|
+
Requires-Dist: redis>=4.5.0; extra == "storage-all"
|
|
56
|
+
Requires-Dist: python-magic>=0.4.27; extra == "storage-all"
|
|
57
|
+
Requires-Dist: pillow>=10.0.0; extra == "storage-all"
|
|
58
|
+
Provides-Extra: dev
|
|
59
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
60
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
61
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
62
|
+
Requires-Dist: httpx>=0.24.0; extra == "dev"
|
|
63
|
+
Requires-Dist: requests>=2.31.0; extra == "dev"
|
|
64
|
+
Requires-Dist: pytest-mock>=3.10.0; extra == "dev"
|
|
65
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
66
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
67
|
+
Requires-Dist: types-PyYAML>=6.0.0; extra == "dev"
|
|
68
|
+
Provides-Extra: all
|
|
69
|
+
Requires-Dist: ldap3>=2.9.0; extra == "all"
|
|
70
|
+
Requires-Dist: aiofiles>=23.0.0; extra == "all"
|
|
71
|
+
Requires-Dist: oss2>=2.18.0; extra == "all"
|
|
72
|
+
Requires-Dist: boto3>=1.28.0; extra == "all"
|
|
73
|
+
Requires-Dist: redis>=4.5.0; extra == "all"
|
|
74
|
+
Requires-Dist: python-magic>=0.4.27; extra == "all"
|
|
75
|
+
Requires-Dist: pillow>=10.0.0; extra == "all"
|
|
76
|
+
Dynamic: license-file
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "yweb"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "FastAPI基础类库,提供响应封装、中间件、ORM、认证、日志等基础功能"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { text = "MIT" }
|
|
11
|
+
authors = [
|
|
12
|
+
{ name = "YAFO-AI Team" }
|
|
13
|
+
]
|
|
14
|
+
keywords = [
|
|
15
|
+
"fastapi",
|
|
16
|
+
"sqlalchemy",
|
|
17
|
+
"orm",
|
|
18
|
+
"middleware",
|
|
19
|
+
"jwt",
|
|
20
|
+
"authentication",
|
|
21
|
+
"logging"
|
|
22
|
+
]
|
|
23
|
+
classifiers = [
|
|
24
|
+
"Development Status :: 4 - Beta",
|
|
25
|
+
"Intended Audience :: Developers",
|
|
26
|
+
"License :: OSI Approved :: MIT License",
|
|
27
|
+
"Operating System :: OS Independent",
|
|
28
|
+
"Programming Language :: Python :: 3",
|
|
29
|
+
"Programming Language :: Python :: 3.8",
|
|
30
|
+
"Programming Language :: Python :: 3.9",
|
|
31
|
+
"Programming Language :: Python :: 3.10",
|
|
32
|
+
"Programming Language :: Python :: 3.11",
|
|
33
|
+
"Programming Language :: Python :: 3.12",
|
|
34
|
+
"Framework :: FastAPI",
|
|
35
|
+
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
|
|
36
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
37
|
+
]
|
|
38
|
+
requires-python = ">=3.8"
|
|
39
|
+
|
|
40
|
+
dependencies = [
|
|
41
|
+
"fastapi>=0.100.0",
|
|
42
|
+
"sqlalchemy>=2.0.0",
|
|
43
|
+
"pydantic>=2.0.0",
|
|
44
|
+
"pydantic-settings>=2.0.0",
|
|
45
|
+
"python-multipart>=0.0.6",
|
|
46
|
+
"starlette>=0.27.0",
|
|
47
|
+
"bcrypt>=4.0.0",
|
|
48
|
+
"cachetools>=5.2.0",
|
|
49
|
+
"python-jose[cryptography]>=3.3.0",
|
|
50
|
+
"pyyaml>=6.0",
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
[project.optional-dependencies]
|
|
54
|
+
# LDAP 支持
|
|
55
|
+
ldap = ["ldap3>=2.9.0"]
|
|
56
|
+
|
|
57
|
+
# ==================== 存储模块可选依赖 ====================
|
|
58
|
+
|
|
59
|
+
# 异步文件操作支持
|
|
60
|
+
async = ["aiofiles>=23.0.0"]
|
|
61
|
+
|
|
62
|
+
# 阿里云 OSS 存储
|
|
63
|
+
oss = ["oss2>=2.18.0"]
|
|
64
|
+
|
|
65
|
+
# AWS S3 / MinIO 存储
|
|
66
|
+
s3 = ["boto3>=1.28.0"]
|
|
67
|
+
|
|
68
|
+
# Redis Token 存储(用于分布式安全URL)
|
|
69
|
+
redis = ["redis>=4.5.0"]
|
|
70
|
+
|
|
71
|
+
# 文件验证增强(magic number 检测、图片尺寸验证)
|
|
72
|
+
validation = [
|
|
73
|
+
"python-magic>=0.4.27",
|
|
74
|
+
"pillow>=10.0.0",
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
# 存储模块全部功能
|
|
78
|
+
storage-all = [
|
|
79
|
+
"aiofiles>=23.0.0",
|
|
80
|
+
"oss2>=2.18.0",
|
|
81
|
+
"boto3>=1.28.0",
|
|
82
|
+
"redis>=4.5.0",
|
|
83
|
+
"python-magic>=0.4.27",
|
|
84
|
+
"pillow>=10.0.0",
|
|
85
|
+
]
|
|
86
|
+
|
|
87
|
+
# ==================== 开发依赖 ====================
|
|
88
|
+
|
|
89
|
+
# 开发和测试依赖
|
|
90
|
+
dev = [
|
|
91
|
+
"pytest>=7.0.0",
|
|
92
|
+
"pytest-cov>=4.0.0",
|
|
93
|
+
"pytest-asyncio>=0.21.0",
|
|
94
|
+
"httpx>=0.24.0",
|
|
95
|
+
"requests>=2.31.0",
|
|
96
|
+
"pytest-mock>=3.10.0",
|
|
97
|
+
"ruff>=0.1.0",
|
|
98
|
+
"mypy>=1.0.0",
|
|
99
|
+
"types-PyYAML>=6.0.0",
|
|
100
|
+
]
|
|
101
|
+
|
|
102
|
+
# ==================== 组合安装 ====================
|
|
103
|
+
|
|
104
|
+
# 所有可选依赖
|
|
105
|
+
all = [
|
|
106
|
+
"ldap3>=2.9.0",
|
|
107
|
+
"aiofiles>=23.0.0",
|
|
108
|
+
"oss2>=2.18.0",
|
|
109
|
+
"boto3>=1.28.0",
|
|
110
|
+
"redis>=4.5.0",
|
|
111
|
+
"python-magic>=0.4.27",
|
|
112
|
+
"pillow>=10.0.0",
|
|
113
|
+
]
|
|
114
|
+
|
|
115
|
+
[project.urls]
|
|
116
|
+
Homepage = "https://github.com/yourusername/yweb"
|
|
117
|
+
Documentation = "https://github.com/yourusername/yweb#readme"
|
|
118
|
+
Repository = "https://github.com/yourusername/yweb.git"
|
|
119
|
+
Issues = "https://github.com/yourusername/yweb/issues"
|
|
120
|
+
|
|
121
|
+
[tool.setuptools.packages.find]
|
|
122
|
+
where = ["."]
|
|
123
|
+
include = ["yweb*"]
|
|
124
|
+
|
|
125
|
+
[tool.setuptools.package-data]
|
|
126
|
+
yweb = ["py.typed"]
|
|
127
|
+
|
|
128
|
+
# ============================================================
|
|
129
|
+
# pytest 配置
|
|
130
|
+
# ============================================================
|
|
131
|
+
[tool.pytest.ini_options]
|
|
132
|
+
testpaths = ["tests"]
|
|
133
|
+
python_files = ["test_*.py"]
|
|
134
|
+
python_classes = ["Test*"]
|
|
135
|
+
python_functions = ["test_*"]
|
|
136
|
+
addopts = "-v --tb=short"
|
|
137
|
+
markers = [
|
|
138
|
+
"slow: marks tests as slow",
|
|
139
|
+
"integration: marks tests as integration tests",
|
|
140
|
+
"unit: marks tests as unit tests",
|
|
141
|
+
]
|
|
142
|
+
filterwarnings = [
|
|
143
|
+
"ignore::DeprecationWarning",
|
|
144
|
+
"ignore::PendingDeprecationWarning",
|
|
145
|
+
]
|
|
146
|
+
|
|
147
|
+
# ============================================================
|
|
148
|
+
# ruff 配置 (代码检查和格式化)
|
|
149
|
+
# ============================================================
|
|
150
|
+
[tool.ruff]
|
|
151
|
+
target-version = "py38"
|
|
152
|
+
line-length = 120
|
|
153
|
+
exclude = [
|
|
154
|
+
".git",
|
|
155
|
+
".venv",
|
|
156
|
+
"__pycache__",
|
|
157
|
+
"build",
|
|
158
|
+
"dist",
|
|
159
|
+
"*.egg-info",
|
|
160
|
+
]
|
|
161
|
+
|
|
162
|
+
[tool.ruff.lint]
|
|
163
|
+
select = [
|
|
164
|
+
"E", # pycodestyle errors
|
|
165
|
+
"W", # pycodestyle warnings
|
|
166
|
+
"F", # pyflakes
|
|
167
|
+
"I", # isort
|
|
168
|
+
"B", # flake8-bugbear
|
|
169
|
+
"C4", # flake8-comprehensions
|
|
170
|
+
"UP", # pyupgrade
|
|
171
|
+
]
|
|
172
|
+
ignore = [
|
|
173
|
+
"E501", # line too long (handled by formatter)
|
|
174
|
+
"B008", # do not perform function calls in argument defaults
|
|
175
|
+
"B905", # zip strict
|
|
176
|
+
]
|
|
177
|
+
|
|
178
|
+
[tool.ruff.lint.isort]
|
|
179
|
+
known-first-party = ["yweb"]
|
|
180
|
+
|
|
181
|
+
# ============================================================
|
|
182
|
+
# mypy 配置 (类型检查)
|
|
183
|
+
# ============================================================
|
|
184
|
+
[tool.mypy]
|
|
185
|
+
python_version = "3.8"
|
|
186
|
+
warn_return_any = true
|
|
187
|
+
warn_unused_ignores = true
|
|
188
|
+
disallow_untyped_defs = false
|
|
189
|
+
ignore_missing_imports = true
|
|
190
|
+
exclude = [
|
|
191
|
+
"tests",
|
|
192
|
+
"examples",
|
|
193
|
+
"docs",
|
|
194
|
+
]
|
|
195
|
+
|
|
196
|
+
# ============================================================
|
|
197
|
+
# coverage 配置 (测试覆盖率)
|
|
198
|
+
# ============================================================
|
|
199
|
+
[tool.coverage.run]
|
|
200
|
+
source = ["yweb"]
|
|
201
|
+
branch = true
|
|
202
|
+
omit = [
|
|
203
|
+
"*/tests/*",
|
|
204
|
+
"*/examples/*",
|
|
205
|
+
]
|
|
206
|
+
|
|
207
|
+
[tool.coverage.report]
|
|
208
|
+
exclude_lines = [
|
|
209
|
+
"pragma: no cover",
|
|
210
|
+
"def __repr__",
|
|
211
|
+
"raise NotImplementedError",
|
|
212
|
+
"if TYPE_CHECKING:",
|
|
213
|
+
"if __name__ == .__main__.:",
|
|
214
|
+
]
|
yweb-0.1.0/setup.cfg
ADDED