Skip to content

Commit

Permalink
fix: replace deprecated pipenv lock with pipenv requirements
Browse files Browse the repository at this point in the history
As part of the pipenv release 2022.8.13 the deprecated way of generating requirements "pipenv install -r" or "pipenv lock -r" has been removed in favor of the "pipenv requirements" command.

* [Reference to pipenv CHANGELOG](https://github.com/pypa/pipenv/blob/main/CHANGELOG.md#2022813-2022-08-13)
* [Refernce to relevant pipenv pull request](pypa/pipenv#5200)

Fixes aws#28015 by implementing the proposed change.
  • Loading branch information
stefanfreitag committed Dec 10, 2023
1 parent 8b91e10 commit 7d9a99d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-lambda-python-alpha/lib/packaging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class Packaging {
dependenciesFile: DependenciesFile.PIPENV,
// By default, pipenv creates a virtualenv in `/.local`, so we force it to create one in the package directory.
// At the end, we remove the virtualenv to avoid creating a duplicate copy in the Lambda package.
exportCommand: `PIPENV_VENV_IN_PROJECT=1 pipenv lock -r > ${DependenciesFile.PIP} && rm -rf .venv`,
exportCommand: `PIPENV_VENV_IN_PROJECT=1 pipenv requirements > ${DependenciesFile.PIP} && rm -rf .venv`,
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ test('Bundling a function with pipenv dependencies', () => {
bundling: expect.objectContaining({
command: [
'bash', '-c',
'rsync -rLv /asset-input/ /asset-output/python && cd /asset-output/python && PIPENV_VENV_IN_PROJECT=1 pipenv lock -r > requirements.txt && rm -rf .venv && python -m pip install -r requirements.txt -t /asset-output/python',
'rsync -rLv /asset-input/ /asset-output/python && cd /asset-output/python && PIPENV_VENV_IN_PROJECT=1 pipenv requirements > requirements.txt && rm -rf .venv && python -m pip install -r requirements.txt -t /asset-output/python',
],
}),
}));
Expand Down Expand Up @@ -221,7 +221,7 @@ test('Bundling a function with pipenv dependencies with assetExcludes', () => {
bundling: expect.objectContaining({
command: [
'bash', '-c',
"rsync -rLv --exclude='.ignorefile' /asset-input/ /asset-output/python && cd /asset-output/python && PIPENV_VENV_IN_PROJECT=1 pipenv lock -r > requirements.txt && rm -rf .venv && python -m pip install -r requirements.txt -t /asset-output/python",
"rsync -rLv --exclude='.ignorefile' /asset-input/ /asset-output/python && cd /asset-output/python && PIPENV_VENV_IN_PROJECT=1 pipenv requirements > requirements.txt && rm -rf .venv && python -m pip install -r requirements.txt -t /asset-output/python",
],
}),
}));
Expand Down

0 comments on commit 7d9a99d

Please sign in to comment.