reuse.vcs module#
This module deals with version control systems.
- class reuse.vcs.VCSStrategy(project: Project)[source]#
Bases:
ABC
Strategy pattern for version control systems.
- abstract classmethod find_root(cwd: str | PathLike | None = None) Path | None [source]#
Try to find the root of the project from cwd. If none is found, return None.
- Raises:
NotADirectoryError – if directory is not a directory.
- class reuse.vcs.VCSStrategyGit(project: Project)[source]#
Bases:
VCSStrategy
Strategy that is used for Git.
- classmethod find_root(cwd: str | PathLike | None = None) Path | None [source]#
Try to find the root of the project from cwd. If none is found, return None.
- Raises:
NotADirectoryError – if directory is not a directory.
- class reuse.vcs.VCSStrategyHg(project: Project)[source]#
Bases:
VCSStrategy
Strategy that is used for Mercurial.
- classmethod find_root(cwd: str | PathLike | None = None) Path | None [source]#
Try to find the root of the project from cwd. If none is found, return None.
- Raises:
NotADirectoryError – if directory is not a directory.
- class reuse.vcs.VCSStrategyNone(project: Project)[source]#
Bases:
VCSStrategy
Strategy that is used when there is no VCS.
- classmethod find_root(cwd: str | PathLike | None = None) Path | None [source]#
Try to find the root of the project from cwd. If none is found, return None.
- Raises:
NotADirectoryError – if directory is not a directory.
- class reuse.vcs.VCSStrategyPijul(project: Project)[source]#
Bases:
VCSStrategy
Strategy that is used for Pijul.
- classmethod find_root(cwd: str | PathLike | None = None) Path | None [source]#
Try to find the root of the project from cwd. If none is found, return None.
- Raises:
NotADirectoryError – if directory is not a directory.