Compare commits

...

5 Commits

Author SHA1 Message Date
Steven
f4501433c8 Publish Canary
- vercel@23.1.3-canary.38
 - vercel-plugin-python@1.0.0-canary.6
 - @vercel/python@2.0.6-canary.7
2021-11-22 18:43:37 -05:00
Steven
19831593ce [python] Add warning for deprecated version (#7053)
- Print warning when python 3.6 is selected
- Print warning when invalid python version is selected
2021-11-22 23:36:30 +00:00
Steven
5d85bb1426 [tests] Bump cancel action to 0.9.1 (#7055) 2021-11-22 17:24:35 -05:00
Andy Bitz
f194d54b0c Publish Canary
- vercel@23.1.3-canary.37
2021-11-22 23:14:32 +01:00
Andy
6542086843 Revert "[cli] Switch from hardlinks to symlinks in vc build" (#7054)
* Revert "[cli] Switch from hardlinks to symlinks in vc build (#7026)"

This reverts commit 6dff0875f5.

* Keep copy logic
2021-11-22 23:12:46 +01:00
14 changed files with 66 additions and 34 deletions

View File

@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 2 timeout-minutes: 2
steps: steps:
- uses: styfle/cancel-workflow-action@0.4.1 - uses: styfle/cancel-workflow-action@0.9.1
with: with:
workflow_id: 849295, 849296, 849297, 849298 workflow_id: 849295, 849296, 849297, 849298
access_token: ${{ github.token }} access_token: ${{ github.token }}

View File

@@ -332,7 +332,7 @@ This is an abstract enumeration type that is implemented by one of the following
- `nodejs10.x` - `nodejs10.x`
- `go1.x` - `go1.x`
- `java11` - `java11`
- `python3.8` - `python3.9`
- `python3.6` - `python3.6`
- `dotnetcore2.1` - `dotnetcore2.1`
- `ruby2.5` - `ruby2.5`
@@ -398,12 +398,12 @@ This utility allows you to _scan_ the filesystem and return a [`Files`](#files)
The following trivial example downloads everything to the filesystem, only to return it back (therefore just re-creating the passed-in [`Files`](#files)): The following trivial example downloads everything to the filesystem, only to return it back (therefore just re-creating the passed-in [`Files`](#files)):
```js ```js
const { glob, download } = require('@vercel/build-utils') const { glob, download } = require('@vercel/build-utils');
exports.build = ({ files, workPath }) => { exports.build = ({ files, workPath }) => {
await download(files, workPath) await download(files, workPath);
return glob('**', workPath) return glob('**', workPath);
} };
``` ```
### `getWritableDirectory()` ### `getWritableDirectory()`

View File

@@ -1,6 +1,6 @@
{ {
"name": "vercel", "name": "vercel",
"version": "23.1.3-canary.36", "version": "23.1.3-canary.38",
"preferGlobal": true, "preferGlobal": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"description": "The command-line interface for Vercel", "description": "The command-line interface for Vercel",
@@ -46,7 +46,7 @@
"@vercel/build-utils": "2.12.3-canary.20", "@vercel/build-utils": "2.12.3-canary.20",
"@vercel/go": "1.2.4-canary.4", "@vercel/go": "1.2.4-canary.4",
"@vercel/node": "1.12.2-canary.7", "@vercel/node": "1.12.2-canary.7",
"@vercel/python": "2.0.6-canary.6", "@vercel/python": "2.0.6-canary.7",
"@vercel/ruby": "1.2.8-canary.4", "@vercel/ruby": "1.2.8-canary.4",
"update-notifier": "4.1.0", "update-notifier": "4.1.0",
"vercel-plugin-middleware": "0.0.0-canary.7", "vercel-plugin-middleware": "0.0.0-canary.7",

View File

@@ -687,7 +687,7 @@ async function linkOrCopy(existingPath: string, newPath: string) {
overwrite: true, overwrite: true,
}); });
} else { } else {
await fs.createSymlink(existingPath, newPath, 'file'); await fs.createLink(existingPath, newPath);
} }
} catch (err: any) { } catch (err: any) {
// eslint-disable-line // eslint-disable-line

View File

@@ -1,7 +1,7 @@
{ {
"private": false, "private": false,
"name": "vercel-plugin-python", "name": "vercel-plugin-python",
"version": "1.0.0-canary.5", "version": "1.0.0-canary.6",
"main": "dist/index.js", "main": "dist/index.js",
"license": "MIT", "license": "MIT",
"files": [ "files": [
@@ -18,7 +18,7 @@
}, },
"dependencies": { "dependencies": {
"@vercel/build-utils": "2.12.3-canary.20", "@vercel/build-utils": "2.12.3-canary.20",
"@vercel/python": "2.0.6-canary.6" "@vercel/python": "2.0.6-canary.7"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "*", "@types/node": "*",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@vercel/python", "name": "@vercel/python",
"version": "2.0.6-canary.6", "version": "2.0.6-canary.7",
"main": "./dist/index.js", "main": "./dist/index.js",
"license": "MIT", "license": "MIT",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/python", "homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",

View File

@@ -114,10 +114,24 @@ export const build = async ({
try { try {
const json = await readFile(join(pipfileLockDir, 'Pipfile.lock'), 'utf8'); const json = await readFile(join(pipfileLockDir, 'Pipfile.lock'), 'utf8');
const obj = JSON.parse(json); const obj = JSON.parse(json);
if (!meta.isDev && obj?._meta?.requires?.python_version === '3.6') { const version = obj?._meta?.requires?.python_version;
if (!meta.isDev) {
if (version === '3.6') {
pipPath = 'pip3.6'; pipPath = 'pip3.6';
pythonPath = 'python3.6'; pythonPath = 'python3.6';
pythonRuntime = 'python3.6'; pythonRuntime = 'python3.6';
console.warn(
`Warning: Python version "${version}" detected in Pipfile.lock will reach End-Of-Life December 2021. Please upgrade. http://vercel.link/python-version`
);
} else if (version === '3.9') {
pipPath = 'pip3.9';
pythonPath = 'python3.9';
pythonRuntime = 'python3.9';
} else {
console.warn(
`Warning: Invalid Python version "${version}" detected in Pipfile.lock will be ignored. http://vercel.link/python-version`
);
}
} }
} catch (err) { } catch (err) {
throw new NowBuildError({ throw new NowBuildError({

View File

@@ -1,5 +0,0 @@
{
"version": 2,
"builds": [{ "src": "index.py", "use": "@vercel/python" }],
"probes": [{ "path": "/", "mustContain": "wsgi:RANDOMNESS_PLACEHOLDER" }]
}

View File

@@ -0,0 +1,11 @@
{
"version": 2,
"builds": [{ "src": "index.py", "use": "@vercel/python" }],
"probes": [
{
"path": "/",
"mustContain": "wsgi:RANDOMNESS_PLACEHOLDER",
"logMustContain": "Warning: Python version \"3.6\" detected in Pipfile.lock will reach End-Of-Life December 2021. Please upgrade."
}
]
}

View File

@@ -1,8 +0,0 @@
{
"version": 2,
"builds": [{ "src": "index.py", "use": "@vercel/python" }],
"env": {
"RANDOMNESS": "RANDOMNESS_PLACEHOLDER"
},
"probes": [{ "path": "/", "mustContain": "RANDOMNESS_PLACEHOLDER:env" }]
}

View File

@@ -0,0 +1,14 @@
{
"version": 2,
"builds": [{ "src": "index.py", "use": "@vercel/python" }],
"env": {
"RANDOMNESS": "RANDOMNESS_PLACEHOLDER"
},
"probes": [
{
"path": "/",
"mustContain": "RANDOMNESS_PLACEHOLDER:env",
"logMustContain": "Warning: Python version \"3.6\" detected in Pipfile.lock will reach End-Of-Life December 2021. Please upgrade."
}
]
}

View File

@@ -1,5 +0,0 @@
{
"version": 2,
"builds": [{ "src": "**/**.py", "use": "@vercel/python" }],
"probes": [{ "path": "/", "mustContain": "pip:RANDOMNESS_PLACEHOLDER" }]
}

View File

@@ -0,0 +1,11 @@
{
"version": 2,
"builds": [{ "src": "**/**.py", "use": "@vercel/python" }],
"probes": [
{
"path": "/",
"mustContain": "pip:RANDOMNESS_PLACEHOLDER",
"logMustContain": "Warning: Invalid Python version \"3.7\" detected in Pipfile.lock will be ignored."
}
]
}