mirror of
https://github.com/fastapi-practices/fastapi_best_architecture.git
synced 2026-03-13 09:31:31 +08:00
Add backend scripts description (#309)
This commit is contained in:
@@ -58,3 +58,21 @@
|
||||
5. Commit and push your changes
|
||||
|
||||
Commit your changes, push your branch to GitHub, and create a pull request.
|
||||
|
||||
## Scripts
|
||||
|
||||
> [!WARNING]
|
||||
>
|
||||
> The following script may not apply to the Windows platform
|
||||
>
|
||||
> It is recommended to execute under the backend directory, and chmod authorization may be required
|
||||
|
||||
- `pre_start.sh`: Perform automatic database migration and create database tables
|
||||
|
||||
- `celery-start.sh`: For celery docker script, implementation is not recommended
|
||||
|
||||
- `format.sh`: Perform ruff format check
|
||||
|
||||
- `lint.sh`: Perform pre-commit formatting
|
||||
|
||||
- `pdm_export.sh`: Execute pdm export dependency package
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
# ruff: noqa: I001
|
||||
import asyncio
|
||||
import os
|
||||
import sys
|
||||
|
||||
2
backend/pre_start.sh
Normal file → Executable file
2
backend/pre_start.sh
Normal file → Executable file
@@ -1,5 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
alembic revision --autogenerate
|
||||
|
||||
alembic upgrade head
|
||||
|
||||
python ./scripts/init_data.py
|
||||
|
||||
@@ -61,7 +61,7 @@ deploy = [
|
||||
]
|
||||
|
||||
[tool.pdm]
|
||||
package-type = "application"
|
||||
distribution = false
|
||||
|
||||
[tool.pdm.scripts]
|
||||
lint = "pre-commit run --all-files"
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
# ruff: noqa: I001
|
||||
import logging
|
||||
import sys
|
||||
|
||||
from anyio import run
|
||||
|
||||
sys.path.append('../')
|
||||
|
||||
from backend.database.db_mysql import create_table
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
|
||||
Reference in New Issue
Block a user