This project is a template for python scientific projects. This template comes with utilities to easily setup continuous integration, project configurations and more. Follow the next instructions to setup your own project.
- Download this template and put it into your git repository
- Rename the
mypackage
directory as your project's name - Put your code inside your package directory
- Put any tests you have inside the
tests
directory - Put any data files you use under the
data
directory - Update the
README.md
to relate to your project
- change the project name
- update the pre-requirements if any (or remove them if none)
- update the installation instructions
- put your usage examples and other documentation on it
- Remove this
INSTRUCTIONS.md
file
This repository is a template of a python project integrating several good software engineering practices and new documentation tools. This document will lead you in the path of filling the template and create your python project easily.
One of the first things you need to do is to name your project. Brand it. People will know it by its name. The name can be an acronym such as (CaBAnA = Can Be An Acronym) or it can be a fantasy name. It may include a metaphore or not. The only important thing is that it should be easy to remember. Long project names, or acronyms with too many consonants are not good for that. Think also that depending on the technology or the conventions, some tools require special casing: start with uppercase or lowercase, spaces allowed or forbidden, underscores or not... Choose wisely.
Once you have that, you can replace all tags such as [Project Name] and [project_name] all over the readme.
Tell me what your project is about. Is it a library, a framework, or a tool? Why is this important, what is the problem it solves? Is it something really new and cool? Tell me. You should convince the reader that he should download your project and not the neighbour's one.
Choose a licence and update the text into the LICENCE file.
People knowing python will probably know pip
and how it works. Maybe some C. But they for sure don't know the internals of your package. They want single-click or copy paste-install.
- Explain the instructions to install strange dependencies
- Create a setup.py with all the correct dependencies. So people just need to write
pip install .
You should not modify too much this section. This should be standard, people should feel that they know the process, that "they know what they are doing", even if they are not.
To make that easy, we need to keep the pip install
and just update the setup.py
file with the correct dependency information.
Continuous integration for Unix and MacOSX uses TravisCI (https://travis-ci.org).
-
Travis CI has a main configuration file named .travis.yml that needs to be updated for your needs. That is, set the versions of python you would like to test for, set special scripts to run tests, and so on.
-
On the README.md, there is a build tag that shows what is the status of your build. You should fill the template tag with your username, your project name, and the branch that is built (usually master?).
This tag looks like this:
=>
- You should go to https://travis-ci.org/profile/[your_username] and activate the travis CI for your project
- Update the
.travis.yml
with your own configuration matrix. The template already comes with scripts to run on linux and osx. Read the comments and documentation set in the file for specificities of osx. - Update the
.travis.yml
install with your installation instructions - Update the
.travis.yml
script with your testing instructions. This could be callingpytest
or executing an arbitrary program of yours. - Log in into (https://travis-ci.org/) and activate your project
- Update the build status button with your project's corresponding travis URLs. Travis gives you a copy-past alternative also: go to your project's travis page and click on the button next to github's cat. That will give you several copy-paste options.