Skip to content

Commit

Permalink
Use pipenv without --system
Browse files Browse the repository at this point in the history
New best practice, see: pypa/pipenv#2762
  • Loading branch information
ferndot committed May 20, 2019
1 parent 430cdf3 commit a66a9a4
Show file tree
Hide file tree
Showing 11 changed files with 27 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ services:

install:
- pip install pipenv
- pipenv install --dev --system --deploy --ignore-pipfile
- pipenv install --deploy --ignore-pipfile --dev

before_script:
- cookiecutter . --no-input
- pipenv run cookiecutter . --no-input
- cd cookiecutter_drf
- bash scripts/travis/before_install.sh

Expand Down
9 changes: 4 additions & 5 deletions {{ cookiecutter.project_slug }}/Dockerfile.heroku
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
FROM python:3-alpine
ENV PYTHONUNBUFFERED 1

# Add system dependencies
# Add dependencies
RUN apk update && apk add postgresql-dev gcc python3-dev musl-dev libffi-dev make

# Allows docker to cache installed dependencies between builds
COPY Pipfile* ./
RUN pip install pipenv
RUN pipenv install --system --deploy --ignore-pipfile

# Adds our application code to the image
COPY . /code/
WORKDIR /code

# Install dependencies
RUN pipenv install --deploy --ignore-pipfile

# Expose Django's port
EXPOSE $PORT
9 changes: 4 additions & 5 deletions {{ cookiecutter.project_slug }}/Dockerfile.local
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
FROM python:3-alpine
ENV PYTHONUNBUFFERED 1

# Add system dependencies
# Add dependencies
RUN apk update && apk add postgresql-dev gcc python3-dev musl-dev libffi-dev make

# Allows docker to cache installed dependencies between builds
COPY Pipfile* ./
RUN pip install pipenv
RUN pipenv install --dev --system --deploy --ignore-pipfile

# Adds our application code to the image
COPY . /code/
WORKDIR /code

# Install dependencies
RUN pipenv install --deploy --ignore-pipfile --dev

# Expose Django's port
EXPOSE $PORT
6 changes: 3 additions & 3 deletions {{ cookiecutter.project_slug }}/scripts/heroku/deploy_web.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
python manage.py migrate
python manage.py collectstatic --noinput
#!/bin/sh
pipenv run python manage.py migrate
pipenv run python manage.py collectstatic --noinput
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
celery -A config.celery worker -l info
pipenv run celery -A config.celery worker -l info
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
celery -A config.celery beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler
pipenv run celery -A config.celery beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler
2 changes: 1 addition & 1 deletion {{ cookiecutter.project_slug }}/scripts/heroku/run_web.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
gunicorn config.wsgi:application -b 0.0.0.0:${PORT} -k config.server.production.ProductionUvicornWorker --access-logfile -
pipenv run gunicorn config.wsgi:application -b 0.0.0.0:${PORT} -k config.server.production.ProductionUvicornWorker --access-logfile -
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
watchmedo auto-restart --patterns="*.py" -d api -- celery -A config.celery worker -l info
pipenv run watchmedo auto-restart --patterns="*.py" -d api -- celery -A config.celery worker -l info
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh
watchmedo auto-restart --patterns="*.py" -d api -- celery -A config.celery beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler
pipenv run watchmedo auto-restart --patterns="*.py" -d api -- celery -A config.celery beat -l info --scheduler django_celery_beat.schedulers:DatabaseScheduler
6 changes: 3 additions & 3 deletions {{ cookiecutter.project_slug }}/scripts/local/run_web.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
python scripts/local/wait_for_postgres.py
python manage.py migrate
python manage.py runserver 0.0.0.0:8000
pipenv run python scripts/local/wait_for_postgres.py
pipenv run python manage.py migrate
pipenv run python manage.py runserver 0.0.0.0:8000
10 changes: 6 additions & 4 deletions {{ cookiecutter.project_slug }}/scripts/travis/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh
flake8 . &&
black --check . &&
python scripts/local/wait_for_postgres.py &&
pytest --cov=./
pipenv run "
flake8 . &&
black --check . &&
python scripts/local/wait_for_postgres.py &&
pytest --cov=./
"

0 comments on commit a66a9a4

Please sign in to comment.