In the first part of “Bootstrapping a Python software project”, I covered the basics of creating packages (source code folders) and modules (source code files). I also covered the very basics of writing and running tests for your Python code.
Example source code for this tutorial is available on github.
In part 2, I will cover:
- A tool called “pip”, which will help you install all sorts of Python tools and third-party libraries
- More about running tests, tools for running tests, and what “code coverage” means (and how to analyze it)
So first, let’s install these tools. Then I’ll show you how to use them. Continue reading
This how-to is geared towards people who are new to Python. I’ll assume that you know how to navigate through files and directories, you know how to use a text editor, and most importantly, you know what a shell (command-line) is. It’s probably good if you already have at least some basic programming experience (if not, that’s okay; we won’t be do anything terribly complex). For best results, go through step-by-step and follow the examples exactly.
Oh, I’ll also assume that you’re not using Windows. Sorry. The commands I describe below are intended to be run on a Unix-like platform (such as Linux or Mac OS X). If you’re using Windows and you’re a more advanced user who is comfortable with the Windows Command Prompt, you should still be able to follow along.
In this article, I’ll just cover the absolute basics:
- python installation
- creating project directories
- creating python source packages and modules
- creating test code packages and modules
- running tests to exercise your code
In Part 2, I’ll introduce you to some tools that will help you keep your Python project healthy and happy.
Update: Example source code files are now available on github.
Moving right along. Continue reading