@vercel/python 6.9.0 → 6.10.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/python",
3
- "version": "6.9.0",
3
+ "version": "6.10.0",
4
4
  "main": "./dist/index.js",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
@@ -31,7 +31,7 @@
31
31
  "smol-toml": "1.5.2",
32
32
  "vitest": "2.1.4",
33
33
  "which": "3.0.0",
34
- "@vercel/build-utils": "13.3.3",
34
+ "@vercel/build-utils": "13.3.4",
35
35
  "@vercel/error-utils": "2.0.3"
36
36
  },
37
37
  "scripts": {
@@ -75,13 +75,23 @@ async def app(scope, receive, send):
75
75
 
76
76
 
77
77
  if __name__ == '__main__':
78
- # Development runner for ASGI: prefer uvicorn, then hypercorn.
78
+ # Development runner for ASGI: prefer fastapi dev, then uvicorn, then hypercorn.
79
79
  # Bind to localhost on an ephemeral port and emit a recognizable log line
80
80
  # so the caller can detect the bound port.
81
81
  host = '127.0.0.1'
82
+
83
+ try:
84
+ from fastapi_cli.cli import dev
85
+ except ImportError:
86
+ dev = None
87
+
88
+ if dev is not None:
89
+ dev(entrypoint='vc_init_dev_asgi:app', host=host, port=0, reload=True)
90
+ sys.exit(0)
91
+
82
92
  try:
83
93
  import uvicorn
84
- uvicorn.run('vc_init_dev_asgi:app', host=host, port=0, use_colors=True)
94
+ uvicorn.run('vc_init_dev_asgi:app', host=host, port=0, use_colors=True, reload=True)
85
95
  except Exception:
86
96
  try:
87
97
  import asyncio
@@ -112,7 +112,7 @@ if __name__ == "__main__":
112
112
  host = "127.0.0.1"
113
113
  try:
114
114
  from werkzeug.serving import run_simple
115
- run_simple(host, 0, app, use_reloader=False)
115
+ run_simple(host, 0, app, use_reloader=True)
116
116
  except Exception:
117
117
  import sys
118
118
  print(_color("Werkzeug not installed; falling back to wsgiref (no reloader).", _YELLOW), file=sys.stderr)