@vercel/python 6.30.1 → 6.31.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 +20 -6
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -3582,7 +3582,9 @@ function useVirtualEnv(workPath, env, systemPython) {
3582
3582
  function createVenvEnv(venvPath, baseEnv = process.env, uvCacheDir) {
3583
3583
  const env = {
3584
3584
  ...getProtectedUvEnv(baseEnv, uvCacheDir),
3585
- VIRTUAL_ENV: venvPath
3585
+ VIRTUAL_ENV: venvPath,
3586
+ UV_PROJECT_ENVIRONMENT: venvPath,
3587
+ UV_NO_DEV: "true"
3586
3588
  };
3587
3589
  const binDir = getVenvBinDir(venvPath);
3588
3590
  const existingPath = env.PATH || process.env.PATH || "";
@@ -5236,8 +5238,9 @@ async function detectDjangoPythonEntrypoint(workPath) {
5236
5238
  }
5237
5239
  async function detectPythonEntrypoint(framework, workPath, configuredEntrypoint, service) {
5238
5240
  if (configuredEntrypoint) {
5239
- const entrypoint = configuredEntrypoint.endsWith(".py") ? configuredEntrypoint : `${configuredEntrypoint}.py`;
5240
- let varName = await checkEntrypoint(workPath, entrypoint);
5241
+ const { filePath: configEntryFile, varName: configEntryVar } = configuredEntrypoint;
5242
+ const entrypoint = configEntryFile.endsWith(".py") ? configEntryFile : `${configEntryFile}.py`;
5243
+ let varName = configEntryVar ?? await checkEntrypoint(workPath, entrypoint);
5241
5244
  if (!varName) {
5242
5245
  const isSpecialService = service?.type === "cron" || service?.type === "worker";
5243
5246
  if (isSpecialService) {
@@ -5811,10 +5814,16 @@ var startDevServer = async (opts) => {
5811
5814
  const env = { ...process.env, ...meta.env || {} };
5812
5815
  const entrypoint = rawEntrypoint === "<detect>" ? void 0 : rawEntrypoint;
5813
5816
  let resolved;
5817
+ const handlerFunction = typeof config?.handlerFunction === "string" ? config.handlerFunction : void 0;
5814
5818
  const detected = await detectPythonEntrypoint(
5815
5819
  framework,
5816
5820
  workPath,
5817
- entrypoint,
5821
+ entrypoint ? {
5822
+ filePath: entrypoint,
5823
+ // For cron services, the WSGI variable is always 'app' (created dynamically).
5824
+ // For other services, handlerFunction is used as the entrypoint variable name.
5825
+ varName: service?.type === "cron" ? void 0 : handlerFunction
5826
+ } : void 0,
5818
5827
  service
5819
5828
  );
5820
5829
  if (detected?.entrypoint) {
@@ -6731,10 +6740,16 @@ var build = async ({
6731
6740
  throw err;
6732
6741
  }
6733
6742
  let detected;
6743
+ const handlerFunction = typeof config?.handlerFunction === "string" ? config.handlerFunction : void 0;
6734
6744
  detected = await detectPythonEntrypoint(
6735
6745
  config.framework,
6736
6746
  workPath,
6737
- entrypoint,
6747
+ entrypoint ? {
6748
+ filePath: entrypoint,
6749
+ // For cron services, the WSGI variable is always 'app' (created dynamically).
6750
+ // For other services, handlerFunction is used as the entrypoint variable name.
6751
+ varName: service?.type === "cron" ? void 0 : handlerFunction
6752
+ } : void 0,
6738
6753
  service
6739
6754
  ) ?? void 0;
6740
6755
  if (detected?.error && detected?.baseDir === void 0) {
@@ -6957,7 +6972,6 @@ var build = async ({
6957
6972
  }
6958
6973
  (0, import_build_utils15.debug)("Entrypoint is", entrypoint);
6959
6974
  const moduleName = entrypoint.replace(/\//g, ".").replace(/\.py$/i, "");
6960
- const handlerFunction = typeof config?.handlerFunction === "string" ? config.handlerFunction : void 0;
6961
6975
  if (handlerFunction) {
6962
6976
  const entrypointPath = (0, import_path13.join)(workPath, entrypoint);
6963
6977
  const source = await import_fs12.default.promises.readFile(entrypointPath, "utf-8");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/python",
3
- "version": "6.30.1",
3
+ "version": "6.31.0",
4
4
  "main": "./dist/index.js",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
@@ -36,9 +36,9 @@
36
36
  "smol-toml": "1.5.2",
37
37
  "vitest": "2.1.4",
38
38
  "which": "3.0.0",
39
- "@vercel/build-utils": "13.14.2",
40
- "@vercel/error-utils": "2.0.3",
41
- "@vercel/python-runtime": "0.12.0"
39
+ "@vercel/build-utils": "13.15.0",
40
+ "@vercel/python-runtime": "0.12.0",
41
+ "@vercel/error-utils": "2.0.3"
42
42
  },
43
43
  "scripts": {
44
44
  "build": "node ../../utils/build-builder.mjs",