Skip to content

Commit

Permalink
Poetry for rasa-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
alwx committed Feb 4, 2020
1 parent 0114b60 commit 49a80ad
Show file tree
Hide file tree
Showing 11 changed files with 1,244 additions and 130 deletions.
9 changes: 3 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@ cache:
python:
- '3.6'
- '3.7'
before_install:
- pip install poetry
install:
- pip install -r dev-requirements.txt
- pip install -e .
- pip install coveralls==1.3.0
- pip list
- poetry install
script:
- travis_wait py.test tests --cov rasa_sdk -v
after_success:
- coveralls
jobs:
include:
- stage: test
Expand Down
52 changes: 29 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
FROM python:3.6-slim

SHELL ["/bin/bash", "-c"]

RUN apt-get update -qq && \
apt-get install -y --no-install-recommends \
build-essential && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
mkdir /app

WORKDIR /app

# Copy as early as possible so we can cache ...
COPY requirements.txt .

RUN pip install -r requirements.txt --no-cache-dir

COPY . .

RUN pip install -e . --no-cache-dir
FROM python:3.6-alpine as python_builder
RUN apk update && \
apk add \
build-base \
curl \
git

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

COPY poetry.lock pyproject.toml /opt/project/
RUN python -m venv /opt/venv && \
source /opt/venv/bin/activate && \
pip install -U pip && \
cd /opt/project && \
poetry install --no-dev --no-interaction

COPY . /opt/project
RUN source /opt/venv/bin/activate && \
cd /opt/project && \
poetry install --no-dev --no-interaction

FROM python:3.6-alpine
RUN apk update && apk add bash

COPY --from=python_builder /opt /opt
ENV PATH="/opt/venv/bin:$PATH"
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

VOLUME ["/app/actions"]

EXPOSE 5055

ENTRYPOINT ["./entrypoint.sh"]
ENTRYPOINT ["./opt/project/entrypoint.sh"]

CMD ["start", "--actions", "actions.actions"]
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ help:
@echo " Install Rasa SDK dependencies"

init:
pip install -r requirements.txt
poetry install

clean:
find . -name '*.pyc' -exec rm -f {} +
Expand All @@ -28,12 +28,8 @@ types:
pytype --keep-going rasa_sdk

lint:
flake8 rasa_sdk tests
flakehell lint rasa_sdk tests
black --check rasa_sdk tests

test: clean
py.test tests --cov rasa_sdk -W ignore

check-readme:
# if this runs through we can be sure the readme is properly shown on pypi
python setup.py check --restructuredtext --strict
11 changes: 0 additions & 11 deletions dev-requirements.txt

This file was deleted.

Loading

0 comments on commit 49a80ad

Please sign in to comment.