Skip to content

Commit b8433b0

Browse files
authored
chore: upgrade to poetry (#514)
1 parent cbc7952 commit b8433b0

File tree

13 files changed

+1844
-1225
lines changed

13 files changed

+1844
-1225
lines changed

.github/workflows/serverless-service.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ jobs:
2929
node-version: "16"
3030
- name: Install dependencies
3131
run: |
32-
python -m pip install --upgrade pip
33-
pip install pipenv
32+
pip install --upgrade pip pre-commit poetry
33+
npm install -g aws-cdk
34+
make deps
3435
pip install -r dev_requirements.txt
3536
pip install -r lambda_requirements.txt
36-
npm install -g aws-cdk
3737
- name: Configure aws credentials
3838
uses: aws-actions/configure-aws-credentials@v1
3939
with:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,3 +246,5 @@ $RECYCLE.BIN/
246246
cdk.out
247247
.build
248248
.vscode
249+
dev_requirements.txt
250+
lambda_requirements.txt

Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33

44

55
dev:
6-
pipenv install -d
6+
pip install --upgrade pip pre-commit poetry
77
make deps
8+
pre-commit install
9+
poetry shell
810

911
lint:
1012
@echo "Running flake8"
@@ -28,8 +30,8 @@ mypy-lint:
2830
mypy --pretty service docs/examples cdk tests
2931

3032
deps:
31-
pipenv requirements --dev > dev_requirements.txt
32-
pipenv requirements > lambda_requirements.txt
33+
poetry export --only=dev --without-hashes --format=requirements.txt > dev_requirements.txt
34+
poetry export --without=dev --without-hashes --format=requirements.txt > lambda_requirements.txt
3335

3436
unit:
3537
pytest tests/unit --cov-config=.coveragerc --cov=service --cov-report xml
@@ -51,7 +53,7 @@ pipeline-tests:
5153
deploy:
5254
make deps
5355
mkdir -p .build/lambdas ; cp -r service .build/lambdas
54-
mkdir -p .build/common_layer ; pipenv requirements > .build/common_layer/requirements.txt
56+
mkdir -p .build/common_layer ; poetry export --without=dev --without-hashes --format=requirements.txt > .build/common_layer/requirements.txt
5557
cdk deploy --app="python3 ${PWD}/app.py" --require-approval=never
5658

5759
destroy:

Makefile_windows

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
.PHONY: dev lint complex coverage pre-commit yapf sort deploy destroy deps unit integration e2e pipeline-tests docs lint-docs
22

3-
4-
53
dev:
6-
pipenv install -d
4+
pip install --upgrade pip pre-commit poetry
75
make deps
6+
pre-commit install
7+
poetry shell
88

99
lint:
1010
@echo "Running flake8"
1111
flake8 service\* cdk\* tests\* docs\examples\* --exclude patterns='build,cdk.json,cdk.context.json,.yaml'
12+
@echo "Running mypy"
13+
make mypy-lint
1214

1315
complex:
1416
@echo "Running Radon"
@@ -23,8 +25,11 @@ pre-commit:
2325
pre-commit run -a --show-diff-on-failure
2426

2527
deps:
26-
pipenv requirements --dev > dev_requirements.txt
27-
pipenv requirements > lambda_requirements.txt
28+
poetry export --only=dev --without-hashes --format=requirements.txt > dev_requirements.txt
29+
poetry export --without=dev --without-hashes --format=requirements.txt > lambda_requirements.txt
30+
31+
mypy-lint:
32+
mypy --pretty service docs\examples cdk tests
2833

2934
unit:
3035
pytest tests\unit --cov-config=.coveragerc --cov=service --cov-report xml
@@ -49,11 +54,11 @@ deploy:
4954
rmdir /S /Q .build\lambdas\service
5055
echo D | xcopy /f /y service .build\lambdas\service /s
5156
if not exist ".build\common_layer" mkdir ".build\common_layer"
52-
pipenv requirements > .build\common_layer\requirements.txt
53-
cdk deploy --app="python cdk\my_service\app.py" --require-approval=never
57+
poetry export --without=dev --without-hashes --format=requirements.txt > .build\common_layer\requirements.txt
58+
cdk deploy --app="python app.py" --require-approval=never
5459

5560
destroy:
56-
cdk destroy --app="python cdk\my_service\app.py" --force
61+
cdk destroy --app="python app.py" --force
5762

5863
docs:
5964
mkdocs serve

Pipfile

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)