mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-10 21:07:48 +00:00
[python] Use pip --upgrade when installing function dependencies (#6683)
Co-authored-by: Steven <steven@ceriously.com>
This commit is contained in:
@@ -86,6 +86,10 @@ interface InstallRequirementArg {
|
||||
args?: string[];
|
||||
}
|
||||
|
||||
// note that any internal dependency that vc_init.py requires that's installed
|
||||
// with this function can get overriden by a newer version from requirements.txt,
|
||||
// so vc_init should do runtime version checks to be compatible with any recent
|
||||
// version of its dependencies
|
||||
export async function installRequirement({
|
||||
dependency,
|
||||
version,
|
||||
@@ -120,5 +124,5 @@ export async function installRequirementsFile({
|
||||
debug(`Skipping requirements file installation, already installed`);
|
||||
return;
|
||||
}
|
||||
await pipInstall(workPath, ['-r', filePath, ...args]);
|
||||
await pipInstall(workPath, ['--upgrade', '-r', filePath, ...args]);
|
||||
}
|
||||
|
||||
11
packages/python/test/fixtures/29-flask2/api/werkzeug_version.py
vendored
Normal file
11
packages/python/test/fixtures/29-flask2/api/werkzeug_version.py
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import werkzeug
|
||||
from flask import Flask
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route('/', defaults={'path': ''})
|
||||
@app.route('/<path:path>')
|
||||
def main(path):
|
||||
return werkzeug.__version__
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run(debug=True, port=8002)
|
||||
2
packages/python/test/fixtures/29-flask2/requirements.txt
vendored
Normal file
2
packages/python/test/fixtures/29-flask2/requirements.txt
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
flask==2.0.1
|
||||
werkzeug==2.0.1
|
||||
10
packages/python/test/fixtures/29-flask2/vercel.json
vendored
Normal file
10
packages/python/test/fixtures/29-flask2/vercel.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"version": 2,
|
||||
"builds": [{ "src": "api/*.py", "use": "@vercel/python" }],
|
||||
"probes": [
|
||||
{
|
||||
"path": "/api/werkzeug_version.py",
|
||||
"mustContain": "2.0.1"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user