pydmt.api package

Submodules

pydmt.api.builder module

class pydmt.api.builder.Builder[source]

Bases: ABC

A Builder is what really builds things in the system. A builder knows on which inputs it relies and what outputs it generates (sometimes before build and sometimes after).

abstract build() None[source]

this method actually does the building Just do whatever you want here. Options are: - Write pure python code - Call native code - Call external programs - A combination of the above If there are any problems then throw an exception. Try not to segfault the interpreter in this method…:)

get_name() str[source]

Override this to get better names :return: the name of this builder

get_signature() str[source]

return the sha1 of anything that identifies the sources of the build Techically this is the sha1 of the file content of the list of files returned from get_sources()

abstract get_sources() Sequence[Node][source]

return the name of the source files for this builder If the builder takes a whole folder the list all the filers in that folder. If a built takes all the .py files in a folder then list those. In the current implementation this method is not really that important because it is not used to calculate the signature of the input to the build. The @get_signature method is use for that. In the future the get_signature method will go away.

abstract get_targets() Sequence[Node][source]

return list of targets

get_targets_as_string() str[source]
abstract yield_results() Generator[Tuple[str, str], None, None][source]

Return the signatures and names of results :return:

class pydmt.api.builder.File(filename: str)[source]

Bases: Node

This is a node which is a file

add_to_digester(d: Digester) None[source]
get_name()[source]
remove()[source]
class pydmt.api.builder.Folder(folder: str)[source]

Bases: Node

This is a node representing a single Folder

add_to_digester(d: Digester) None[source]
get_name()[source]
remove()[source]
class pydmt.api.builder.Node[source]

Bases: ABC

This is a source object which knows how to add his checksum to a checksum calculation

abstract add_to_digester(d: Digester) None[source]
abstract get_name() str[source]
abstract remove() None[source]
class pydmt.api.builder.SourceFile(filename: str)[source]

Bases: File

class pydmt.api.builder.SourceFiles(filenames: List[str], name: str)[source]

Bases: Node

This is a source of many files

add_to_digester(d: Digester) None[source]
get_name()[source]
remove()[source]
class pydmt.api.builder.SourceFolder(folder: str)[source]

Bases: Folder

class pydmt.api.builder.TargetFile(filename: str)[source]

Bases: File

class pydmt.api.builder.TargetFolder(folder: str)[source]

Bases: Folder

pydmt.api.copy module

class pydmt.api.copy.Copy(source: str, target: str)[source]

Bases: OneSourceOneTarget

build()[source]

this method actually does the building Just do whatever you want here. Options are: - Write pure python code - Call native code - Call external programs - A combination of the above If there are any problems then throw an exception. Try not to segfault the interpreter in this method…:)

pydmt.api.fail module

class pydmt.api.fail.Fail(source: str, target: str)[source]

Bases: OneSourceOneTarget

This is a builder that fails. Why do we need it? Tests Why does it need a source and target? Because otherwise it would not get triggered

build()[source]

this method actually does the building Just do whatever you want here. Options are: - Write pure python code - Call native code - Call external programs - A combination of the above If there are any problems then throw an exception. Try not to segfault the interpreter in this method…:)

pydmt.api.feature module

class pydmt.api.feature.Feature[source]

Bases: ABC

A Feature is a piece of code that adds builder to a pydmt system in a predefined way. This is a way to share common practices between projects.

Examples of features can be: - all the rules about how to build a python module with documentation and release it. - all the rules about how to build a C project and release it.

These are similar to facets or natures in development environments.

abstract setup(pydmt: PyDMT) None[source]

build your feature here

pydmt.api.one_source_one_target module

class pydmt.api.one_source_one_target.OneSourceOneTarget(source: str, target: str)[source]

Bases: Builder

This is a builder which has one source file and one target file

get_sources() Sequence[Node][source]

return the name of the source files for this builder If the builder takes a whole folder the list all the filers in that folder. If a built takes all the .py files in a folder then list those. In the current implementation this method is not really that important because it is not used to calculate the signature of the input to the build. The @get_signature method is use for that. In the future the get_signature method will go away.

get_targets() Sequence[Node][source]

return list of targets

yield_results() Generator[Tuple[str, str], None, None][source]

Return the signatures and names of results :return:

Module contents