@vercel/python 6.4.1 → 6.5.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.
Files changed (2) hide show
  1. package/dist/index.js +23 -10
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -2751,6 +2751,11 @@ module.exports = __toCommonJS(src_exports);
2751
2751
  var import_fs5 = __toESM(require("fs"));
2752
2752
  var import_util = require("util");
2753
2753
  var import_path7 = require("path");
2754
+
2755
+ // src/runtime-version.ts
2756
+ var VERCEL_RUNTIME_VERSION = "0.3.0";
2757
+
2758
+ // src/index.ts
2754
2759
  var import_build_utils8 = require("@vercel/build-utils");
2755
2760
 
2756
2761
  // src/install.ts
@@ -3501,9 +3506,11 @@ async function detectInstallSource({
3501
3506
  async function createPyprojectToml({
3502
3507
  projectName,
3503
3508
  pyprojectPath,
3504
- dependencies
3509
+ dependencies,
3510
+ pythonVersion
3505
3511
  }) {
3506
- const requiresPython = `~=${DEFAULT_PYTHON_VERSION}.0`;
3512
+ const version2 = pythonVersion ?? DEFAULT_PYTHON_VERSION;
3513
+ const requiresPython = `~=${version2}.0`;
3507
3514
  const depsToml = dependencies.length > 0 ? [
3508
3515
  "dependencies = [",
3509
3516
  ...dependencies.map((dep) => ` "${dep}",`),
@@ -3562,6 +3569,7 @@ async function ensureUvProject({
3562
3569
  repoRootPath,
3563
3570
  pythonPath,
3564
3571
  pipPath,
3572
+ pythonVersion,
3565
3573
  uv,
3566
3574
  venvPath,
3567
3575
  meta,
@@ -3625,7 +3633,8 @@ async function ensureUvProject({
3625
3633
  await createPyprojectToml({
3626
3634
  projectName: "app",
3627
3635
  pyprojectPath,
3628
- dependencies: []
3636
+ dependencies: [],
3637
+ pythonVersion
3629
3638
  });
3630
3639
  }
3631
3640
  await uv.addFromFile({
@@ -3648,7 +3657,8 @@ async function ensureUvProject({
3648
3657
  await createPyprojectToml({
3649
3658
  projectName: "app",
3650
3659
  pyprojectPath,
3651
- dependencies: []
3660
+ dependencies: [],
3661
+ pythonVersion
3652
3662
  });
3653
3663
  }
3654
3664
  await uv.addFromFile({
@@ -3665,7 +3675,8 @@ async function ensureUvProject({
3665
3675
  await createPyprojectToml({
3666
3676
  projectName: "app",
3667
3677
  pyprojectPath,
3668
- dependencies: []
3678
+ dependencies: [],
3679
+ pythonVersion
3669
3680
  });
3670
3681
  await uv.lock(projectDir);
3671
3682
  }
@@ -4547,12 +4558,13 @@ var build = async ({
4547
4558
  const runtimeDependencies = [];
4548
4559
  if (useRuntime) {
4549
4560
  runtimeDependencies.push(
4550
- baseEnv.VERCEL_RUNTIME_PYTHON || "vercel-runtime==0.1.0"
4561
+ baseEnv.VERCEL_RUNTIME_PYTHON || `vercel-runtime==${VERCEL_RUNTIME_VERSION}`
4551
4562
  );
4552
- }
4553
- runtimeDependencies.push("werkzeug>=1.0.1");
4554
- if (framework !== "flask") {
4555
- runtimeDependencies.push("uvicorn>=0.24");
4563
+ } else {
4564
+ runtimeDependencies.push("werkzeug>=1.0.1");
4565
+ if (framework !== "flask") {
4566
+ runtimeDependencies.push("uvicorn>=0.24");
4567
+ }
4556
4568
  }
4557
4569
  const { projectDir } = await ensureUvProject({
4558
4570
  workPath,
@@ -4561,6 +4573,7 @@ var build = async ({
4561
4573
  repoRootPath,
4562
4574
  pythonPath: pythonVersion.pythonPath,
4563
4575
  pipPath: pythonVersion.pipPath,
4576
+ pythonVersion: pythonVersion.version,
4564
4577
  uv,
4565
4578
  venvPath,
4566
4579
  meta,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/python",
3
- "version": "6.4.1",
3
+ "version": "6.5.0",
4
4
  "main": "./dist/index.js",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
@@ -30,8 +30,8 @@
30
30
  "pip-requirements-js": "1.0.2",
31
31
  "smol-toml": "1.5.2",
32
32
  "which": "3.0.0",
33
- "@vercel/error-utils": "2.0.3",
34
- "@vercel/build-utils": "13.2.16"
33
+ "@vercel/build-utils": "13.2.16",
34
+ "@vercel/error-utils": "2.0.3"
35
35
  },
36
36
  "scripts": {
37
37
  "build": "node ../../utils/build-builder.mjs",