Skip to content

Commit

Permalink
Use poetry instead of setuptools
Browse files Browse the repository at this point in the history
  • Loading branch information
public committed May 2, 2021
1 parent ddd8ab2 commit 2c1849e
Show file tree
Hide file tree
Showing 7 changed files with 1,520 additions and 124 deletions.
25 changes: 19 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ workflows:
- build-grpcweb-images
- test-py37
- test-py38
- test-py39
- lint
- interop-grpcweb-wsgi:
requires:
Expand Down Expand Up @@ -53,11 +54,15 @@ jobs:
- image: circleci/python:3.7
steps:
- checkout
- run: sudo pip install tox
- run: sudo apt-get install python3-dev libev-dev
- run:
command: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
environment:
POETRY_VERSION: 1.1.5
- run: poetry install
- restore_cache:
key: benchmarks-{{ .Environment.CIRCLE_JOB }}-master
- run: tox -e py37 -- --benchmark-save=${CIRCLE_BRANCH} --benchmark-compare
- run: poetry run tox -e py37 -- --benchmark-save=${CIRCLE_BRANCH} --benchmark-compare
- save_cache:
key: benchmarks-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ .Revision }}
paths:
Expand All @@ -67,11 +72,15 @@ jobs:
- image: circleci/python:3.8
steps:
- checkout
- run: sudo pip install tox
- run: sudo apt-get install python3-dev libev-dev
- run:
command: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
environment:
POETRY_VERSION: 1.1.5
- run: poetry install
- restore_cache:
key: benchmarks-{{ .Environment.CIRCLE_JOB }}-master
- run: tox -e py38 -- --benchmark-save=${CIRCLE_BRANCH} --benchmark-compare
- run: poetry run tox -e py38 -- --benchmark-save=${CIRCLE_BRANCH} --benchmark-compare
- save_cache:
key: benchmarks-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ .Revision }}
paths:
Expand All @@ -81,11 +90,15 @@ jobs:
- image: circleci/python:3.9
steps:
- checkout
- run: sudo pip install tox
- run: sudo apt-get install python3-dev libev-dev
- run:
command: curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
environment:
POETRY_VERSION: 1.1.5
- run: poetry install
- restore_cache:
key: benchmarks-{{ .Environment.CIRCLE_JOB }}-master
- run: tox -e py39 -- --benchmark-save=${CIRCLE_BRANCH} --benchmark-compare
- run: poetry run tox -e py39 -- --benchmark-save=${CIRCLE_BRANCH} --benchmark-compare
- save_cache:
key: benchmarks-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ .Revision }}
paths:
Expand Down
14 changes: 8 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,24 @@ WORKDIR /usr/src/app
RUN apt update && \
apt install -y build-essential libev-dev

ENV POETRY_VERSION=1.1.5
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
ENV PATH="${PATH}:/root/.poetry/bin"

COPY . .

RUN pip install -e .[tests]
RUN poetry install

RUN python -m grpc.tools.protoc \
RUN poetry run python -m grpc.tools.protoc \
--proto_path="$(pwd)/" \
--python_out=. \
--grpc_python_out=. \
"$(pwd)"/test_server/*.proto

RUN pip install daphne

FROM base AS wsgi

CMD python test_server/wsgi.py
CMD poetry run python test_server/wsgi.py

FROM base AS asgi

CMD daphne -b 0.0.0.0 -p 8080 test_server.asgi:application
CMD poetry run daphne -b 0.0.0.0 -p 8080 test_server.asgi:application
Loading

0 comments on commit 2c1849e

Please sign in to comment.