From 2d808c42bc8925d632b454b9bf444c0987ad9824 Mon Sep 17 00:00:00 2001 From: Youe Graillot Date: Thu, 25 Nov 2021 00:04:36 +0100 Subject: [PATCH] docker share database dependencies --- Dockerfile | 6 ++---- setup.cfg | 6 ++++-- tox.ini | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index eff4e57de..f14ff055a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,10 +43,8 @@ RUN echo "**** install build dependencies ****" &&\ mkdir -p /etc/ihatemoney &&\ echo "**** install pip packages ****" && \ pip install --no-cache-dir \ - gunicorn \ - pymysql \ - psycopg2 && \ - pip install --no-cache-dir -e /src && \ + gunicorn && \ + pip install --no-cache-dir -e /src[database] && \ echo "**** create user abc:abc ****" && \ useradd -u 1000 -U -d /src abc && \ echo "**** cleanup ****" && \ diff --git a/setup.cfg b/setup.cfg index 2920691e6..6ec0bfb7c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,6 +45,10 @@ install_requires = python-dateutil [options.extras_require] +database = + psycopg2-binary>=2.9,<3 + PyMySQL>=0.9,<1.1 + dev = black>=19.10b0 ; python_version >= '3.6' flake8>=3.7.9 @@ -53,8 +57,6 @@ dev = pytest>=5.4.1 tox>=3.14.6 zest.releaser>=6.20.1 - psycopg2-binary>=2.9,<3 - PyMySQL>=0.9,<1.1 doc = Sphinx==4.3.0 diff --git a/tox.ini b/tox.ini index f7817ef32..c37b8eced 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ commands = py.test --pyargs ihatemoney.tests deps = - -e.[dev] + -e.[database] # To be sure we are importing ihatemoney pkg from pip-installed version changedir = /tmp