Difference between revisions of "Python package layout"

From Software Heritage Wiki
Jump to navigation Jump to search
 
m (1 revision: import public pages from the intranet wiki)
(No difference)

Revision as of 13:02, 20 July 2016

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

Makefile

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

check
run static code checks
test
run test suite
coverage
run test suite and verify code coverage

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:

requirements.txt
dependencies on other packages, as expected by pip
setup.py
setuptools packaging driver

See also