Commit 3992e984 authored by Sébastiaan Versteeg's avatar Sébastiaan Versteeg
Browse files

Merge branch 'pipenv-instead-of-requirements' into 'master'

Use pipenv instead of requirements.txt

Closes #672 and #631

See merge request thalia/concrexit!879
parents 86bb6dab 379f32d0
......@@ -2,12 +2,11 @@ variables:
POSTGRES_DB: thalia
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ""
CI_DEPS: psycopg2-binary
# https://hub.docker.com/r/twiggers/python-thalia/
# https://github.com/thomwiggers/python-thalia
# https://hub.docker.com/r/thalia/python-thalia/
# https://github.com/thaliawww/python-thalia
# Should get auto-updated with the official 'python' repository
# Installs:
# - pip: tox, coverage
# - pip: tox, coverage, pipenv
# - apt: ghostscript
PY35_IMAGE: thalia/python-thalia:3.5
PY36_IMAGE: thalia/python-thalia:3.6
......@@ -20,7 +19,6 @@ stages:
pep8:
stage: test
image: $PY35_IMAGE
before_script:
script:
- tox -e flake8
......@@ -54,17 +52,16 @@ docs:
image: $PY35_IMAGE
before_script:
# install django deps
- pip install -r requirements.txt
- pip install -r dev-requirements.txt
- cd docs
- pipenv --bare install --dev --ignore-pipfile
# install doc deps
- pip install -r requirements.txt
- cd docs
- pipenv run pip install -r requirements.txt
script:
- echo "Building current docs"
- env -u GITLAB_CI make doctest
- env -u GITLAB_CI sphinx-build -M html "." "_build" -W -j $(nproc)
- env -u GITLAB_CI pipenv run make doctest
- env -u GITLAB_CI pipenv run sphinx-build -M html "." "_build" -W -j $(nproc)
- echo "Checking if there are changes"
- ./generate-apidocs.sh
- pipenv run ./generate-apidocs.sh
- git diff --exit-code
build docker image:
......
......@@ -37,21 +37,21 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
ghostscript && \
rm -rf /var/lib/apt
RUN pip install --no-cache-dir pipenv
WORKDIR /usr/src/app/website/
# install python requirements
COPY requirements.txt /usr/src/app/website/
COPY production-requirements.txt /usr/src/app/website/
COPY dev-requirements.txt /usr/src/app/website/
COPY docs/requirements.txt /usr/src/app/docs/
RUN pip install --no-cache-dir \
-r requirements.txt \
-r production-requirements.txt \
-r ../docs/requirements.txt
COPY Pipfile /usr/src/app/website/
COPY Pipfile.lock /usr/src/app/website/
RUN if [ "$install_dev_requirements" -eq 1 ]; then \
pip install --no-cache-dir -r dev-requirements.txt; \
pipenv install --system --dev; \
else \
echo "This will fail if the dependencies are out of date"; \
pipenv install --system --deploy; \
fi
RUN pip install --no-cache-dir \
-r ../docs/requirements.txt
# Create entry points
COPY resources/entrypoint.sh /usr/local/bin/entrypoint.sh
......
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
django-localflavor = "*"
django-sendfile = "*"
freezegun = "*"
bleach = "*"
"django-tinymce4-lite" = "*"
rcssmin = "*"
djangorestframework = "*"
django-ical = "*"
django-libsass = "*"
django-cors-headers = "*"
python-magic = "*"
pyfcm = "*"
celery = "*"
redis = "*"
raven = "*"
Django = ">=2.0,<2.1"
Pillow = "*"
django_compressor = "*"
django_celery_results = "*"
"psycopg2-binary" = "*"
bcrypt = "*"
django-slack = "!=5.7.2"
"argon2_cffi" = "*"
uWSGI = "*"
[dev-packages]
django-template-check = "*"
"flake8" = "*"
pydenticon = "*"
pylint = "*"
pylint-django = "*"
tox = "*"
Faker = "*"
factory_boy = "*"
coverage = "*"
This diff is collapsed.
......@@ -17,11 +17,10 @@ Getting started
If you use Docker, please look at [this part](#docker) of the README.
0. Get at least Python 3.5 and install the Pillow requirements as per below.
0. Get at least Python 3.5 and install pipenv and the Pillow requirements as per below.
1. Clone this repository
2. Run `source ./source_me.sh` or `source venv/bin/activate` (or what you do for your own favourite virtualenv solution)
3. Run `pip install -r requirements.txt`
4. Run `pip install -r dev-requirements.txt`
2. Run `pipenv install --dev`
3. Run `pipenv shell`
5. `cd website`
6. `./manage.py migrate` to initialise the database
7. `./manage.py createsuperuser` to create the first user (note that this user won't be a member!)
......@@ -41,6 +40,13 @@ ignored. If you want to run a specific check, you can do the following:
You can run `tox -l` to see the available environments.
Pipenv
------
Install Pipenv per the [pipenv documentation][pipenv install]
[pipenv install]: https://docs.pipenv.org/install/#installing-pipenv
Pillow dependencies
-------------------
......
Django>=2.0.8,<2.1
django-localflavor>=2.0,<2.1
Pillow>=5.0,<5.1
django-compressor>=2.1,<3
django-sendfile<=0.4
freezegun>=0.3.9,<0.4.0
bleach>=2.1.0,<2.2
django-tinymce4-lite>=1.7,<1.8
rcssmin>=1.0.6
djangorestframework>=3.7.1,<3.8
django-ical>=1.4,<2
django-libsass>=0.7,<1
django-cors-headers>=2.1.0,<2.2
python-magic>=0.4.13,<0.5
pyfcm>=1.4.2,<1.5
celery>=4.0,<4.2
redis>=2.10,<2.11
django-celery-results>=1.0.1,<1.1
raven>=6.4.0,<6.5.0
[tox]
envlist = flake8, {py35,py36}-django20
envlist = flake8, {py35,py36,py37}-django20, {py35,py36,py37}-django21
skipsdist = True
skip_missing_interpreters = True
......@@ -8,31 +8,22 @@ changedir={toxinidir}/website
commands =
; Copy the env list to make not conflict with the Django version
; specified below
cp {toxinidir}/requirements.txt {envbindir}/reqtemp.txt
sed -i /Django>=.*/d {envbindir}/reqtemp.txt
pip install -r{envbindir}/reqtemp.txt -r{toxinidir}/dev-requirements.txt
# Issue https://gitlab.science.ru.nl/thalia/concrexit/issues/631
#pipconflictchecker # if this fails, use pipdeptree to debug
python manage.py check
python manage.py templatecheck --project-only
python manage.py makemigrations --no-input --check --dry-run
python -Wall -mcoverage run --branch --source '.' manage.py test
safety check
pipenv --bare install --dev --ignore-pipfile
; override using pip. Using pipenv would write to Pipfile!
django20: pip install 'django>=2.0rc1,<2.1'
django21: pip install --pre 'django>=2.1rc1,<2.2'
pipenv --bare run python manage.py check
pipenv --bare run python manage.py templatecheck --project-only
pipenv --bare run python manage.py makemigrations --no-input --check --dry-run
pipenv --bare run python -Wall -mcoverage run --branch --source '.' manage.py test
pipenv --bare check
deps =
coverage
pip-conflict-checker
django20: django>=2.0rc1,<2.1
{env:CI_DEPS:}
pipenv
passenv =
GITLAB_CI
PIP_CACHE_DIR
whitelist_externals=
sed
cp
[flake8]
exclude = */migrations/*, */urls.py, .ropeproject
env =
PIPENV_SUPPRESS_NESTED_WARNING=1
[testenv:flake8]
deps= flake8
......@@ -41,3 +32,7 @@ commands=
flake8 .
passenv =
PIP_CACHE_DIR
# Settings for Flake8
[flake8]
exclude = */migrations/*, */urls.py, .ropeproject
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment