@vercel/python 2.0.6-canary.6 → 2.1.2-canary.1

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 +25 -4
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -3601,10 +3601,22 @@ const build = async ({ workPath, files: originalFiles, entrypoint, meta = {}, co
3601
3601
  try {
3602
3602
  const json = await readFile(path_1.join(pipfileLockDir, 'Pipfile.lock'), 'utf8');
3603
3603
  const obj = JSON.parse(json);
3604
- if (!meta.isDev && ((_b = (_a = obj === null || obj === void 0 ? void 0 : obj._meta) === null || _a === void 0 ? void 0 : _a.requires) === null || _b === void 0 ? void 0 : _b.python_version) === '3.6') {
3605
- pipPath = 'pip3.6';
3606
- pythonPath = 'python3.6';
3607
- pythonRuntime = 'python3.6';
3604
+ const version = (_b = (_a = obj === null || obj === void 0 ? void 0 : obj._meta) === null || _a === void 0 ? void 0 : _a.requires) === null || _b === void 0 ? void 0 : _b.python_version;
3605
+ if (!meta.isDev) {
3606
+ if (version === '3.6') {
3607
+ pipPath = 'pip3.6';
3608
+ pythonPath = 'python3.6';
3609
+ pythonRuntime = 'python3.6';
3610
+ console.warn(`Warning: Python version "${version}" detected in Pipfile.lock will reach End-Of-Life December 2021. Please upgrade. http://vercel.link/python-version`);
3611
+ }
3612
+ else if (version === '3.9') {
3613
+ pipPath = 'pip3.9';
3614
+ pythonPath = 'python3.9';
3615
+ pythonRuntime = 'python3.9';
3616
+ }
3617
+ else {
3618
+ console.warn(`Warning: Invalid Python version "${version}" detected in Pipfile.lock will be ignored. http://vercel.link/python-version`);
3619
+ }
3608
3620
  }
3609
3621
  }
3610
3622
  catch (err) {
@@ -3703,6 +3715,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3703
3715
  };
3704
3716
  Object.defineProperty(exports, "__esModule", ({ value: true }));
3705
3717
  exports.installRequirementsFile = exports.installRequirement = void 0;
3718
+ const path_1 = __webpack_require__(622);
3706
3719
  const execa_1 = __importDefault(__webpack_require__(580));
3707
3720
  const build_utils_1 = __webpack_require__(445);
3708
3721
  const makeDependencyCheckCode = (dependency) => `
@@ -3785,6 +3798,14 @@ async function installRequirement({ pythonPath, pipPath, dependency, version, wo
3785
3798
  }
3786
3799
  exports.installRequirement = installRequirement;
3787
3800
  async function installRequirementsFile({ pythonPath, pipPath, filePath, workPath, meta, args = [], }) {
3801
+ const fileAtRoot = path_1.relative(workPath, filePath) === path_1.basename(filePath);
3802
+ // If the `requirements.txt` file is located in the Root Directory of the project and
3803
+ // the new File System API is used (`avoidTopLevelInstall`), the Install Command
3804
+ // will have already installed its dependencies, so we don't need to do it again.
3805
+ if (meta.avoidTopLevelInstall && fileAtRoot) {
3806
+ build_utils_1.debug(`Skipping requirements file installation, already installed by Install Command`);
3807
+ return;
3808
+ }
3788
3809
  if (meta.isDev &&
3789
3810
  (await areRequirementsInstalled(pythonPath, filePath, workPath))) {
3790
3811
  build_utils_1.debug(`Skipping requirements file installation, already installed`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/python",
3
- "version": "2.0.6-canary.6",
3
+ "version": "2.1.2-canary.1",
4
4
  "main": "./dist/index.js",
5
5
  "license": "MIT",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
@@ -24,5 +24,5 @@
24
24
  "execa": "^1.0.0",
25
25
  "typescript": "4.3.4"
26
26
  },
27
- "gitHead": "4aa6a139127e4e57469d4b6785546ccb49ca188b"
27
+ "gitHead": "1202ff7b2b8a821c6404a86baa12996f3078ed36"
28
28
  }