Step-by-step guide¶
1. Create service accounts¶
We will depend on services are free for open source projects.
Feel free to skip any services in which you already have an account.
Below you can find direct links for account creation pages:
- Make a github account
- Make a PyPi account
- Make a Read-The-Docs account
- Make a Travis account (requires a github account)
2. Install virtualenv¶
pip install virtualenv
See also
If you are feeling adventurous, use pipenv a great tool for python development workflow including managing virtualenvs and keeping track of installed packages (Pipfile)
3. Install cookiecutter¶
To speed-up our productivity we will use cookiecutter.
pip install cookiecutter
4. Create your package with cookiecutter¶
Warning
you will need to have git installed for this step.
The template is available on github at gabrielfalcao/cookiecutter-from-editor-to-pypi
Cookiecutter is smart enough to install directly from github, for that
just run the following command from your ~/projects
folder or
wherever you prefer to keep personal projects.
cookiecutter gh:gabrielfalcao/cookiecutter-from-editor-to-pypi
Important
Answer carefully to the interactive questions. Try your best to avoid typos in this step as it might impact many files of your newly-created project.
5. Enter your virtualenv¶
This gives you a sandbox python environment where it’s safe to install dependencies without compromising the integrity of your system packages.
In your terminal, go to your project root path and run:
source __virtualenv__/bin/activate
6. Run tests¶
Considering that you succeeded on the step 5. Enter your virtualenv just run:
make unit
make functional
7. Build your pre-generated documentation¶
Considering that you succeeded on the step 5. Enter your virtualenv just run:
source __virtualenv__/bin/activate
make docs
8. Create a github repository and push your code¶
Head to https://github.com/new and create a repository that matches your pypi package name.
The cookiecutter template already created a git repository for you, so you can simply go to your project root path and add the git remote ``origin`` as instructed by github.