libvcs is a typed Python library that detects and parses Git, Mercurial, and Subversion URLs, wraps their command-line tools, and synchronizes local checkouts against a remote — plus a pytest plugin for testing against real, disposable VCS repositories. It powers vcspull.
Follow the conventions already in the tree, and keep a change scoped to what was asked for.
| Path | What it is |
|---|---|
src/libvcs/url/ |
URL detection and parsing for git, hg, svn; rule registry |
src/libvcs/cmd/ |
Typed wrappers around the git, hg, svn binaries |
src/libvcs/sync/ |
Repository sync (clone, update, obtain) built on cmd/ |
src/libvcs/_internal/ |
Subprocess runner, dataclasses, QueryList; no compatibility guarantee |
src/libvcs/pytest_plugin.py |
pytest11 plugin: fixtures for disposable git/hg/svn repos |
tests/ |
Test suite, laid out to mirror src/libvcs/ |
docs/ |
Sphinx (MyST) site; build with just build-docs |
CHANGES |
Changelog; rendered as the docs changelog page |
README.md |
Project overview; listed in testpaths (see below) |
justfile |
Task runner for tests, lint, mypy, and docs |
- Documentation, user-facing text,
CHANGES, release notes, commit messages, docstrings, and source comments: .github/WRITING.md - Environment, the gates, tests, documentation builds, releases, and pull requests: .github/CONTRIBUTING.md
Each of those is the single home for its subject. Where a rule seems to be stated twice, the file listed above is the one that governs.
- Make the smallest coherent change that solves the verified problem; keep unrelated cleanup out of it.
- Reuse an existing file, helper, API, or test before adding a new one.
- Add a file only for a durable boundary — a distinct responsibility, independent reuse, or splitting an oversized module — not for a single-use helper or a one-line re-export.
- Add a test for every user-visible behaviour change, and a
CHANGESentry for every change to the public API or pytest fixtures. - A passing gate is evidence only once it has been shown capable of failing. Pair a new test with a deliberate break that proves it bites.
pyproject.tomlruns--doctest-docutils-modulesovertestpaths = ["src/libvcs", "tests", "docs", "README.md"]. A>>>prompt anywhere under those paths is a collected, executing test; deleting the prompt deletes the test even if the surrounding prose survives.- A test that shells out to
git,hg, orsvnskips automatically when that binary is not onPATH— seesrc/libvcs/pytest_plugin.py. - libvcs is pre-1.0: a minor version bump may break the public API. See Releasing.
- Changelog:
CHANGES - Docs: https://libvcs.git-pull.com
- Source: https://github.com/vcs-python/libvcs
- Downstream consumer: vcspull