This repository has been archived by the owner on Nov 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(python): Use Poetry for package management
In CI, since the packages are now installed in a virtualenv rather than globally, we have to activate the virtualenv at the start of jobs. The cattrs package has to be kept back to before version 1.1.0 until we either upgrade to Python 3.7 or AWS CDK moves to a dependency which doesn't transitively depend on Python 3.7. Issue linked on the relevant pyproject.toml line. This merges the production dependencies of the backend and infra subdirectories, which is not ideal. Once subproject support <python-poetry/poetry#2270> arrives we should pull this apart, maybe keeping only the development and test dependencies in the root. To mitigate this in the meantime, bundle.bash pulls out only those dependencies which the Lambda function needs.
- Loading branch information
Showing
11 changed files
with
2,148 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o errexit -o noclobber -o nounset | ||
|
||
script_dir="$(dirname "$0")" | ||
|
||
python -m venv .venv | ||
. .venv/bin/activate | ||
python -m pip install --upgrade pip | ||
python -m pip install poetry | ||
|
||
work_dir="$(mktemp --directory)" | ||
all_requirements_file="${work_dir}/all-requirements.txt" | ||
backend_requirements_file="${work_dir}/backend-requirements.txt" | ||
|
||
# Get requirements file for entries in requirements.txt | ||
poetry export --output="$all_requirements_file" --without-hashes | ||
grep --file="${script_dir}/requirements.txt" "$all_requirements_file" > "$backend_requirements_file" | ||
|
||
pip install --requirement="$backend_requirements_file" --target=/asset-output | ||
cp --archive --update --verbose "${script_dir}/endpoints" /asset-output/ |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.