PyTennessee 2016 - Writing Command Line Applications that Click
Tutorial for writing command line applications using click.
Know all about installing and developing Python packages and don't feel like reading the rest?:
- Have Git and Python installed
- Create and activate a virtualenv
- Clone this repo (or your own fork of it) and
- Install the package in editable mode:
pip install -e .
Installation: Detailed Instructions
In order to make use of this tutorial you will a system with the following installed:
- Python (2.7, 3.3, 3.4, 3.5)
If you do not already have these installed, follow these directions:
The virtualenv package allows you to create isolated environments for developing Python code.
To make sure it is installed, run this command:
pip install virtualenv
or on Windows (if the above doesn't work):
python -m pip install virtualenv
This will either install the package or let you know it's already installed. If it is already installed, you will see:
Requirement already satisfied (use --upgrade to upgrade)
Create a virtualenv for this tutorial:
Activate the virtualenv:
or on Windows:
Get The Tutorial
(Optional) Fork this repo on GitHub
Clone the repo locally (using either this repo's URL or that of your new fork.)
git clone https://github.com/tylerdave/PyTN2016-Click-Tutorial.git pytn
Install The Tutorial
The tutorial repo is configured to be a Python package in order to ease installation.
In a terminal/console
cdto cloned tutorial directory:
Install the package in editable mode:
pip install -e .
Run tests to verify installation:
py.test -v tests/
Verify that all tests report PASSED
Run The Tutorial
Once installed, the
tutorial command should be available.
See usage information