Python package layout

From Software Heritage Wiki
(Redirected from Python module layout)
Jump to: navigation, search

This page documents the expected layout/behavior of Python packages developed by Software Heritage.

Naming convention

  • a Git repository called swh-something-else contains the Python package swh.something.else


Packages should have a top-level Makefile with the following targets:

run static code checks
run test suite
run test suite and verify code coverage
generate HTML documentation using Sphinx

Generic Python Makefile

The simplest way to fulfill Makefile requirements is to use the common Python Makefile available in swh-environment, e.g.:

$ cd swh-environment/swh-core 
$ cat Makefile 
# Makefile driver for SWH Python packages. DO NOT CHANGE.
# You can add custom Makefile rules to Makefile.local

include ../Makefile.python
-include Makefile.local

Package metadata

Each Python package should use the following top-level files to capture its metadata:

dependencies on other packages, as expected by pip
setuptools packaging driver

See also