fastapi-scaff 0.2.1__py3-none-any.whl → 0.2.2__py3-none-any.whl

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.

Potentially problematic release.


This version of fastapi-scaff might be problematic. Click here for more details.

fastapi_scaff/__init__.py CHANGED
@@ -7,4 +7,4 @@
7
7
  @history
8
8
  """
9
9
 
10
- __version__ = "0.2.1"
10
+ __version__ = "0.2.2"
@@ -43,7 +43,7 @@
43
43
  "app_celery/README.md": "# app-celery\n\n## \u7b80\u4ecb\n\n### producer\uff1a\u751f\u4ea7\u8005\uff08\u53d1\u5e03\u4efb\u52a1\uff09\n\n- register\uff1a\u6ce8\u518c\u4e2d\u5fc3\n - \u5c06`consumer`\u7684`tasks`\u6ce8\u518c\u5230`producer`\u7684`register`\u4e2d\n- publisher\uff1a\u53d1\u5e03\u8005\n - \u9879\u76ee\u4e2d\u901a\u8fc7\u53d1\u5e03\u8005\u6765\u53d1\u5e03\u4efb\u52a1\uff1a\u53ef\u53c2\u8003`app/api/default/aping.py`\uff08\u8fd9\u91cc\u53ea\u662f\u7b80\u5355\u793a\u4f8b\uff0c\u5b9e\u9645\u4e0a\u5e94\u8be5\u5728`services`\u5c42\u8c03\u7528\uff09\n\n### consumer\uff1a\u6d88\u8d39\u8005\uff08\u6267\u884c\u4efb\u52a1\uff09\n\n- tasks: \u4efb\u52a1\n - \u5b9a\u65f6\u4efb\u52a1\uff08beat_xxx\uff09\n - 1\u3002\u521b\u5efa\u5b9a\u65f6\u4efb\u52a1\n - 2\u3002\u53d1\u5e03\u5b9a\u65f6\u4efb\u52a1\uff08\u901a\u8fc7celery\u5185\u90e8\u7684`beat`\u8c03\u7528\uff09\n - \u8fdb\u5165`app_celery`\u7236\u7ea7\u76ee\u5f55\uff0c\u5373\u5de5\u4f5c\u76ee\u5f55\n - \u542f\u52a8\u547d\u4ee4\uff1a\uff08\u66f4\u591a\u53c2\u6570\u8bf7\u81ea\u884c\u6307\u5b9a\uff09\n - \u65b9\u5f0f1\u3002\u76f4\u63a5\u6267\u884c\u811a\u672c: `python runcbeat.py`\n - \u65b9\u5f0f2\u3002\u4f7f\u7528\u547d\u4ee4\u884c\uff1a`celery -A app_celery.consumer beat --loglevel=info --max-interval=5`\n - 3\u3002\u542f\u52a8\u6d88\u8d39\u8005worker\n - \u5f02\u6b65\u4efb\u52a1\uff08xxx)\n - 1\u3002\u521b\u5efa\u5f02\u6b65\u4efb\u52a1\uff0c\u5e76\u6ce8\u518c\u5230`producer`\u7684`register`\uff0c\u6839\u636e\u6ce8\u518c\u7684\u89c4\u5219\u8fdb\u884c`\u4efb\u52a1\u8c03\u7528`\u548c`worker\u542f\u52a8`\n - 2\u3002\u53d1\u5e03\u5f02\u6b65\u4efb\u52a1\uff08\u901a\u8fc7\u751f\u4ea7\u8005\u7684`publisher`\u8c03\u7528\uff09\n - \u53ef\u53c2\u8003`app/api/default/aping.py`\uff08\u8fd9\u91cc\u53ea\u662f\u7b80\u5355\u793a\u4f8b\uff0c\u5b9e\u9645\u4e0a\u5e94\u8be5\u5728`services`\u5c42\u8c03\u7528\uff09\n - 3\u3002\u542f\u52a8\u6d88\u8d39\u8005worker\n- workers: \u5de5\u4f5c\u8005\n - 1\u3002\u521b\u5efaworker\u670d\u52a1\uff0c\u5b9a\u4e49\u961f\u5217\u7b49\u5c5e\u6027\uff08\u4e3a\u65b9\u4fbf\u6269\u5c55\u5efa\u8bae\u4e00\u7c7b\u4efb\u52a1\u4e00\u4e2a\u670d\u52a1\uff09\n - 2\u3002\u542f\u52a8worker\u670d\u52a1\uff1a\n - 1\u3002\u8fdb\u5165`app_celery`\u7236\u7ea7\u76ee\u5f55\uff0c\u5373\u5de5\u4f5c\u76ee\u5f55\n - 2\u3002\u542f\u52a8\u547d\u4ee4\uff1a\uff08\u66f4\u591a\u53c2\u6570\u8bf7\u81ea\u884c\u6307\u5b9a\uff09\n - \u65b9\u5f0f1\u3002\u76f4\u63a5\u6267\u884c\u811a\u672c: `python runcworker.py -n ping`\n - \u65b9\u5f0f2\u3002\u4f7f\u7528\u547d\u4ee4\u884c\uff1a`celery -A app_celery.consumer.workers.ping worker --loglevel=info --concurrency=5 --queues=ping`\n\n### \u6ce8\u610f\uff1a\n\n- \u6700\u597d\u4e0e`app`\u89e3\u8026\uff0c\u5373\uff1a\n - \u53ea\u6709`app`\u5355\u5411\u8c03\u7528`app_celery`\n - \u4f46`app_celery`\u4e0d\u8c03\u7528`app`",
44
44
  "app_celery/requirements.txt": "# -*- coding: utf-8 -*-\n# Python>=3.11\ntoollib==1.7.8\npython-dotenv==1.1.1\nPyYAML==6.0.2\npydantic==2.11.9\ncelery==5.5.3\nredis==6.4.0\ngevent==25.9.1",
45
45
  "app_celery/__init__.py": "\"\"\"\n@author axiner\n@version v0.0.1\n@created 2025/09/20 10:10\n@abstract app-celery\n@description\n@history\n\"\"\"\nfrom celery import Celery\n\nfrom app_celery.conf import config\n\n\ndef make_celery(include: list = None, configs: dict = None):\n app = Celery(\n main=\"app_celery\",\n broker=config.celery_broker_url,\n backend=config.celery_backend_url,\n include=include,\n )\n app.conf.update(\n timezone=config.celery_timezone,\n enable_utc=config.celery_enable_utc,\n task_serializer=config.celery_task_serializer,\n result_serializer=config.celery_result_serializer,\n accept_content=config.celery_accept_content,\n celery_task_ignore_result=config.celery_task_ignore_result,\n celery_result_expire=config.celery_result_expire,\n celery_task_track_started=config.celery_task_track_started,\n worker_concurrency=config.celery_worker_concurrency,\n worker_prefetch_multiplier=config.celery_worker_prefetch_multiplier,\n worker_max_tasks_per_child=config.celery_worker_max_tasks_per_child,\n broker_connection_retry_on_startup=config.celery_broker_connection_retry_on_startup,\n task_reject_on_worker_lost=config.celery_task_reject_on_worker_lost,\n )\n if configs:\n app.conf.update(**configs)\n return app\n",
46
- "app_celery/consumer/__init__.py": "\"\"\"\n\u6d88\u8d39\u8005\n\"\"\"\nfrom pathlib import Path\n\nfrom app_celery import make_celery\n\n\ndef autodiscover_task_modules(\n tasks_name: str = \"tasks\",\n tasks_module: str = \"app_celery.consumer.tasks\",\n) -> list:\n here = Path(__file__).parent\n tasks_dir = here.joinpath(tasks_name)\n return [f\"{tasks_module}.{p.stem}\" for p in tasks_dir.rglob(\"*.py\") if p.stem != \"__init__\"]\n\n\ncelery_app = make_celery(\n include=autodiscover_task_modules()\n)\n",
46
+ "app_celery/consumer/__init__.py": "\"\"\"\n\u6d88\u8d39\u8005\n\"\"\"\nimport re\nfrom pathlib import Path\n\nfrom app_celery import make_celery\n\n\ndef autodiscover_task_modules(\n task_name: str = \"tasks\",\n task_module: str = \"app_celery.consumer.tasks\",\n) -> list:\n \"\"\"\n \u81ea\u52a8\u53d1\u73b0\u4efb\u52a1\u6a21\u5757\n - \u53ef\u5728\u6a21\u5757\u4e2d\u52a0\u5165`_active = False`\u6765\u53d6\u6d88\u6fc0\u6d3b\n \"\"\"\n task_modules = []\n active_pat = re.compile(r\"^_active\\s*=\\s*False\\s*(?:#.*)?$\", re.MULTILINE)\n for p in Path(__file__).parent.joinpath(task_name).rglob(\"*.py\"):\n if p.stem == \"__init__\":\n continue\n if active_pat.search(p.read_text(encoding=\"utf-8\")):\n continue\n task_modules.append(f\"{task_module}.{p.stem}\")\n return task_modules\n\n\ncelery_app = make_celery(\n include=autodiscover_task_modules()\n)\n",
47
47
  "app_celery/consumer/tasks/beat_ping.py": "import logging\n\nfrom celery.schedules import crontab\n\nfrom app_celery.consumer import celery_app\n\nlogger = logging.getLogger(__name__)\n\ncelery_app.conf.beat_schedule.setdefault(\n 'beat_ping', {\n 'task': 'app_celery.consumer.tasks.beat_ping.ping',\n 'schedule': crontab(minute='*/2'), # \u6bcfx\u5206\u949f\u6267\u884c\u4e00\u6b21\n 'options': {'queue': 'beat_ping'}\n }\n)\n\n\n@celery_app.task(\n bind=True,\n autoretry_for=(Exception,),\n max_retries=3,\n retry_backoff=True,\n retry_backoff_max=300,\n retry_jitter=True,\n time_limit=360,\n soft_time_limit=300,\n acks_late=True,\n)\ndef ping(self, text: str = \"\u8fd9\u662f\u4e00\u4e2a\u5b9a\u65f6\u4efb\u52a1\u6d4b\u8bd5\"):\n logger.info(f\"pong: {text}\")\n",
48
48
  "app_celery/consumer/tasks/ping.py": "import logging\n\nfrom app_celery.consumer import celery_app\n\nlogger = logging.getLogger(__name__)\n\n\n@celery_app.task(\n bind=True,\n autoretry_for=(Exception,),\n max_retries=3,\n retry_backoff=True,\n retry_backoff_max=300,\n retry_jitter=True,\n time_limit=360,\n soft_time_limit=300,\n acks_late=True,\n)\ndef ping(self, text: str = \"\u8fd9\u662f\u4e00\u4e2a\u5f02\u6b65\u4efb\u52a1\u6d4b\u8bd5\"):\n logger.info(f\"pong: {text}\")\n",
49
49
  "app_celery/consumer/tasks/__init__.py": "\"\"\"\n\u5f02\u6b65\u4efb\u52a1\n\"\"\"\n",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fastapi-scaff
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: This is a fastapi scaff.
5
5
  Author-email: axiner <atpuxiner@163.com>
6
6
  Project-URL: Homepage, https://github.com/atpuxiner/fastapi-scaff
@@ -0,0 +1,10 @@
1
+ fastapi_scaff/__init__.py,sha256=ntLmbW5B79c3hRJ4eONE0yQgie2RxVRY5KxrgrqPMB8,120
2
+ fastapi_scaff/__main__.py,sha256=T5ODMU9Ge5jDz0F1EXjbvKhNZPMWWy2gmln8RoXwtPY,13220
3
+ fastapi_scaff/_api_tpl.json,sha256=8oQC2cb9yD1azuOpxvTeY98hxq0U7lXJB0cd_D6jCe4,6795
4
+ fastapi_scaff/_project_tpl.json,sha256=kYz-Sm85iRp65wwhsbWZCaPdqWCEvlsc_rIkdeAhzak,90195
5
+ fastapi_scaff-0.2.2.dist-info/licenses/LICENSE,sha256=A5H6q7zd1QrL3iVs1KLsBOG0ImV-t9PpPspM4x-4Ea8,1069
6
+ fastapi_scaff-0.2.2.dist-info/METADATA,sha256=8uch8Eiq9vq1cQFMOSlObwWoOEx3ekQ-a8dGEAxQDkI,3503
7
+ fastapi_scaff-0.2.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
+ fastapi_scaff-0.2.2.dist-info/entry_points.txt,sha256=kzs28nmpRWVCmWmZav3X7u7YOIOEir3sCkLnvQKTJbY,62
9
+ fastapi_scaff-0.2.2.dist-info/top_level.txt,sha256=LeyfUxMRhdbRHcYoH37ftfdspyZ8V3Uut2YBaTCzq2k,14
10
+ fastapi_scaff-0.2.2.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- fastapi_scaff/__init__.py,sha256=yVFA3VsLyVoXVbQFNkBeP1yZ5boVDP22hz5TVsKPq4s,120
2
- fastapi_scaff/__main__.py,sha256=T5ODMU9Ge5jDz0F1EXjbvKhNZPMWWy2gmln8RoXwtPY,13220
3
- fastapi_scaff/_api_tpl.json,sha256=8oQC2cb9yD1azuOpxvTeY98hxq0U7lXJB0cd_D6jCe4,6795
4
- fastapi_scaff/_project_tpl.json,sha256=mytijZXmGWSD9JUdPM_f4rk0NRNyGu4mg_Sk_AZ-ZiE,89784
5
- fastapi_scaff-0.2.1.dist-info/licenses/LICENSE,sha256=A5H6q7zd1QrL3iVs1KLsBOG0ImV-t9PpPspM4x-4Ea8,1069
6
- fastapi_scaff-0.2.1.dist-info/METADATA,sha256=-czo--KruWptsWzBKu0xAutd0HWVUGOxUXHIWb3VAFA,3503
7
- fastapi_scaff-0.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
- fastapi_scaff-0.2.1.dist-info/entry_points.txt,sha256=kzs28nmpRWVCmWmZav3X7u7YOIOEir3sCkLnvQKTJbY,62
9
- fastapi_scaff-0.2.1.dist-info/top_level.txt,sha256=LeyfUxMRhdbRHcYoH37ftfdspyZ8V3Uut2YBaTCzq2k,14
10
- fastapi_scaff-0.2.1.dist-info/RECORD,,