PyCon 2019 Tutorial: Writing Command Line Applications that Click
- Python 3.5+ installed. Python Installation Guide
virtualenv
&pip
(Should be installed if you follow the guide above)- Git. Git installation instructions
- Optional:
pipenv
orvirtualenvwrapper
This repo is a Python package. You will create a virtualenv and install the package which will install its dependencies and make new commands available.
- Open a terminal / command prompt.
- Recommended on Windows: PowerShell or WSL.
- Clone this repo:
git clone https://github.com/tylerdave/PyCon2019-Click-Tutorial.git
- If you'd like to save a remote copy of your changes, create a new empty repo at your source code hosting service of choice and add it as a git remote:
git remote add personal $NEW_REPO_URL
- If you'd like to save a remote copy of your changes, create a new empty repo at your source code hosting service of choice and add it as a git remote:
cd
to the root of the cloned repo:cd PyCon2019-Click-Tutorial
- Create and activate a virtualenv using your favorite method and then install the package:
- Recommended: using
pipenv
(installation instructions):pipenv --python python3
pipenv install
- On Mac/Linux:
pipenv shell
- On Windows:
pipenv shell
might give you a reduced feature shell. You should run commands withpipenv run $COMMAND
instead like:pipenv run pycon verify
instead of justpycon verify
in the step below.
- If using
virtualenvwrapper
:mkvirtualenv --python python3 click-tutorial
workon click-tutorial
pip install -e .
- Manually:
python3 -m venv env
- On Mac/Linux:
source env/bin/activate
- On Windows:
.\env\Scripts\activate
pip install -e .
- Recommended: using
- Verify installation. One of the commands that's created by this package is
pycon
. You can use it to verify your setup was successful:pycon verify
- Initialize tutorial. In the root of the repo, run
tutorial init
.