sphinx_polyversion.vcs

Abstract version provider API.

Classes

VersionProvider(*args, **kwargs)

Base for classes providing target revisions of the docs to build.

class sphinx_polyversion.vcs.VersionProvider(*args, **kwargs)[source]

Bases: Protocol[RT]

Base for classes providing target revisions of the docs to build.

abstract async checkout(root: Path, dest: Path, revision: RT) None

Create copy of a specific revision at the given path.

Parameters:
  • root (Path) – The root path of the project.

  • dest (Path) – The destination to extract the revision to.

  • revision (Any) – The revision to extract.

name(revision: RT) str

Get the (unique) name of a revision.

This name will usually be used for creating the subdirectories of the revision.

Parameters:
  • root (Path) – The root path of the project.

  • revision (Any) – The revision whose name is requested.

Returns:

The name of the revision.

Return type:

str

abstract async retrieve(root: Path) Iterable[RT]

List all build targets.

The build targets comprise all revisions that should be build.

Parameters:

root (Path) – The root path of the project.

Returns:

The build targets.

Return type:

Iterable[RT]