fab.api.v3#

User-accessible API.

class fab.api.v3.BuildScript#
property build_name: str#

Determine the build name based on a property of the class name.

class fab.api.v3.FileTreeRepository(identity, source, paths=None, projects=None)#

Treat the filing system as a repository of source.

Parameters:

filename – Location of source.

create_action(database)#

Creates an action to copy source.

Return type:

RepositoryAction

class fab.api.v3.GitRepository(identity, dependencies_file=None, source=None, ref=None, paths=None, projects=None)#

Fetches source from a Git repository.

Parameters:
  • identity (str) – name of the repo

  • dependencies_file (Path | None) – Path to dependencies file (default: None)

  • source (str | None) – url to remote source (default: None)

  • ref (str | None) – git version control reference (eg. hash, tag, branch) (default: None)

  • paths (dict[str, Path] | None) – Named paths in this directory. (default: None)

  • projects (list[Project] | None) – Initial list of projects held in repository. (default: None)

static default_git_source(dependencies_file)#
Return type:

str

Returns:

root path of dependencies file clone, or nothing if not a git source

create_action(database)#

Creates an action to get source.

Return type:

RepositoryAction

Returns:

Source extract action

class fab.api.v3.Project(project_dir, identifier=None, source_dir=PosixPath('source'), source_include=None, source_encoding=None, paths=None, unit_test_dir=PosixPath('unit-test'), configuration_meta_data=PosixPath('rose-meta'), force_include_dir=None)#

Represents a software project.

Parameters:
  • project_dir (Path) – Directory holding project.

  • identifier (str | None) – Identifying name, defaults to directory leaf name. (default: None)

  • source_dir – Project subdirectory holding source, defaults to source. (default: PosixPath('source'))

  • source_include (list[Path] | None) – List of paths to be extracted from the project. If not specified, everything is imported. source. (default: None)

  • unit_test_dir (Path) – Project subdirectory holding unit tests, defaults to unit-test. (default: PosixPath('unit-test'))

  • paths (dict[str, Path] | None) – Mapping of repository executables to tool names. (default: None)

  • configuration_meta_data (Path) – Project subdirectory holding configuration metadata, defaults to rose-meta. (default: PosixPath('rose-meta'))

property identifier: str#

Gets identifying name.

property project_dir: Path#

Gets project directory.

property source_dir: Path#

Gets full source directory, including project directory.

property unit_test_dir: Path#

Gets full unit test directory, including project directory.

property configuration_meta_data: Path#

Gets full metadata directory, including project directory.

class fab.api.v3.Repository(identity, source, ref=None, paths=None, projects=None)#

Abstract version control tool.

Parameters:
  • paths (dict[str, Path] | None) – Named paths in this directory. (default: None)

  • projects (list[Project] | None) – Projects in this directory. (default: None)

add_project_directory(project)#

Adds a project to the repository.

Parameters:

project (Project) – New project.

Return type:

None

source_is_local()#

Check if the source is remote, or local to the filesystem or a filesystem accessible via ssh

Return type:

bool

Returns:

True if local

property identity: str#

Source for this repo

property source: str | Path#

Source for this repo

property ref: str | None#

Version Control reference for this repo

property paths: dict[str, Path]#

Gets all special paths.

property projects: list[Project]#

Gets all projects in directory.

abstractmethod create_action(database)#

Creates an action to extract repository.

Parameters:

database (Database) – Build state and configuration.

Return type:

RepositoryAction

class fab.api.v3.SVNRepository(identity, dependencies_file=None, source=None, ref=None, paths=None, projects=None)#
Parameters:
  • identity (str) – name of the repo

  • dependencies_file (Path | None) – Path to dependencies file (default: None)

  • source (str | None) – url to remote source (default: None)

  • ref (str | None) – git version control reference (eg. hash, tag, branch) (default: None)

  • paths (dict[str, Path] | None) – Named paths in this directory. (default: None)

  • projects (list[Project] | None) – Initial list of projects held in repository. (default: None)

static default_svn_source(dependencies_file)#
Return type:

str

Returns:

svn wc root of dependencies file, or nothing if not svn source

create_action(database)#

Creates an action to get source.

Return type:

RepositoryAction

Returns:

Source extract action

class fab.api.v3.WriteOnceDict#

A write once dictionary. Users cannot add the same key, or use the delete function.