From c98934d7d52168d04ce5b77db26c6c5ca62bebe4 Mon Sep 17 00:00:00 2001 From: Audrey Roy Greenfeld Date: Mon, 19 Oct 2015 16:02:42 -0700 Subject: [PATCH] When developing on Windows, only install psycopg2 in test/prod. --- CHANGELOG.md | 4 ++++ {{cookiecutter.repo_name}}/requirements/base.txt | 7 ++++++- {{cookiecutter.repo_name}}/requirements/production.txt | 7 +++++++ {{cookiecutter.repo_name}}/requirements/test.txt | 7 +++++++ 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59ace7a5..0b55e1f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All enhancements and patches to cookiecutter-django will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). +## [2015-10-19] +### Changed +- On Windows, don't install psycopg2 locally. Still install it in test/prod which are assumed to be Unix. (@audreyr) + ## [2015-10-15] ### Changed - Made `post_gen_hook` function to change secret keys in files more generic (@pydanny) diff --git a/{{cookiecutter.repo_name}}/requirements/base.txt b/{{cookiecutter.repo_name}}/requirements/base.txt index 6e5e0d5f..c94ee52d 100644 --- a/{{cookiecutter.repo_name}}/requirements/base.txt +++ b/{{cookiecutter.repo_name}}/requirements/base.txt @@ -24,8 +24,13 @@ Pillow==3.0.0 # Well-built with regular release cycles! django-allauth==0.23.0 -# For the persistence stores +{% if cookiecutter.windows == 'y' -%} +# On Windows, you must download/install psycopg2 manually +# from http://www.lfd.uci.edu/~gohlke/pythonlibs/#psycopg +{% else %} +# Python-PostgreSQL Database Adapter psycopg2==2.6.1 +{%- endif %} # Unicode slugification unicode-slugify==0.1.3 diff --git a/{{cookiecutter.repo_name}}/requirements/production.txt b/{{cookiecutter.repo_name}}/requirements/production.txt index e3c05bba..a4e06931 100644 --- a/{{cookiecutter.repo_name}}/requirements/production.txt +++ b/{{cookiecutter.repo_name}}/requirements/production.txt @@ -2,6 +2,13 @@ # production that isn't in development. -r base.txt +{% if cookiecutter.windows == 'y' -%} +# Python-PostgreSQL Database Adapter +# If using Win for dev, this assumes Unix in prod +# ------------------------------------------------ +psycopg2==2.6.1 +{%- endif %} + # WSGI Handler # ------------------------------------------------ gevent==1.0.2 diff --git a/{{cookiecutter.repo_name}}/requirements/test.txt b/{{cookiecutter.repo_name}}/requirements/test.txt index f2896ab7..2c8085fc 100644 --- a/{{cookiecutter.repo_name}}/requirements/test.txt +++ b/{{cookiecutter.repo_name}}/requirements/test.txt @@ -1,5 +1,12 @@ # Test dependencies go here. -r base.txt + +{% if cookiecutter.windows == 'y' -%} +# Python-PostgreSQL Database Adapter +# If using Win for dev, this assumes Unix in test/prod +psycopg2==2.6.1 +{%- endif %} + coverage==4.0 flake8==2.4.1 django-test-plus==1.0.9