@vercel/python 6.20.1 → 6.21.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,13 +1,13 @@
1
1
  {
2
2
  "name": "@vercel/python",
3
- "version": "6.20.1",
3
+ "version": "6.21.0",
4
4
  "main": "./dist/index.js",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
7
7
  "files": [
8
8
  "dist",
9
- "vc_init.py",
10
- "vc_init_dev.py"
9
+ "templates",
10
+ "vc_init.py"
11
11
  ],
12
12
  "repository": {
13
13
  "type": "git",
@@ -15,7 +15,7 @@
15
15
  "directory": "packages/python"
16
16
  },
17
17
  "dependencies": {
18
- "@vercel/python-analysis": "0.8.1"
18
+ "@vercel/python-analysis": "0.9.0"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@renovatebot/pep440": "4.2.1",
@@ -35,9 +35,9 @@
35
35
  "which": "3.0.0",
36
36
  "get-port": "5.1.1",
37
37
  "is-port-reachable": "3.1.0",
38
- "@vercel/build-utils": "13.6.2",
39
- "@vercel/python-runtime": "0.5.5",
40
- "@vercel/error-utils": "2.0.3"
38
+ "@vercel/build-utils": "13.7.0",
39
+ "@vercel/error-utils": "2.0.3",
40
+ "@vercel/python-runtime": "0.6.0"
41
41
  },
42
42
  "scripts": {
43
43
  "build": "node ../../utils/build-builder.mjs",
@@ -0,0 +1,36 @@
1
+ """
2
+ Discover Django settings by running manage.py with a patched
3
+ execute_from_command_line. This lets manage.py set DJANGO_SETTINGS_MODULE
4
+ via whatever mechanism it uses (os.environ.setdefault, conditionals, etc.),
5
+ then loads the settings module and prints all uppercase attributes as JSON.
6
+ """
7
+
8
+ import os, sys, json, runpy
9
+ import django.core.management
10
+
11
+
12
+ class _Escape(Exception):
13
+ pass
14
+
15
+
16
+ def _stop(*a, **kw):
17
+ raise _Escape
18
+
19
+
20
+ django.core.management.execute_from_command_line = _stop
21
+
22
+ sys.argv = ["manage.py"]
23
+ try:
24
+ runpy.run_path("manage.py", run_name="__main__")
25
+ except _Escape:
26
+ pass
27
+
28
+ settings_module = os.environ.get("DJANGO_SETTINGS_MODULE")
29
+ if not settings_module:
30
+ print(json.dumps(None))
31
+ else:
32
+ import importlib
33
+
34
+ mod = importlib.import_module(settings_module)
35
+ settings = {k: getattr(mod, k) for k in dir(mod) if k.isupper()}
36
+ print(json.dumps(settings, default=str))
File without changes