From f912cbb50bd8b4f871ca439f567b7b3b926c7eca Mon Sep 17 00:00:00 2001 From: Rudi Giesler Date: Wed, 23 Aug 2023 11:20:46 +0200 Subject: [PATCH 1/2] Add dev as optional dependancies --- README.md | 3 +-- pyproject.toml | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 022a9c1c..51ce8114 100644 --- a/README.md +++ b/README.md @@ -52,8 +52,7 @@ The current LTS release is: 1.0 ## Setting up locally Run the following in a virtual environment ```bash -pip install -r requirements.txt -pip intsall -r requirements-dev.txt +pip install -e .[dev] ./manage.py migrate ./manage.py createsuperuser ./manage.py runserver diff --git a/pyproject.toml b/pyproject.toml index e10be4e8..3ac35b1f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ authors = [ description = "A CMS for messaging systems" readme = "README.md" requires-python = ">=3.10" -dynamic = ["dependencies"] +dynamic = ["dependencies", "optional-dependencies"] [project.urls] "Homepage" = "https://github.com/praekeltfoundation/contentrepo" @@ -22,6 +22,7 @@ packages = ["contentrepo", "home", "menu", "search"] [tool.setuptools.dynamic] dependencies = {file = ["requirements.txt"]} +optional-dependencies.dev = {file = ["requirements-dev.txt"]} [tool.black] line-length = 88 From dc6cf3f4108bbd5f561ccc69c6b5b1aa5ed1859d Mon Sep 17 00:00:00 2001 From: Rudi Giesler Date: Wed, 23 Aug 2023 11:21:05 +0200 Subject: [PATCH 2/2] Reduce docker image size Don't cache pip and load CPU only pytorch --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8d09ce00..bd462338 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ FROM ghcr.io/praekeltfoundation/docker-django-bootstrap-nw:py3.10-buster COPY . /app -RUN pip install -e . +RUN pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu -e . ENV DJANGO_SETTINGS_MODULE contentrepo.settings.production