Skip to content

Commit 4b12116

Browse files
committed
Adding export plugin
1 parent 0b2144a commit 4b12116

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.github/workflows/deploy.yml

+1
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,5 @@ jobs:
7171
working-directory: ./cdk
7272
run: |
7373
poetry install
74+
poetry self add poetry-plugin-export
7475
cdk deploy openaq-ingest-aeolus --require-approval never

cdk/utils.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@ def create_dependencies_layer(
1919
function_name: str,
2020
requirements_path: Path
2121
) -> aws_lambda.LayerVersion:
22-
requirements_file = str(requirements_path.resolve())
22+
#requirements_file = str(requirements_path.resolve())
2323
output_dir = f'../.build/{function_name}'
2424
layer_id = f'openaq-{function_name}-{env_name}-dependencies'
2525

2626
if not environ.get('SKIP_BUILD'):
27-
print(f'Building {layer_id} from {requirements_file} into {output_dir}')
27+
print(f'Building {layer_id} into {output_dir}')
2828
subprocess.run(
29-
f"""python -m pip install -qq -r {requirements_file} \
29+
f"""
30+
poetry export --without=cdk -o requirements.txt --without-hashes && \
31+
poetry run python -m pip install -qq -r requirements.txt \
3032
-t {output_dir}/python && \
3133
cd {output_dir}/python && \
3234
find . -type f -name '*.pyc' | \

0 commit comments

Comments
 (0)