evariste.plugins.vcs

evariste.plugins.vcs

Access to VCS (git, etc.) versionned files.

Every path processed here is a pathlib.Path object.

class evariste.plugins.vcs.VCS(shared)[source]

Generic class to access to versionned files.

To write a new VCS plugin, one has to subclass this class, and implement every abstract method (see for instance the implementation of evariste.plugin.vcs.git.Git).

abstract __contains__(path: Path) bool[source]

Return True iff path is versionned.

from_repo(path: Path) Path[source]

Return path, relative to the repository root.

global_default_setup: Dict[str, Dict[str, str]] = {'setup': {'source': '.'}}

Default values for setup file. See Plugin.default_setup and Plugin.global_default_setup.

last_modified(path: Path) datetime[source]

Return the datetime of last modification.

plugin_type: str = 'vcs'

Type of the plugin. Plugins of the same type gather some common behaviour.

property source: Path

Return an absolute version of source setup option.

abstract walk() Iterable[Path][source]

Iterate versionned files, descendants of source (as defined by setup file).

abstract property workdir: Path

Return path of the root of the repository.

evariste.plugins.none

Dummy, do-nothing vcs. Used for tests.

class evariste.plugins.vcs.none.NoneVCS(shared)[source]

Dummy vcs: Does not access any file.

__contains__(path: Path) bool[source]

Return True iff path is versionned.

keyword: Union[None, str] = 'vcs.none'

Keyword plugin, used to reference it: it is used to enable plugins in the setup file, to name its section in the setup file, etc.

walk()[source]

Iterate versionned files, descendants of source (as defined by setup file).

property workdir: Path

Return path of the root of the repository.

evariste.plugins.git

Access to git-versionned files.

class evariste.plugins.vcs.git.Git(shared)[source]

Access git-versionned files

__contains__(path: Path) bool[source]

Return True iff path is versionned.

keyword: Union[None, str] = 'vcs.git'

Keyword plugin, used to reference it: it is used to enable plugins in the setup file, to name its section in the setup file, etc.

last_modified(path: Path) datetime[source]

Return the datetime of last modification.

walk() Iterable[Path][source]

Iterate versionned files, descendants of source (as defined by setup file).

property workdir: Path

Return path of the root of the repository.