|
### Recommended development tools/aliases
|
|
# Recommended development tools
|
|
|
|
|
|
_(Note: these instructions assume an Ubuntu variant - they may need to be modified for other systems.)_
|
|
_Note: these instructions assume an Ubuntu variant - they may need to be modified for other systems_
|
|
|
|
|
|
- __[Docker][docker] and [docker-compose][docker-compose]__:
|
|
### [Docker][docker] and [Docker Compose][docker-compose]:
|
|
|
|
|
|
- Follow instructions at: https://docs.docker.com/engine/installation/linux/ubuntulinux/
|
|
- Installation instructions: https://docs.docker.com/engine/install/ubuntu/
|
|
|
|
- Post-install instructions: https://docs.docker.com/engine/install/linux-postinstall/
|
|
The instructions are simple, and you only need to do them once. Upgrades are done automatically along with the rest of your system packages.
|
|
|
|
|
|
|
|
- Then, `sudo pip install docker-compose` to install docker-compose!
|
|
The instructions for installing docker engine will also install compose these days so there is no additional step to install compose. Upgrades are done automatically along with the rest of your system packages. The post install instructions will allow you to run docker as a non-root user, and configure docker to start on boot.
|
|
|
|
|
|
[docker]: https://www.docker.com/what-docker
|
|
[docker]: https://docs.docker.com/
|
|
[docker-compose]: https://docs.docker.com/compose/overview/
|
|
[docker-compose]: https://docs.docker.com/compose/
|
|
|
|
|
|
- __[Virtualenv][virtualenv] and [Virtualenvwrapper][virtualenvwrapper]__
|
|
### [PyEnv][pyenv]
|
|
|
|
|
|
These two packages are _essential_ tools for local Python environment isolation (especially if you aren't using docker yet); check out their doc pages for more details.
|
|
- Installation instructions (Basic Github Checkout): https://github.com/pyenv/pyenv#basic-github-checkout
|
|
|
|
- Bash shell instructions: https://github.com/pyenv/pyenv#set-up-your-shell-environment-for-pyenv
|
|
|
|
|
|
__Installation__:
|
|
You'll first need to clone the project into `~/.pyenv` using the installation instructions above, and then follow the shell environment instructions for bash (or whatever shell you're using) to add the ~/.pyenv directory to your PATH.
|
|
|
|
|
|
```bash
|
|
- Usage instructions: https://github.com/pyenv/pyenv#usage
|
|
sudo pip install virtualenvwrapper
|
|
|
|
echo 'WORKON_HOME="$HOME/.virtualenvs"' >> ~/.bash_aliases
|
|
|
|
echo 'PROJECT_HOME="$HOME/projects"' >> ~/.bash_aliases # replace 'projects' with your preferred development path
|
|
|
|
echo 'source /usr/local/bin/virtualenvwrapper.sh' >> ~/.bash_aliases
|
|
|
|
source ~/.bashrc
|
|
|
|
```
|
|
|
|
|
|
|
|
__Aliases__:
|
|
|
|
|
|
|
|
The virtualenvwrapper project comes with two commands, `mkvirtualenv` and `mkproject`, which will use your python2 interpreter by default. Here are some handy aliases to use the python3 interpreter when desired:
|
|
|
|
|
|
|
|
```bash
|
|
[pyenv]: https://github.com/pyenv/pyenv |
|
echo 'alias mkvirtualenv3="mkvirtualenv --python=`which python3`"' >> ~/.bash_aliases
|
|
|
|
echo 'alias mkproject3="mkproject --python=`which python3`"' >> ~/.bash_aliases
|
|
|
|
source ~/.bashrc
|
|
|
|
```
|
|
|
|
|
|
|
|
Now you can simply type `mkproject3 foo` to create a new project that uses your python3 interpreter by default.
|
|
|
|
|
|
|
|
|
|
|
|
[virtualenv]: https://virtualenv.readthedocs.org/en/latest/
|
|
|
|
[virtualenvwrapper]: https://virtualenvwrapper.readthedocs.org/en/latest/ |
|
|