Module t.p.dist

Part of twisted.python View Source

Distutils convenience functionality.

API Stability: Unstable. Don't use it outside of Twisted.

Maintainer: Christopher Armstrong
Function setup An alternative to distutils' setup() which is specially designed
Function getVersion Extract the version number for a given project.
Function _filterNames Given a list of file names, return those names that should be copied.
Function relativeTo Gets 'relativee' relative to 'basepath'.
Function getDataFiles Get all the data files that should be included in this distutils Project.
Function getPackages Get all packages which are under dname. This is necessary for
Function getScripts Returns a list of scripts for a Twisted subproject; this works in
Class build_py_twisted Changes behavior in Python 2.2 to support simultaneous specification of
Class build_scripts_twisted Renames scripts so they end with '.py' on Windows.
Class install_data_twisted I make sure data files are installed in the package directory.
Class build_ext_twisted Allow subclasses to easily detect and customize Extensions to
def setup(**kw): (source)

An alternative to distutils' setup() which is specially designed for Twisted subprojects.

Pass twisted_subproject=projname if you want package and data files to automatically be found for you.

Pass detectExtensions=detectorFunction if your project has extension modules. detectorFunction will be called with an instance of build_ext_twisted and should return a list of distutils Extensions.
def getVersion(proj, base='twisted'): (source)
Extract the version number for a given project.
Parametersprojthe name of the project. Examples are "core", "conch", "words", "mail".
ReturnsThe version number of the project, as a string like "2.0.0". (type: str )
def _filterNames(names): (source)
Given a list of file names, return those names that should be copied.
def relativeTo(base, relativee): (source)

Gets 'relativee' relative to 'basepath'.

i.e.,
>>> relativeTo('/home/', '/home/radix/')
'radix'

>>> relativeTo('.', '/home/radix/Projects/Twisted') # curdir is /home/radix
'Projects/Twisted'
The 'relativee' must be a child of 'basepath'.
def getDataFiles(dname, ignore=None, parent=None): (source)

Get all the data files that should be included in this distutils Project.

'dname' should be the path to the package that you're distributing.

'ignore' is a list of sub-packages to ignore. This facilitates disparate package hierarchies. That's a fancy way of saying that the 'twisted' package doesn't want to include the 'twisted.conch' package, so it will pass ['conch'] as the value.

'parent' is necessary if you're distributing a subpackage like twisted.conch. 'dname' should point to 'twisted/conch' and 'parent' should point to 'twisted'. This ensures that your data_files are generated correctly, only using relative paths for the first element of the tuple ('twisted/conch/*'). The default 'parent' is the current working directory.
def getPackages(dname, pkgname=None, results=None, ignore=None, parent=None): (source)
Get all packages which are under dname. This is necessary for Python 2.2's distutils. Pretty similar arguments to getDataFiles, including 'parent'.
def getScripts(projname, basedir=''): (source)
Returns a list of scripts for a Twisted subproject; this works in any of an SVN checkout, a project-specific tarball.
API Documentation for twisted, generated by pydoctor.