Skip to content

Setting up a Development Environment

pincoin edited this page Aug 20, 2017 · 7 revisions

THIS IS DRAFT.

Prep

pyenv

Installation

$ curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash

Setup

~/.bashrc or ~/.bash_profile

export PATH="${HOME}/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

Dependency Packages

pyenv installs Python interpreters from scratch. Thus, your system must have the build system including the libraries such as GNU readline, zlib, bzip2, SQLite3 and OpenSSL.

$ sudo apt-get install build-essential libreadline-dev zlib1g-dev libbz2-dev libsqlite3-dev libssl-dev

Python installation

django-summernote must work on the fly with Python 2.x and 3.x.

$ pyenv install 2.7.13
$ pyenv install 3.4.7
$ pyenv install 3.5.3
$ pyenv install 3.6.2

You may see what versions with the following command:

$ pyenv versions

You may also check the list of available Python versions:

$ pyenv install —list

Virtual Environment

Create Virtual Environment

The following command will create a virtual environment with Python 3.6.2:

$ pyenv virtualenv 3.6.2 venv-3.6.2

If you omit the version, it will create virtual environment with the Python version of the current shell.

Use Virtual Environment

You can use virtual environment by specifying the name of the virtual environment name:

$ pyenv shell venv-3.6.2

Virtual Environment List

You can see the the virtual environment list:

$ pyenv virtualenvs

Delete Virtual Environment

You can delete virtual environment by specifying the name of the virtual environment name:

$ pyenv uninstall venv-3.6.2

django-summernote Build and Test

Clone github project

You have to fork original django-summernote project. You may clone your own project:

git clone https://github.com/YOUR_ACCOUNT/django-summernote.git
cd django-summernote/

Tox Installation

django-summernote project supports Tox/Travis.

(venv) $ pip install tox
(venv) $ pip freeze
pluggy==0.4.0
py==1.4.34
tox==2.7.0
virtualenv==15.1.0

Tox Test

Tox reads tox.ini file, and test all by the combination of Django versions(1.8, 1.9, 1.10, 1.11) and Python versions(2.7, 3.4, 3.5, 3.6)

(venv) $ tox

If successfully built, you can see the messsage at the bottom as shown below:

___________________________ summary ____________________________________________  
py27-dj108: commands succeeded
py27-dj108: commands succeeded
py27-dj109: commands succeeded
py27-dj110: commands succeeded
py27-dj111: commands succeeded
py34-dj108: commands succeeded
py34-dj109: commands succeeded
py34-dj110: commands succeeded
py34-dj111: commands succeeded
py35-dj108: commands succeeded
py35-dj109: commands succeeded
py35-dj110: commands succeeded
py35-dj111: commands succeeded
py36-dj111: commands succeeded
congratulations :)

django-summernote Manual Installation

After cloning the project, you can install django-summernote package for the purpose of development.

(venv) $ cd django-summernote/
(venv) $ python setup.py install -f

Pull Requests