Skip to content
Pablo Prietz edited this page Sep 2, 2022 · 7 revisions

Welcome to the python-module-skeleton instructions!

Context

This repository is meant to be used as a template for new Python modules at Pupil Labs. It is based on https://blog.jaraco.com/skeleton/

Creating a new repository

In order to create a new repo from the template follow these steps:

# create a folder `project-name` and initializes it as an empty git repository
git init project-name
cd project-name

# clones the template contents into the new repo
git pull https://github.com/pupil-labs/python-module-skeleton.git

First things to edit

  1. Open setup.cfg and edit the package's meta data accordingly
  2. Rename project_name accordingly in the following files:
    • src/pupil_labs/project_name/__init__.py
    • tests/test_api.py (see import statement)
  3. Rename the src/pupil_labs/project_name folder accordingly. Keep it in the pupil_labs folder to let your module be part of the Pupil Labs namespace (import pupil_labs.project_name)
  4. Rename skeleton in docs/index.rst to the appropriate module name

Make your package available to others

To make your package available to others, create a new, empty Github or Gitlab repository, copy its URL, and add it as a git remote. Then push the main branch. (Note: The command below assumes that your current branch is called main and that you have committed the changes from above.)

git remote add origin <copied url>
git push origin main

Learn more

To learn more about the template, go and read https://blog.jaraco.com/skeleton/