diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index 1eefcdbe..2e994197 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -45,6 +45,7 @@ Listed in alphabetical order. Alex Tsai `@caffodian`_ Alvaro [Andor] `@andor-pierdelacabeza`_ Amjith Ramanujam `@amjith`_ + Andreas Meistad `@ameistad`_ Andres Gonzalez `@andresgz`_ Andrew Mikhnevich `@zcho`_ Andy Rose diff --git a/README.rst b/README.rst index 846b0d3a..896d34be 100644 --- a/README.rst +++ b/README.rst @@ -122,7 +122,7 @@ Answer the prompts with your own desired options_. For example:: use_opbeat [n]: y use_pycharm [n]: y windows [n]: n - use_python2 [n]: n + use_python3 [y]: y use_docker [y]: n use_heroku [n]: y use_compressor [n]: y diff --git a/cookiecutter.json b/cookiecutter.json index 98167340..017a8226 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -14,7 +14,7 @@ "use_opbeat": "n", "use_pycharm": "n", "windows": "n", - "use_python2": "n", + "use_python3": "y", "use_docker": "y", "use_heroku": "n", "use_compressor": "n", diff --git a/docs/project-generation-options.rst b/docs/project-generation-options.rst index be9eb0b4..c2b14e87 100644 --- a/docs/project-generation-options.rst +++ b/docs/project-generation-options.rst @@ -54,9 +54,9 @@ use_pycharm [n] windows [n] Whether you'll be developing on Windows. -use_python2 [n] +use_python3 [y] By default, the Python code generated will be for Python 3.x. But if you - answer `y` here, it will be legacy Python 2.7 code. + answer `n` here, it will be legacy Python 2.7 code. use_docker [y] Whether to use Docker_, separating the app and database into separate diff --git a/{{cookiecutter.project_slug}}/.travis.yml b/{{cookiecutter.project_slug}}/.travis.yml index befee878..4001cbe3 100644 --- a/{{cookiecutter.project_slug}}/.travis.yml +++ b/{{cookiecutter.project_slug}}/.travis.yml @@ -8,7 +8,7 @@ before_install: - sudo apt-get install -qq libsqlite3-dev libxml2 libxml2-dev libssl-dev libbz2-dev wget curl llvm language: python python: -{% if cookiecutter.use_python2 == 'n' -%} +{% if cookiecutter.use_python3 == 'y' -%} - "3.5" {% else %} - "2.7" diff --git a/{{cookiecutter.project_slug}}/compose/django/Dockerfile b/{{cookiecutter.project_slug}}/compose/django/Dockerfile index 0123c58a..91c2297d 100644 --- a/{{cookiecutter.project_slug}}/compose/django/Dockerfile +++ b/{{cookiecutter.project_slug}}/compose/django/Dockerfile @@ -1,4 +1,4 @@ -{% if cookiecutter.use_python2 == 'n' -%} +{% if cookiecutter.use_python3 == 'y' -%} FROM python:3.5 {% else %} FROM python:2.7 diff --git a/{{cookiecutter.project_slug}}/compose/django/Dockerfile-dev b/{{cookiecutter.project_slug}}/compose/django/Dockerfile-dev index 5d0631d5..3390aa09 100644 --- a/{{cookiecutter.project_slug}}/compose/django/Dockerfile-dev +++ b/{{cookiecutter.project_slug}}/compose/django/Dockerfile-dev @@ -1,4 +1,4 @@ -{% if cookiecutter.use_python2 == 'n' -%} +{% if cookiecutter.use_python3 == 'y' -%} FROM python:3.5 {% else %} FROM python:2.7 diff --git a/{{cookiecutter.project_slug}}/requirements/base.txt b/{{cookiecutter.project_slug}}/requirements/base.txt index 8c24ffb8..1de61b7b 100644 --- a/{{cookiecutter.project_slug}}/requirements/base.txt +++ b/{{cookiecutter.project_slug}}/requirements/base.txt @@ -1,4 +1,4 @@ -{% if cookiecutter.use_python2 == 'n' -%} +{% if cookiecutter.use_python3 == 'y' -%} # Wheel 0.25+ needed to install certain packages on CPython 3.5+ # like Pillow and psycopg2 # See http://bitly.com/wheel-building-fails-CPython-35 diff --git a/{{cookiecutter.project_slug}}/runtime.txt b/{{cookiecutter.project_slug}}/runtime.txt index 036fc81f..94159178 100644 --- a/{{cookiecutter.project_slug}}/runtime.txt +++ b/{{cookiecutter.project_slug}}/runtime.txt @@ -1 +1 @@ -{% if cookiecutter.use_python2 == 'n' -%}python-3.5.1{% else %}python-2.7.10{%- endif %} +{% if cookiecutter.use_python3 == 'y' -%}python-3.5.1{% else %}python-2.7.10{%- endif %} diff --git a/{{cookiecutter.project_slug}}/utility/install_python_dependencies.sh b/{{cookiecutter.project_slug}}/utility/install_python_dependencies.sh index d23fcf9e..074bc192 100755 --- a/{{cookiecutter.project_slug}}/utility/install_python_dependencies.sh +++ b/{{cookiecutter.project_slug}}/utility/install_python_dependencies.sh @@ -6,7 +6,7 @@ PROJECT_DIR="$(dirname "$WORK_DIR")" pip --version >/dev/null 2>&1 || { echo >&2 -e "\npip is required but it's not installed." echo >&2 -e "You can install it by running the following command:\n" -{% if cookiecutter.use_python2 == 'n' -%} +{% if cookiecutter.use_python3 == 'y' -%} echo >&2 "wget https://bootstrap.pypa.io/get-pip.py --output-document=get-pip.py; chmod +x get-pip.py; sudo -H python3 get-pip.py" {% else %} echo >&2 "wget https://bootstrap.pypa.io/get-pip.py --output-document=get-pip.py; chmod +x get-pip.py; sudo -H python2 get-pip.py" @@ -19,7 +19,7 @@ pip --version >/dev/null 2>&1 || { virtualenv --version >/dev/null 2>&1 || { echo >&2 -e "\nvirtualenv is required but it's not installed." echo >&2 -e "You can install it by running the following command:\n" -{% if cookiecutter.use_python2 == 'n' -%} +{% if cookiecutter.use_python3 == 'y' -%} echo >&2 "sudo -H pip3 install virtualenv" {% else %} echo >&2 "sudo -H pip2 install virtualenv" @@ -32,7 +32,7 @@ virtualenv --version >/dev/null 2>&1 || { if [ -z "$VIRTUAL_ENV" ]; then echo >&2 -e "\nYou need activate a virtualenv first" echo >&2 -e 'If you do not have a virtualenv created, run the following command to create and automatically activate a new virtualenv named "venv" on current folder:\n' -{% if cookiecutter.use_python2 == 'n' -%} +{% if cookiecutter.use_python3 == 'y' -%} echo >&2 -e "virtualenv venv --python=\`which python3\`" {% else %} echo >&2 -e "virtualenv venv --python=\`which python2\`" diff --git a/{{cookiecutter.project_slug}}/utility/requirements-jessie.apt b/{{cookiecutter.project_slug}}/utility/requirements-jessie.apt index bee7d3c9..ba7efc3f 100644 --- a/{{cookiecutter.project_slug}}/utility/requirements-jessie.apt +++ b/{{cookiecutter.project_slug}}/utility/requirements-jessie.apt @@ -3,7 +3,7 @@ build-essential #required to translate gettext -{% if cookiecutter.use_python2 == 'n' -%} +{% if cookiecutter.use_python3 == 'y' -%} python3-dev {% else %} python-dev diff --git a/{{cookiecutter.project_slug}}/utility/requirements-trusty.apt b/{{cookiecutter.project_slug}}/utility/requirements-trusty.apt index 462af572..966e9576 100644 --- a/{{cookiecutter.project_slug}}/utility/requirements-trusty.apt +++ b/{{cookiecutter.project_slug}}/utility/requirements-trusty.apt @@ -3,7 +3,7 @@ build-essential #required to translate gettext -{% if cookiecutter.use_python2 == 'n' -%} +{% if cookiecutter.use_python3 == 'y' -%} python3-dev {% else %} python-dev diff --git a/{{cookiecutter.project_slug}}/utility/requirements-xenial.apt b/{{cookiecutter.project_slug}}/utility/requirements-xenial.apt index 0688175b..157bdf20 100644 --- a/{{cookiecutter.project_slug}}/utility/requirements-xenial.apt +++ b/{{cookiecutter.project_slug}}/utility/requirements-xenial.apt @@ -3,7 +3,7 @@ build-essential #required to translate gettext -{% if cookiecutter.use_python2 == 'n' -%} +{% if cookiecutter.use_python3 == 'y' -%} python3-dev {% else %} python-dev