Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b94608ffe3 | ||
|
|
ef6bce8f3f | ||
|
|
b8bf46132a | ||
|
|
ca85c2fcfb |
@@ -42,7 +42,7 @@ def ruff_sort_imports(files: list[Path], dry_run: bool = False) -> None:
|
|||||||
return
|
return
|
||||||
print("🔧 Ruff isort on modified files")
|
print("🔧 Ruff isort on modified files")
|
||||||
subprocess.run(
|
subprocess.run(
|
||||||
["ruff", "check", "--select", "I", "--fix", *py_files],
|
[sys.executable, "-m", "ruff", "check", "--select", "I", "--fix", *py_files],
|
||||||
stdout=subprocess.DEVNULL,
|
stdout=subprocess.DEVNULL,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -842,7 +842,9 @@ def patch_frontend_health_check(frontend_dir: Path, dry_run: bool = False) -> bo
|
|||||||
|
|
||||||
# SHA-256 of old vite-plugin-fastapi.js (before auto-upgrade marker was added)
|
# SHA-256 of old vite-plugin-fastapi.js (before auto-upgrade marker was added)
|
||||||
# with module name replaced by MODULE_NAME in the outDir path
|
# with module name replaced by MODULE_NAME in the outDir path
|
||||||
_OLD_VITE_PLUGIN_SHA256 = "93713e879c15a25c750a70ce1de684adeaf11b0c723c38da56e5e7ba207f6632"
|
_OLD_VITE_PLUGIN_SHA256 = (
|
||||||
|
"93713e879c15a25c750a70ce1de684adeaf11b0c723c38da56e5e7ba207f6632"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def _upgrade_old_vite_plugin(
|
def _upgrade_old_vite_plugin(
|
||||||
@@ -861,7 +863,9 @@ def _upgrade_old_vite_plugin(
|
|||||||
return # Already new format, write_file handles it
|
return # Already new format, write_file handles it
|
||||||
import hashlib
|
import hashlib
|
||||||
|
|
||||||
normalized = content.replace(f"../{module_name}/frontend-build", "../MODULE_NAME/frontend-build")
|
normalized = content.replace(
|
||||||
|
f"../{module_name}/frontend-build", "../MODULE_NAME/frontend-build"
|
||||||
|
)
|
||||||
digest = hashlib.sha256(normalized.encode()).hexdigest()
|
digest = hashlib.sha256(normalized.encode()).hexdigest()
|
||||||
if digest != _OLD_VITE_PLUGIN_SHA256:
|
if digest != _OLD_VITE_PLUGIN_SHA256:
|
||||||
return # Modified by user, don't touch
|
return # Modified by user, don't touch
|
||||||
|
|||||||
@@ -17,11 +17,12 @@ def main():
|
|||||||
help=(f"Endpoint (default: localhost:{DEFAULT_PORT})."),
|
help=(f"Endpoint (default: localhost:{DEFAULT_PORT})."),
|
||||||
)
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
dev = {"reload": True, "reload_dirs": ["MODULE_NAME"]}
|
||||||
server.run(
|
server.run(
|
||||||
"MODULE_NAME.APP_MODULE:APP_VAR",
|
"MODULE_NAME.APP_MODULE:APP_VAR",
|
||||||
listen=args.listen,
|
listen=args.listen,
|
||||||
default_port=DEFAULT_PORT,
|
default_port=DEFAULT_PORT,
|
||||||
reload=DEVMODE,
|
**(dev if DEVMODE else {}),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -207,10 +207,5 @@ def setup_cli(
|
|||||||
host = endpoints[0]["host"]
|
host = endpoints[0]["host"]
|
||||||
port = endpoints[0]["port"]
|
port = endpoints[0]["port"]
|
||||||
|
|
||||||
cmd = [
|
cmd = [cli, f"--listen={host}:{port}"]
|
||||||
sys.executable,
|
|
||||||
"-m",
|
|
||||||
cli,
|
|
||||||
f"--listen={host}:{port}",
|
|
||||||
]
|
|
||||||
return f"http://{host}:{port}", cmd
|
return f"http://{host}:{port}", cmd
|
||||||
|
|||||||
Reference in New Issue
Block a user