From c7ba0e470efc412246bb764d0a0d35c354232d75 Mon Sep 17 00:00:00 2001 From: Benjamin Graillot Date: Sun, 8 Mar 2020 22:42:22 +0100 Subject: [PATCH] Split requirements into files --- Dockerfile | 5 ++++- README.md | 2 +- note_kfet/settings/base.py | 1 - requirements/api.txt | 3 +++ requirements.txt => requirements/base.txt | 6 ------ requirements/cas.txt | 2 ++ requirements/production.txt | 1 + tox.ini | 10 ++++++++-- 8 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 requirements/api.txt rename requirements.txt => requirements/base.txt (72%) create mode 100644 requirements/cas.txt create mode 100644 requirements/production.txt diff --git a/Dockerfile b/Dockerfile index 2c840829..a2f45b00 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,10 @@ RUN apt update && \ rm -rf /var/lib/apt/lists/* COPY requirements.txt /code/ -RUN pip install -r requirements.txt +RUN pip install -r requirements/base.txt +RUN pip install -r requirements/api.txt +RUN pip install -r requirements/cas.txt +RUN pip install -r requirements/production.txt COPY . /code/ diff --git a/README.md b/README.md index 5ae8a396..123f09b8 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ On supposera pour la suite que vous utiliser debian/ubuntu sur un serveur tout n $ python3 -m venv env $ source env/bin/activate - (env)$ pip3 install -r requirements.txt + (env)$ pip3 install -r requirements/base.txt (env)$ deactivate 4. uwsgi et Nginx diff --git a/note_kfet/settings/base.py b/note_kfet/settings/base.py index 103e368d..fead0e44 100644 --- a/note_kfet/settings/base.py +++ b/note_kfet/settings/base.py @@ -37,7 +37,6 @@ INSTALLED_APPS = [ # External apps 'polymorphic', - 'reversion', 'crispy_forms', 'django_tables2', # Django contrib diff --git a/requirements/api.txt b/requirements/api.txt new file mode 100644 index 00000000..8dd9f5f2 --- /dev/null +++ b/requirements/api.txt @@ -0,0 +1,3 @@ +djangorestframework==3.9.0 +django-rest-polymorphic==0.1.8 + diff --git a/requirements.txt b/requirements/base.txt similarity index 72% rename from requirements.txt rename to requirements/base.txt index 69e69230..e9dc7635 100644 --- a/requirements.txt +++ b/requirements/base.txt @@ -4,16 +4,10 @@ defusedxml==0.6.0 Django~=2.2 django-allauth==0.39.1 django-autocomplete-light==3.5.1 -django-cas-client==1.5.3 -django-cas-server==1.1.0 django-crispy-forms==1.7.2 django-extensions==2.1.9 django-filter==2.2.0 -django-guardian==2.1.0 django-polymorphic==2.0.3 -djangorestframework==3.9.0 -django-rest-polymorphic==0.1.8 -django-reversion==3.0.3 django-tables2==2.1.0 docutils==0.14 idna==2.8 diff --git a/requirements/cas.txt b/requirements/cas.txt new file mode 100644 index 00000000..d468d2d5 --- /dev/null +++ b/requirements/cas.txt @@ -0,0 +1,2 @@ +django-cas-client==1.5.3 +django-cas-server==1.1.0 diff --git a/requirements/production.txt b/requirements/production.txt new file mode 100644 index 00000000..f0b52228 --- /dev/null +++ b/requirements/production.txt @@ -0,0 +1 @@ +psycopg2==2.8.4 diff --git a/tox.ini b/tox.ini index c4e88c78..7c432d55 100644 --- a/tox.ini +++ b/tox.ini @@ -9,7 +9,10 @@ skipsdist = True setenv = PYTHONWARNINGS = all deps = - -r{toxinidir}/requirements.txt + -r{toxinidir}/requirements/base.txt + -r{toxinidir}/requirements/api.txt + -r{toxinidir}/requirements/cas.txt + -r{toxinidir}/requirements/production.txt coverage commands = ./manage.py makemigrations @@ -18,7 +21,10 @@ commands = [testenv:linters] deps = - -r{toxinidir}/requirements.txt + -r{toxinidir}/requirements/base.txt + -r{toxinidir}/requirements/api.txt + -r{toxinidir}/requirements/cas.txt + -r{toxinidir}/requirements/production.txt flake8 flake8-colors flake8-import-order