libvcs.sync.base¶

Base objects / classes for projects.

Adding your own VCS / Extending libvcs can be done through subclassing BaseSync.

Foundational tools to set up a VCS manager in libvcs.sync.

class libvcs.sync.base.SyncError
¶

Bases: object

An error encountered during a sync step.

Examples

>>> error = SyncError(step="fetch", message="remote not found")
>>> error.step
'fetch'
>>> error.message
'remote not found'
>>> error.exception is None
True
class libvcs.sync.base.SyncResult
¶

Bases: object

Result of a repository synchronization.

Examples

>>> result = SyncResult()
>>> result.ok
True
>>> bool(result)
True
>>> result = SyncResult()
>>> result.add_error(step="fetch", message="remote not found")
>>> result.ok
False
>>> bool(result)
False
>>> result.errors[0].step
'fetch'
class libvcs.sync.base.VCSLocation
¶

Bases: NamedTuple

Generic VCS Location (URL and optional revision).

libvcs.sync.base.convert_pip_url(pip_url)
¶
function[source]

Parse pip URL via libvcs.sync.base.BaseSync.url.

Parameters:

pip_url (str)

Return type:

VCSLocation

class libvcs.sync.base.BaseSync
¶

Bases: object

Base class for repositories.