libvcs.sync.base

Foundation for the sync classes. Add your own VCS — or extend libvcs — by subclassing BaseSync.

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

class libvcs.sync.base.SyncError
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
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
class libvcs.sync.base.VCSLocation

Bases: NamedTuple

Generic VCS Location (URL and optional revision).

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

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

Parameters:

pip_url (str)

Return type:

VCSLocation

class libvcs.sync.base.BaseSync
class libvcs.sync.base.BaseSync

Bases: object

Base class for repositories.