Skip to content

Commit 1f85095

Browse files
authored
Switch From Pipfile to Poetry (#48)
1 parent 7115a5a commit 1f85095

8 files changed

+1690
-632
lines changed

.circleci/config.yml

+23-36
Original file line numberDiff line numberDiff line change
@@ -3,73 +3,60 @@ jobs:
33
build:
44
docker:
55
- image: circleci/python:3.7
6-
environment:
7-
PIPENV_VENV_IN_PROJECT: true
86
steps:
97
- checkout
10-
- run: sudo chown -R circleci:circleci /usr/local/bin
11-
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.7/site-packages
128
- restore_cache:
13-
key: deps-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
9+
keys:
10+
- deps-{{ checksum "poetry.lock" }}
1411
- run:
15-
command: |
16-
sudo pip install pipenv
17-
pipenv install --dev --deploy
12+
name: Install Dependencies
13+
command: poetry install
1814
- save_cache:
19-
key: deps-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
15+
key: deps-{{ checksum "poetry.lock" }}
2016
paths:
21-
- ".venv"
22-
- "/usr/local/bin"
23-
- "/usr/local/lib/python3.7/site-packages"
17+
- /home/circleci/.cache/pypoetry/virtualenvs
2418

2519
lint:
2620
docker:
2721
- image: circleci/python:3.7
28-
environment:
29-
PIPENV_VENV_IN_PROJECT: true
3022
steps:
3123
- checkout
32-
- run: sudo chown -R circleci:circleci /usr/local/bin
33-
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.7/site-packages
3424
- restore_cache:
35-
key: deps-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
25+
keys:
26+
- deps-{{ checksum "poetry.lock" }}
3627
- run:
3728
command: |
38-
pipenv run flake8 src test
39-
pipenv run black --check src test
29+
poetry run flake8 src test
30+
poetry run black --check src test
4031
4132
test:
4233
docker:
4334
- image: circleci/python:3.7
44-
environment:
45-
PIPENV_VENV_IN_PROJECT: true
4635
steps:
4736
- checkout
48-
- run: sudo chown -R circleci:circleci /usr/local/bin
49-
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.7/site-packages
5037
- restore_cache:
51-
key: deps-{{ .Branch }}-{{ checksum "Pipfile.lock" }}
38+
keys:
39+
- deps-{{ checksum "poetry.lock" }}
5240
- run:
53-
command: pipenv run pytest
41+
name: Run Tests
42+
command: poetry run pytest
5443

5544
release:
5645
docker:
5746
- image: circleci/python:3.7
58-
environment:
59-
PIPENV_VENV_IN_PROJECT: true
6047
steps:
6148
- checkout
62-
- run: sudo chown -R circleci:circleci /usr/local/bin
63-
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.7/site-packages
49+
- restore_cache:
50+
keys:
51+
- deps-{{ checksum "poetry.lock" }}
6452
- run:
65-
name: Install release dependencies
53+
name: Publish to SAR
6654
command: |
67-
sudo pip install -q -U aws-sam-cli
68-
pipenv lock --requirements --keep-outdated > ./src/requirements.txt
69-
sam validate
70-
sam build
71-
sam package --s3-bucket nr-serverless-applications --output-template-file packaged.yaml
72-
sam publish --region us-east-1 --template packaged.yaml
55+
poetry export -o src/requirements.txt --without-hashes
56+
poetry run sam validate
57+
poetry run sam build
58+
poetry run sam package --s3-bucket nr-serverless-applications --output-template-file packaged.yaml
59+
poetry sam publish --region us-east-1 --template packaged.yaml
7360
7461
workflows:
7562
version: 2

Pipfile

-23
This file was deleted.

Pipfile.lock

-560
This file was deleted.

build.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
22

3-
pipenv lock --requirements --keep-outdated > ./src/requirements.txt
4-
5-
sam build --use-container
3+
poetry install
4+
poetry export -o ./src/requirements.txt --without-hashes
5+
poetry run sam build --use-container

0 commit comments

Comments
 (0)