To install the unreleased libvcs version, see developmental releases.
pip:
$ pip install --user --upgrade --pre libvcsuv:
$ uv add libvcs --prerelease allow- Add {class}
~libvcs._internal.file_lock.FileLockfor cross-platform file locking - Add {func}
~libvcs._internal.file_lock.atomic_initfor race-free initialization - Support both sync and async usage patterns
- Useful for pytest-xdist compatibility
- Add {class}
TestAsyncFileLockwith 8 async tests - Add {class}
TestAsyncAtomicInitwith 4 async tests
- Migrate from
Makefiletojustfilefor running development tasks - Update documentation to reference
justcommands
- Migrate docs deployment to AWS OIDC authentication and AWS CLI
Fix doctree warnings and broken references
New architecture for git subcommands that returns typed objects instead of raw strings:
- Traversal handle collection-level operations (
ls(),get(),filter(),add()/create()) - Commands handle per-entity operations (
show(),remove(),rename()) - All
ls()methods returnQueryListfor chainable filtering
New subcommand managers accessible via Git instance:
- {attr}
Git.branches <libvcs.cmd.git.Git.branches>-> {class}~libvcs.cmd.git.GitBranchManager - {attr}
Git.remotes <libvcs.cmd.git.Git.remotes>-> {class}~libvcs.cmd.git.GitRemoteManager - {attr}
Git.stashes <libvcs.cmd.git.Git.stashes>-> {class}~libvcs.cmd.git.GitStashManager - {attr}
Git.tags <libvcs.cmd.git.Git.tags>-> {class}~libvcs.cmd.git.GitTagManager - {attr}
Git.worktrees <libvcs.cmd.git.Git.worktrees>-> {class}~libvcs.cmd.git.GitWorktreeManager - {attr}
Git.notes <libvcs.cmd.git.Git.notes>-> {class}~libvcs.cmd.git.GitNotesManager - {attr}
Git.submodules <libvcs.cmd.git.Git.submodules>-> {class}~libvcs.cmd.git.GitSubmoduleManager - {attr}
Git.reflog <libvcs.cmd.git.Git.reflog>-> {class}~libvcs.cmd.git.GitReflogManager
Example usage:
git = Git(path="/path/to/repo")
# List all branches, filter remote ones
remote_branches = git.branches.ls(remotes=True)
# Get a specific tag
tag = git.tags.get(tag_name="v1.0.0")
tag.delete()
# Create a new branch and switch to it
git.branches.create("feature-branch")- Added
ref_formatparameter for--ref-format(files/reftable) - Added
make_parentsparameter to auto-create parent directories - Improved parameter validation with clear error messages
- Extended
sharedparameter to support octal permissions (e.g., "0660")
- Add API documentation for all new Manager/Cmd classes (#465)
- Split git subcommand documentation into separate pages: branch, tag, worktree, notes, reflog
- Comprehensive test coverage for all new Manager/Cmd classes (#465)
-
Drop support for Python 3.9; the new minimum is Python 3.10 (#497).
See also:
- Add Python 3.14 to test matrix (#496)
- Add support for SCP-style Git URLs without requiring
git+ssh://prefix (#490)- URLs like
git@github.com:org/repo.gitare now recognized as Git repositories create_project()can now auto-detect VCS type for these URLs- Addresses issues reported in vcspull#49 and vcspull#426
- URLs like
- Fix
run()output to show streaming progress of commands likegit clone, this fixes an issue downstream invcspull(#493)
- Cursor rules for development loop and git commit messages (#488)
This means that unicode, not bytes, will be used for running subprocess
commands in libvcs. If there are any compatibility issues with this, please file
a ticket.
- Add
from __future__ import annotationsto defer annotation resolution and reduce unnecessary runtime computations during type checking. - Enable Ruff checks for PEP-compliant annotations:
For more details on PEP 563, see: https://peps.python.org/pep-0563/
Maintenance only, no bug fixes, or new features
uv is the new package and project manager for the project, replacing Poetry.
Build system moved from poetry to hatchling.
Added Python 3.13 to package trove classifiers and CI tests.
- New, customizable session-scoped fixtures for default committer on Mercurial and Git:
- Name: {func}
libvcs.pytest_plugin.vcs_name - Email: {func}
libvcs.pytest_plugin.vcs_email - User (e.g.
user <email@tld>): {func}libvcs.pytest_plugin.vcs_user - For git only: {func}
libvcs.pytest_plugin.git_commit_envvars
- Name: {func}
New repos will automatically apply these session-scoped fixtures.
-
Pytest fixtures
hg_remote_repo_single_commit_post_init()andgit_remote_repo_single_commit_post_init()now support passingenvfor VCS configuration.Both functions accept
hgconfigandgitconfigfixtures, now applied in thehg_repoandgit_repofixtures.
- Pytest fixtures:
git_repoandhg_repo: Set configuration for both fixtures.
Update to commands for Git from #465 were pushed to trunk before being prepared (even for experimental use).
These are now set by set_hgconfig and set_gitconfig, which set HGRCPATH and GIT_CONFIG, instead of overriding HOME.
- Updates for pytest plugin documentation.
Improved test execution speed by over 54% by eliminated repetitive repository reinitialization between test runs. Git, Subversion, and Mercurial repositories are now cached from an initial starter repository
Renamed git_local_clone to example_git_repo for better understandability in
documentation / doctests.
libvcs.cmd.git.GitCmd._list()->libvcs.cmd.git.Git.ls()libvcs.cmd.svn.Svn._list()->libvcs.cmd.svn.Svn.ls()
- url(git): Remove unused
weight=0flags fromAWS_CODE_COMMIT_DEFAULT_RULES(#464) - url(git[GitURL]): Support for detection of AWS CodeCommit URLs (#464)
- url(registry): Tests for
test_registry.pydetection of AWS CodeCommit URLs (#464)
- README: Overhaul and fixes
-
Support for AWS CodeCommit URL patterns. Examples:
- HTTPS:
https://git-codecommit.us-east-1.amazonaws.com/v1/repos/test - SSH:
ssh://git-codecommit.us-east-1.amazonaws.com/v1/repos/test - HTTPS (GRC):
codecommit::us-east-1://testcodecommit://test
- HTTPS:
RE_PIP_REVmoved fromlibvcs.url.gittolibvcs.url.constants.- Regex pattern for user (e.g.,
git@) decoupled toRE_USER. RE_PATHandSCP_REGEX(nowRE_SCP) no longer include user regex pattern- Existing patterns now use
RE_USERexplicitly.
- Existing patterns now use
REGEX_SCPrenamed toRE_SCPfor consistency.
- Automatically linkify links that were previously only text.
- Fix docstrings in
query_listforMultipleObjectsReturnedandObjectDoesNotExist.
-
poetry: 1.8.1 -> 1.8.2
See also: https://github.com/python-poetry/poetry/blob/1.8.2/CHANGELOG.md
-
Code quality: Use f-strings in more places (#460)
via ruff 0.4.2.
Maintenance only, no bug fixes, or new features
-
Aggressive automated lint fixes via
ruff(#458)via ruff v0.3.4, all automated lint fixes, including unsafe and previews were applied:
ruff check --select ALL . --fix --unsafe-fixes --preview --show-fixes; ruff format .
Branches were treated with:
git rebase \ --strategy-option=theirs \ --exec 'poetry run ruff check --select ALL . --fix --unsafe-fixes --preview --show-fixes; poetry run ruff format .; git add src tests; git commit --amend --no-edit' \ origin/master -
poetry: 1.7.1 -> 1.8.1
See also: https://github.com/python-poetry/poetry/blob/1.8.1/CHANGELOG.md
-
ruff 0.2.2 -> 0.3.0 (#457)
Related formattings. Update CI to use
ruff check .instead ofruff ..See also: https://github.com/astral-sh/ruff/blob/v0.3.0/CHANGELOG.md
-
Git.rev_list: Fix argument expansion (#455)Resolves issue with fatal: '--max-count': not an integer.
- CI: Bump actions to Node 20 releases (#456)
- Source distribution: Include
CHANGES,MIGRATION, anddocs/in tarball (#454)
QueryListgeneric support improved (#453)
-
Strengthen linting (#514)
-
Add flake8-commas (COM)
-
Add flake8-builtins (A)
-
Add flake8-errmsg (EM)
-
- Move CodeQL from advanced configuration file to GitHub's default
-
Rename pytest plugin protocol typings (#450):
CreateProjectCallbackProtocol->CreateRepoPostInitFnCreateProjectCallbackFixtureProtocol->CreateRepoPytestFixtureFn
- Remove unused command:
Svn.mergelist(#450) - Fix
Git.configdocstring (#450)
-
ci: Add pydocstyle rule to ruff (#449)
-
Add test for direct usage of
HgSync(#450) -
pytest-watcher, Add configuration (#450):
- Run initially by default
- Skip post-save files from vim
- Add docstrings to functions, methods, classes, and packages (#449)
- Move
gp-libstotestdependencies
Maintenance only, no bug fixes, or new features
-
Poetry: 1.6.1 -> 1.7.0
See also: https://github.com/python-poetry/poetry/blob/1.7.0/CHANGELOG.md
-
Move formatting from
blacktoruff format(#448)This retains the same formatting style of
blackwhile eliminating a dev dependency by using our existing rust-basedrufflinter. -
Packaging (poetry): Fix development dependencies
Per Poetry's docs on managing dependencies and
poetry check, we had it wrong: Instead of using extras, we should create these:[tool.poetry.group.group-name.dependencies] dev-dependency = "1.0.0"
Which we now do.
-
CI: Update action package to fix warnings
- dorny/paths-filter: 2.7.0 -> 2.11.1
- Git Remote URLs: Fix bug that would cause git remotes with
@to be chopped off after the protocol (#446, fixes #431)
- Move pytest configuration to
pyproject.toml(#441)
-
ruff: Remove ERA /
eradicatepluginThis rule had too many false positives to trust. Other ruff rules have been beneficial.
-
query_list: Refactor to use access {mod}
typingvia namespace ast(#439)
Maintenance only, no bug fixes, or new features
-
Code quality improvements (#438)
Additional ruff settings have been enabled. The most recent contribution includes 100+ automated fixes and 50+ hand-made fixes.
- Fixes code comments cleaned up by
ruff, but missed in QA. In the future, even when using an automated tool, we will review more thoroughly.
Maintenance only, no bug fixes, or new features
SubprocessCommand: Typing fix fortextparam. Found via mypy(1).
Maintenance only, no bug fixes, or new features
-
Add back
blackfor formattingThis is still necessary to accompany
ruff, until it replaces black.
Maintenance only, no bug fixes, or new features
-
Move formatting, import sorting, and linting to [ruff].
This rust-based checker has dramatically improved performance. Linting and formatting can be done almost instantly.
This change replaces black, isort, flake8 and flake8 plugins.
-
poetry: 1.4.0 -> 1.5.0
See also: https://github.com/python-poetry/poetry/releases/tag/1.5.0
- Update mypy to 1.2.0
- SkipDefaultFieldsReprMixin: Fix typing for mypy 1.2.0
- Remove more
typing_extensionsfrom runtime (#437 didn't get them all)
-
QueryList learned to
.get()to pick the first result (#435)- Raises error if no items found (unless
default=keyword argument passed) - Raises error if multiple items found
- Raises error if no items found (unless
- Remove required dependency of typing-extensions (#437)
- Ignore a single line of mypy check in dataclasses for now (#437)
Official support for python 3.11
URL.rule_map is now a class attribute rather than a dataclass attribute.
File "/home/user/.python/3.11.0/lib/python3.11/dataclasses.py", line 1211, in wrap
return _process_class(cls, init, repr, eq, order, unsafe_hash,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.python/3.11.0/lib/python3.11/dataclasses.py", line 959, in _process_class
cls_fields.append(_get_field(cls, name, type, kw_only))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/user/.python/3.11.0/lib/python3.11/dataclasses.py", line 816, in _get_field
raise ValueError(f'mutable default {type(f.default)} for field '
ValueError: mutable default <class 'libvcs.url.base.RuleMap'> for field rule_map is not allowed: use default_factory- Sync, git: Update pytest fixtures, via #432
- CLI, git: Split subcommands into separate pages (remote, stash, submodule), via #432
via #430
-
Git
- Support for progress bar
- Add subcommands for:
- stash: {attr}
Git.stash <libvcs.cmd.git.Git.stash>-> {class}libvcs.cmd.git.GitStashCmd - remote: {attr}
Git.remote <libvcs.cmd.git.Git.remote>-> {class}libvcs.cmd.git.GitRemoteCmd - submodule: {attr}
Git.submodule <libvcs.cmd.git.Git.submodule>-> {class}libvcs.cmd.git.GitSubmoduleCmd
- stash: {attr}
- Added commands for:
- {meth}
libvcs.cmd.git.Git.rev_parse - {meth}
libvcs.cmd.git.Git.rev_list - {meth}
libvcs.cmd.git.Git.symbolic_ref - {meth}
libvcs.cmd.git.Git.show_ref
- {meth}
-
SVN
New and improved:
- {meth}
libvcs.cmd.svn.Svn.unlock - {meth}
libvcs.cmd.svn.Svn.lock - {meth}
libvcs.cmd.svn.Svn.propset
- {meth}
-
Mercurial
New and improved:
- {meth}
libvcs.cmd.hg.Hg.pull - {meth}
libvcs.cmd.hg.Hg.clone - {meth}
libvcs.cmd.hg.Hg.update
- {meth}
via #430
Git, SVN, and Mercurial have moved to libvcs.cmd
Maintenance only release, no bug fixes, or new features
- Documentation improvements
- Development package updates
- Add citation file (CITATION.cff)
-
Added
weightto matchers (#428)-
More heavily weighted matcher will have preference over others
-
Fixes an issue where
defaultswould be overwrittenThe first, highest weighted will "win", avoiding the recursion causing defau defaults for other matchers to be applied.
-
- URLs: Added
registry, match find which VCS a URL matches with (#420) create_project: Learn to guess VCS from URL, if none provided (#420)
URL renamings (#417):
Matcher->Rule,MatcherRegistry->Rulesmatches->rule_mapdefault_patterns->patternsMATCHERS->RULES
pytest plugin:
-
create_{git,svn,hg}_remote_repo()now acceptsinit_cmd_args(list[str], default:['--bare'], #426)To not use bare, pass
init_cmd_args=None
Sync:
git: Fixupdate_repowhen there are only untracked files (#425, credit: @jfpedroza)
URL (#423):
hg: AddHgBaseURL,HgPipURLsvn: AddSvnBaseURL,SvnPipURLURLProtocol: Fixis_validto useclassmethod- All: Fix
is_validto use default ofNoneto avoid implicitly filtering - Reduce duplicated code in methods by using
super()
-
Migrate
.coveragerctopyproject.toml(#421) -
Remove
.tmuxp.before-script.sh(was abefore_scriptin.tmuxp.yaml) that was unused. -
Move
conftest.pyto root level- Can be excluded from wheel, included in sdist
- Required to satisfy pytest's
pytest_pluginsonly being in top-level confte conftest.py files since 4.0 (see notice) - Makes it possible to run
pytest README.mdwith doctest plugin
- Use pytest's public API when importing (#418)
- Bump poetry to 1.1.x to 1.2.x
QueryList: Fix lookups of objects (#415)
- Basic pytest plugin test (#413)
- Add test for object based lookups (#414)
- Improve doc examples / tests for
keygetterandQueryListto show deep lookups for objects (#415)
-
CI speedups (#416)
- Avoid fetching unused apt package
- Split out release to separate job so the PyPI Upload docker image isn't pulled on normal runs
- Clean up CodeQL
Remove Faker dependency (#412)
Temporarily add Faker as a dependency (due to pytest), track longterm fix on (#411)
- Added a pytest plugin. Create fresh, temporarily repos on your machine locally for git, mercurial, and svn (#409)
-
Moves (#408):
libvcs.parse->libvcs.urllibvcs.projects->libvcs.sync
-
Renames (#408):
BaseProject->BaseSyncMercurialProject->HgSyncSubversionProject->SvnSyncGitProject->GitSync
-
Deprecate custom functions in favor of standard library:
which()in favor of {func}shutil.which, via #397mkdir_p()in favor of {func}os.makedirsand {meth}pathlib.Path.mkdirw/parents=True, via #399
- Remove
.pre-commit-config.yaml: This can be done less obtrusively via flake8 and having the user run the tools themselves. - Add flake8-bugbear (#379)
- Add flake8-comprehensions (#402)
-
Render changelog in
linkify_issues(#396, #403) -
Fix Table of contents rendering with sphinx autodoc with
sphinx_toctree_autodoc_fix(#403) -
Deprecate
sphinx-autoapi, per above fixing the table of contents issue (#403)This also removes the need to workaround autoapi bugs.
-
New and improved logo
-
Improved typings
Now
mypy --strictcompliant (#390) -
Parser: Experimental VCS URL parsing added (#376, #381, #384, #386):
VCS Parsers return {func}
dataclasses.dataclassinstances. The new tools support validation, parsing, mutating and exporting into URLs consumable by the VCS.::: {warning}
APIs are unstable and subject to break until we get it right.
:::
-
{mod}
libvcs.url.git-
{class}
~libvcs.url.git.GitBaseURL- Parse git URLs,git(1)compatible- {meth}
~libvcs.url.git.GitBaseURL.is_valid - {meth}
~libvcs.url.git.GitBaseURL.to_url- exportgit clone-compatible URL
- {meth}
-
{class}
~libvcs.url.git.GitPipURL- Pip URLs, {meth}~libvcs.url.git.GitPipURL.is_valid, {meth}~libvcs.url.git.GitPipURL.to_url -
{class}
~libvcs.url.git.GitURL- Compatibility focused, {meth}~libvcs.url.git.GitURL.is_valid{meth}~libvcs.url.git.GitURL.to_url
-
-
{mod}
libvcs.url.hg- {class}
~libvcs.url.hg.HgURL- Parse Mercurial URLs- {meth}
~libvcs.url.hg.HgURL.is_valid - {meth}
~libvcs.url.hg.HgURL.to_url- exporthg clone-compatible URL
- {meth}
- {class}
-
{mod}
libvcs.url.svn- {class}
~libvcs.url.svn.SvnURL- Parse Subversion URLs- {meth}
~libvcs.url.svn.SvnURL.is_valid - {meth}
~libvcs.url.svn.SvnURL.to_url- exportsvn checkout-compatible URL
- {meth}
- {class}
Detection can be extended through writing {class}
~libvcs.url.base.Matchers and adding them to the classes' {class}~libvcs.url.base.MatcherRegistryYou can write your own VCS parser by implementing {class}
~libvcs.url.base.URLProtocol, but it would be most efficient if you studied the source of thegit(1)parser to see how it's done. -
-
#391 Removed
flatkeyword argument for {class}libvcs.sync.git.GitSync. This was unused and the equivalent can be retrieved via.to_dict()onGitRemote -
#379 Support for
git+gitURLs removed. Pip removed these in 21.0 due to them being insecure 1 -
#372 Typings moved from
libvcs.types-> {mod}libvcs._internal.types -
#377 Remove deprecated functions and exceptions
- Removed
libvcs.shortcuts- Removed
libvcs.shortcuts.create_project_from_pip_url(): This will be replaced in future versions by #376 / parsing utilities - Moved
libvcs.shortcuts.create_project()to {func}libvcs._internal.shortcuts.create_project
- Removed
- Removed {exc}
libvcs.exc.InvalidPipURL
- Removed
-
Minor spelling fix in Git's
convert_pip_url()exception -
Fix mercurial cloning in {class}
libvcs.sync.hg.HgSyncBackport from 0.13.1
-
Rename
VcsLiteral->VCSLiteralBackport from 0.13.4
-
{func}
~libvcs.shortcuts.create_project: Add overloads that return the typed project (e.g., {class}~libvcs.sync.git.GitSync)Backport from 0.13.3
- Move
libvcs.shortcutsto {mod}libvcs._internal.shortcuts
- Note upcoming deprecation of
create_project_from_pip_urlin v0.14 - Note
create_projectbecoming internal API in upcoming release v0.14 - Fix import in
libvcs.shortcuts(in v0.14 this module will not exist)
- Rename
VcsLiteral->VCSLiteral
create_project(): Add overloads that return the typed project (e.g., {class}~libvcs.sync.git.GitSync)
- {func}
libvcs.sync.git.GitSync.remotes: Add overload
- Fix mercurial cloning in {class}
libvcs.sync.hg.HgSync
-
#343:
libvcs.cmd.coremoved tolibvcs._internal.runto make it more clear the API is closed.This includes {func}
~libvcs._internal.run.runBefore in 0.13:
from libvcs.cmd.core import run
New module in >=0.13:
from libvcs._internal.run import run
-
#361: {class}
~libvcs._internal.run.run's params are now a pass-through to {class}subprocess.Popen.run(cmd, ...)is nowrun(args, ...)to matchPopen's convention.
-
{class}
libvcs.sync.base.BaseSync:-
Removed
parent_dir:Before:
project.parent_dirAfter:
project.parent.path. -
repo_nameswitched from attribute to property
-
-
Keyword-only arguments via PEP 3102, PEP 570
-
#366:
libvcs.cmdfor hg, git, and svn updated to use -
#364: Project classes no longer accept positional arguments.
Deprecated in >=0.13:
GitSync('https://github.com/vcs-python/libvcs.git')
New style in >=0.13:
GitSync(url='https://github.com/vcs-python/libvcs.git')
-
-
Commands: Experimental command wrappers added (#346):
-
{class}
libvcs.cmd.git.Git- {meth}
libvcs.cmd.git.Git.help - {meth}
libvcs.cmd.git.Git.reset - {meth}
libvcs.cmd.git.Git.checkout - {meth}
libvcs.cmd.git.Git.status - {meth}
libvcs.cmd.git.Git.configvia #360
- {meth}
-
-
Command: Now support
-C(which accepts.gitdirs, see git's manual) in addition tocwd(subprocess-passthrough), #360
- Fix argument input for commands, for instance
git config --get color.diffwould not properly pass-through to subprocess. git: #360, svn and hg: #365
-
#362 mypy support added:
-
Basic mypy tests now pass
-
Type annotations added, including improved typings for:
- {func}
libvcs._internal.run.run - {meth}
libvcs._internal.subprocess.SubprocessCommand.Popen - {meth}
libvcs._internal.subprocess.SubprocessCommand.check_output - {meth}
libvcs._internal.subprocess.SubprocessCommand.run
- {func}
-
make mypyandmake watch_mypy -
Automatic checking on CI
-
-
#345
libvcs.utils->libvcs._internalto make it more obvious the APIs are strictly closed. -
StrOrPath->StrPath -
#336: {class}
~libvcs._internal.subprocess.SubprocessCommand: Encapsulated {mod}subprocesscall in a {func}dataclasses.dataclassfor introspecting, modifying, mocking and controlling execution. -
Dataclass helper: {class}
~libvcs._internal.dataclasses.SkipDefaultFieldsReprMixinSkip default fields in object representations.
Credit: Pietro Oldrati, 2022-05-08, StackOverflow Post
- Document
libvcs.types - #362: Improve developer documentation to note mypy and have tabbed examples for flake8.
- Update description and keywords
- Backport from 0.13.x Fix argument input for hg and svn commands, would not properly pass-through to subprocess. #365
- Backport from 0.13.x. Fix argument input for git commands, e.g.
git config --get color.diffwould not properly pass-through to subprocess. #360
- Update trove classifiers
- Add keywords and update subscription
- Add
py.typedfile tolibvcs/py.typed
-
GitRepo,SVNRepo,MercurialRepo,BaseRepohave been renamed toGitSync,SVNProject,HgSync,BaseSync(#327) -
GitSync,SVNProject,HgSync,BaseSynchave been moved tolibvcs.sync.{module}.{Module}Project -
repo_dirparam is renamed todir:Before:
GitSync(url='...', repo_path='...')After:
GitSync(url='...', path='...')#324
-
dirtopathlib,BaseSync.path->BaseSync.path -
Logging functions moved to {attr}
libvcs.sync.base.BaseSync.log(#322) -
Rename
ProjectLoggingAdaptertoCmdLoggingAdapter -
CmdLoggingAdapter: Renamerepo_nameparam tokeyword -
create_repo->create_project -
GitRemoteandGitStatus: Move to {func}dataclasses.dataclass(#329) -
extract_status(): Move toGitStatus.from_stdout(#329)
-
Commands: Experimental command wrappers added (#319):
-
{class}
libvcs.cmd.git.Git- {meth}
libvcs.cmd.git.Git.run - {meth}
libvcs.cmd.git.Git.clone - {meth}
libvcs.cmd.git.Git.init - {meth}
libvcs.cmd.git.Git.pull - {meth}
libvcs.cmd.git.Git.rebase
- {meth}
-
{class}
libvcs.cmd.svn.Svn- {meth}
libvcs.cmd.svn.Svn.run - {meth}
libvcs.cmd.svn.Svn.checkout - {meth}
libvcs.cmd.svn.Svn.update - {meth}
libvcs.cmd.svn.Svn.status - {meth}
libvcs.cmd.svn.Svn.auth - {meth}
libvcs.cmd.svn.Svn.blame - {meth}
libvcs.cmd.svn.Svn.commit
- {meth}
-
{class}
libvcs.cmd.hg.Hg- {meth}
libvcs.cmd.hg.Hg.run - {meth}
libvcs.cmd.hg.Hg.clone
- {meth}
-
-
{class}
libvcs.sync.git.GitSyncnow accepts remotes in__init__repo = GitSync( url="https://github.com/vcs-python/libvcs", repo_path=checkout, remotes={ 'gitlab': 'https://gitlab.com/vcs-python/libvcs', } )
repo = GitSync( url="https://github.com/vcs-python/libvcs", repo_path=checkout, remotes={ 'gitlab': { 'fetch_url': 'https://gitlab.com/vcs-python/libvcs', 'push_url': 'https://gitlab.com/vcs-python/libvcs', }, } )
-
{meth}
libvcs.sync.git.GitSync.update_reponow acceptsset_remotes=True
-
Python 3.7 and 3.8 dropped (#308)
Maintenance and bug support exists in
v0.11.x
-
Add codeql analysis (#303)
-
git test suite: Lots of parametrization (#309)
-
CI: Use poetry caching from @actions/setup v3.1, (#316)
-
New constants for
str-> class mappings- {data}
libvcs.sync.constants.DEFAULT_VCS_CLASS_MAP - {data}
libvcs.sync.constants.DEFAULT_VCS_CLASS_UNION - {data}
libvcs.sync.constants.DEFAULT_VCS_LITERAL
- {data}
-
Remove tox and tox-poetry-installer. It turns out installing poetry inside a poetry project doesn't work well. (
poetry update,poetry publish, etc. commands would fail) -
Add doctest w/ pytest + doctest, (#321).
-
Publish to PyPI via CI when git tags are set.
- API: Split documentation of modules to separate pages
- Fix sphinx-issues (#321)
- Experiment with sphinx-autoapi (#328) for table of contents support
-
By setting a mercurial URL with an alias it is possible to execute arbitrary shell commands via
.obtain()or in the case of uncloned destinations,.update_repo(). (#306, credit: Alessio Della Libera)See also: cve.mitre.org, nvd.nist.gov, snyk.
- Run pyupgrade formatting (#305)
- Tests:
- Move from pytest
tmp_dir(py.path.local) totmp_path(pathlib.Path) - Text fixture updates: Use home directory via
tmp_path_factory, generate config for git and hg.
- Move from pytest
- Move to furo theme
- Root:
make start_docs,make design_docs - docs/:
make start,make design
- Add python 3.10 (#300)
- Drop python 3.6 (#300)
- Poetry: 1.1.7 -> 1.1.12 (#300)
- Add
.pre-commit-config.yaml
- #295: Checkout remote branch before git rebase. Thank you @jensens!
- #293: Fix revision handling with pip-urls. Thank you @jensens!
- #279: Update poetry to 1.1
- CI: Use poetry 1.1.7 and
install-poetry.pyinstaller - Relock poetry.lock at 1.1 (w/ 1.1.7's fix)
- CI: Use poetry 1.1.7 and
- #311: Convert to markdown
Generally speaking, refactor / magic is in the process of being stripped out in the next few releases. The API is subject to change significantly in pre-1.0 builds.
#271:
- Big version bump (0.5 -> 0.9)
- Remove Python 2.7 support
- Add annotations
- Change
libvcs.git.GitRepo.status()to returnGitStatusnamed tuple - Breaking change: Repo objects now require
repo_dirto be passed - Update black to 21.6b0
-
[refactor] #267 overhaul docs
-
Move sphinx api format to Numpy-style
-
Move from reStructuredText to Markdown (via recommonmark). The master plan is to eliminate docutils and sphinx as a bottleneck completely in favor of something else (e.g., gatsby with a source that inspects our modules and can source intersphinx)
-
Move from RTD to GitHub Action, full support of poetry extras packages, deploys straight to S3 and CloudFront
-
-
#270 Build and publish packages via poetry
-
#270 Overhaul development docs
- #268
libvcs.base.BaseRepo:- no longer sets
**kwargsto dictionary on the object - remove
__slot__and renamenameattribute torepo_name
- no longer sets
- [bug]
libvcs.git.extract_status()Fix issue capturing branch names with special characters
- [bug]
libvcs.git.GitRepo.get_current_remote_name()Handle case where upstream is unpushed - [feature]
libvcs.git.GitRepo.status()- Retrieve status of repo - [feature]
libvcs.git.extract_status()- Return structured info fromgit status
- Remove log statement
Breaking changes
Internal functionality relating to remotes have been reorganized to avoid implicit behavior.
-
~libvcs.git.GitRepomethods have been renamed, they will be deprecated in 0.5:GitRepo.remotes_getrenamed tolibvcs.git.GitRepo.remotes()GitRepo.remote_getrenamed tolibvcs.git.GitRepo.remote()GitRepo.remote_setrenamed tolibvcs.git.GitRepo.set_remote()
-
~libvcs.git.GitRepotheremotesargument is deprecated and no longer used. Uselibvcs.git.GitRepo.set_remoteafter repo is instantiated. -
libvcs.git.GitRepo.obtainno longer set remotes based on adictpassed to~libvcs.git.GitRepo. This was deemed to specialized / implicit. -
libvcs.git.GitRepo.set_remote()(formerlyremote_set)The new method accepts
nameandurl(in that order).nameno longer has a default value (wasorigin). -
libvcs.git.GitRepo.remote()(formerlyremote_get):-
remoteargument renamed toname. It will be removed in 0.5.0The default value of
'origin'has been removed -
Now returns
~libvcs.git.GitRemote(a :pycollections.namedtupleobject)The tuple is similar to the old output, except there is an additional value at the beginning, the name of the remote, e.g.
('origin', '<fetch_url>', '<push_url>')
-
-
libvcs.git.GitRepo.remotes()(formerlyremotes_get) are now methods instead of properties.Passing
flat=Trueto return adictoftupleinstead ofdict -
New method:
libvcs.git.GitRepo.get_git_version() -
New method:
libvcs.git.GitRepo.get_current_remote_name()
- Remove f-string from test
libvcs.git.GitRepo.obtainOverwrite remote if exists
258libvcs.git.GitRepo.remote_set- Fix updating of remote URLs
- Add new param:
overwrite, usage:repo.remote_set(url, 'origin', overwrite=True)
- Fix version in pyroject.toml
- Update developer docs
- Fix issue with subprocess.Popen loud warning on Python 3.8
- [#296] - Move from Pipfile to poetry
- Sort imports
- Add isort package, isort configuration in setup.cfg, and
make isorttask to Makefile. - Add
project_urlsto setup.py
[#296] #296
- Move vcspull to the vcs-python organization
- Fix issue where VCS objects failed to set attribute in Ubuntu 18.04.
- Update documentation to point to libvcs.git-pull.com
- Switch doc theme to alabaster
- Pin and update libraries via pyup
- update vulture 0.8.1 to 0.11
- update flake8 from 2.5.4 to 3.2.1
- update pytest-mock from 1.4.0 to 1.5.0
- update pytest from 3.0.4 to 3.0.5
- pin alabaster to 0.7.9
- pin sphinx to 1.5.1
- Fix bug with unused
supportmodule in vcspull. See vcspull#43
- Update pytest to 3.0.2, remove unused pytest-raisesregexp dependency.
- Fix bug in
whichwhen executable is not found. Allow specifying search paths manually. - Better support for missing VCS when testing on git and subversion.
- #9 Support for
progress_callbackto use realtime output from commands in progress (such asgit fetch). - #9 More tests, internal factoring and documentation, thanks @jcfr
- #9 Official support for pypy, pypy3
- #11 : Fix unbound local when updating git repos
7Addcheck_returncodeproperty to run, thanks @jcfr8Remove all cases ofrun_buffered/ buffering from the library.
-
5Remove colorama dependency -
6Remove log module. Logging defaults.The library user can still use formatters and set log levels, for an example, see the vcspull logging setup.
An example:
import logging # your app log.setLevel(level) log.addHandler(logging.StreamHandler()) # vcslib logging options vcslogger = logging.getLogger('libvcs') vcslogger.propagate = False # don't pass libvcs settings up scope vcslogger.addHandler(logging.StreamHandler()) vcslogger.setLevel(level)You can also use
logging.Formattervariablesrepo_nameandbin_namewith repos:repo_channel = logging.StreamHandler() repo_formatter = logging.Formatter( '[%(repo_name)s] (%(bin_name)s) %(levelname)1.1s: %(message)s' ) repo_channel.setFormatter(repo_formatter) vcslogger = logging.getLogger('libvcs') vcslogger.propagate = False # don't pass libvcs settings up scope vcslogger.addHandler(repo_channel) vcslogger.setLevel(level)
- Fix issue where repo context wouldn't pass to repo logging adapter
- Fix print_stdout_on_progress_end signature in git update
create_repofunction for regular vcs urls- API docs updated
- change signature on
create_repo_from_pip_urlto acceptpip_urlinstead ofurl. Baseto acceptrepo_dirinstead ofnameandparent_dir.
- remove unneeded pyyaml, kaptan and click dependencies
- libvcs split from vcspull
Footnotes
-
pip removes
git+git@https://github.com/pypa/pip/pull/7543 ↩ -
uses_netlocadded'git'and'git+ssh'in {mod}urllib.parse