Changelog#

To install the unreleased libvcs version, see developmental releases.

pip:

$ pip install --user --upgrade --pre libvcs

libvcs 0.27.x (unreleased)#

  • Notes on upcoming releases will be added here

libvcs 0.26.0 (2023-11-26)#

Breaking changes#

  • Rename pytest plugin protocol typings (#450):

    • CreateProjectCallbackProtocol -> CreateRepoPostInitFn

    • CreateProjectCallbackFixtureProtocol -> CreateRepoPytestFixtureFn

Bug fixes#

  • Remove unused command: Svn.mergelist (#450)

  • Fix Git.config docstring (#450)

Development#

  • 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

Documentation#

  • Add docstrings to functions, methods, classes, and packages (#449)

libvcs 0.25.1 (2023-11-23)#

Packaging#

  • Move gp-libs to test dependencies

libvcs 0.25.0 (2023-11-19)#

Maintenance only, no bug fixes, or new features

Packaging#

  • Poetry: 1.6.1 -> 1.7.0

    See also: https://github.com/python-poetry/poetry/blob/1.7.0/CHANGELOG.md

  • Move formatting from black to ruff format (#448)

    This retains the same formatting style of black while eliminating a dev dependency by using our existing rust-based ruff linter.

  • 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.

Development#

libvcs 0.24.0 (2023-10-22)#

Bug fixes#

  • Git Remote URLs: Fix bug that would cause git remotes with @ to be chopped off after the protocol (#446, fixes #431)

Packaging#

  • Move pytest configuration to pyproject.toml (#441)

Development#

  • ruff: Remove ERA / eradicate plugin

    This rule had too many false positives to trust. Other ruff rules have been beneficial.

  • query_list: Refactor to use access typing via namespace as t (#439)

libvcs 0.23.0 (2023-08-20)#

Maintenance only, no bug fixes, or new features

Development#

  • Code quality improvements (#438)

    Additional ruff settings have been enabled. The most recent contribution includes 100+ automated fixes and 50+ hand-made fixes.

Post-release: v0.23.0post0 (2023-08-20)#

  • 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.

libvcs 0.22.2 (2023-08-20)#

Maintenance only, no bug fixes, or new features

Development#

  • SubprocessCommand: Typing fix for text param. Found via mypy(1).

libvcs 0.22.1 (2023-05-28)#

Maintenance only, no bug fixes, or new features

Development#

  • Add back black for formatting

    This is still necessary to accompany ruff, until it replaces black.

libvcs 0.22.0 (2023-05-27)#

Maintenance only, no bug fixes, or new features

Internal improvements#

  • 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

libvcs 0.21.2 (2023-04-07)#

Development#

  • Update mypy to 1.2.0

Fixes#

  • SkipDefaultFieldsReprMixin: Fix typing for mypy 1.2.0

libvcs 0.21.1 (2023-03-15)#

Fixes#

  • Remove more typing_extensions from runtime (#437 didn’t get them all)

libvcs 0.21.0 (2023-03-15)#

New#

  • 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

Bug fixes#

  • Remove required dependency of typing-extensions (#437)

  • Ignore a single line of mypy check in dataclasses for now (#437)

libvcs 0.20.0 (2022-10-31)#

What’s new#

Python 3.11 support (#433)#

Official support for python 3.11

URLs: Mapping now class attributes (#433)#

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

libvcs 0.19.1 (2022-10-23)#

Tests#

  • Sync, git: Update pytest fixtures, via #432

Documentation#

  • CLI, git: Split subcommands into separate pages (remote, stash, submodule), via #432

libvcs 0.19.0 (2022-10-23)#

New features#

Commands#

via #430

Syncing#

via #430

Git, SVN, and Mercurial have moved to libvcs.cmd

libvcs 0.18.1 (2022-10-23)#

Maintenance only release, no bug fixes, or new features

  • Documentation improvements

  • Development package updates

  • Add citation file (CITATION.cff)

libvcs 0.18.0 (2022-10-09)#

New features#

URLs#

  • Added weight to matchers (#428)

    • More heavily weighted matcher will have preference over others

    • Fixes an issue where defaults would be overwritten

      The first, highest weighted will “win”, avoiding the recursion causing defau defaults for other matchers to be applied.

libvcs 0.17.0 (2022-09-25)#

New features#

  • URLs: Added registry, match find which VCS a URL matches with (#420)

  • create_project: Learn to guess VCS from URL, if none provided (#420)

Breaking changes#

URL renamings (#417):

  • Matcher -> Rule, MatcherRegistry -> Rules

  • matches -> rule_map

  • default_patterns -> patterns

  • MATCHERS -> RULES

Improvements#

pytest plugin:

  • create_{git,svn,hg}_remote_repo() now accepts init_cmd_args (list[str], default: ['--bare'], #426)

    To not use bare, pass init_cmd_args=None

Sync:

  • git: Fix update_repo when there are only untracked files (#425, credit: @jfpedroza)

URL (#423):

  • hg: Add HgBaseURL, HgPipURL

  • svn: Add SvnBaseURL, SvnPipURL

  • URLProtocol: Fix is_valid to use classmethod

  • All: Fix is_valid to use default of None to avoid implicitly filtering

  • Reduce duplicated code in methods by using super()

Packaging#

  • Migrate .coveragerc to pyproject.toml (#421)

  • Remove .tmuxp.before-script.sh (was a before_script in .tmuxp.yaml) that was unused.

  • Move conftest.py to root level

    • Can be excluded from wheel, included in sdist

    • Required to satisfy pytest’s pytest_plugins only being in top-level confte conftest.py files since 4.0 (see notice)

    • Makes it possible to run pytest README.md with doctest plugin

libvcs 0.16.5 (2022-09-21)#

Bug fixes#

  • Use pytest’s public API when importing (#418)

libvcs 0.16.4 (2022-09-18)#

Infrastructure#

  • Bump poetry to 1.1.x to 1.2.x

libvcs 0.16.3 (2022-09-18)#

Bug fixes#

  • QueryList: Fix lookups of objects (#415)

Tests#

  • Basic pytest plugin test (#413)

  • Add test for object based lookups (#414)

Documentation#

  • Improve doc examples / tests for keygetter and QueryList to show deep lookups for objects (#415)

Infrastructure#

  • 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

libvcs 0.16.2 (2022-09-11)#

Bug fix#

Remove Faker dependency (#412)

libvcs 0.16.1 (2022-09-11)#

Bug fix#

Temporarily add Faker as a dependency (due to pytest), track longterm fix on (#411)

libvcs 0.16.0 (2022-09-11)#

New features#

  • Added a pytest plugin. Create fresh, temporarily repos on your machine locally for git, mercurial, and svn (#409)

libvcs 0.15.0 (2022-09-11)#

Breaking changes#

  • Moves (#408):

    • libvcs.parse -> libvcs.url

    • libvcs.projects -> libvcs.sync

  • Renames (#408):

    • BaseProject -> BaseSync

    • MercurialProject -> HgSync

    • SubversionProject -> SvnSync

    • GitProject -> GitSync

  • Deprecate custom functions in favor of standard library:

Development#

Documentation#

libvcs 0.14.0 (2022-07-31)#

What’s new#

Breaking changes#

  • #391 Removed flat keyword argument for libvcs.sync.git.GitSync. This was unused and the equivalent can be retrieved via .to_dict() on GitRemote

  • #379 Support for git+git URLs removed. Pip removed these in 21.0 due to them being insecure [1]

  • #372 Typings moved from libvcs.types -> libvcs._internal.types

  • #377 Remove deprecated functions and exceptions

    • Removed libvcs.shortcuts

    • Removed libvcs.exc.InvalidPipURL

Fixes#

  • Minor spelling fix in Git’s convert_pip_url() exception

  • Fix mercurial cloning in libvcs.sync.hg.HgSync

    Backport from 0.13.1

Typings#

  • Rename VcsLiteral -> VCSLiteral

    Backport from 0.13.4

  • create_project(): Add overloads that return the typed project (e.g. GitSync)

    Backport from 0.13.3

Cleanup#

  • #378 #380 Remove duplicate uses_netloc scheme for git+ssh (this was in cpython since 2.7 / 3.1 [2][3])

libvcs 0.13.6 (2022-06-18)#

Development#

libvcs 0.13.5 (2022-06-18)#

Development#

  • Note upcoming deprecation of create_project_from_pip_url in v0.14

  • Note create_project becoming internal API in upcoming release v0.14

  • Fix import in libvcs.shortcuts (in v0.14 this module will not exist)

libvcs 0.13.4 (2022-06-18)#

Typing#

  • Rename VcsLiteral -> VCSLiteral

libvcs 0.13.3 (2022-06-18)#

Typings#

  • create_project(): Add overloads that return the typed project (e.g. GitSync)

libvcs 0.13.2 (2022-06-12)#

Typings#

libvcs 0.13.1 (2022-06-01)#

Fixes#

libvcs 0.13.0, “Jane” (2022-05-30)#

Breaking changes#

  • #343: libvcs.cmd.core moved to libvcs._internal.run to make it more clear the API is closed.

    This includes run()

    Before in 0.13:

    from libvcs.cmd.core import run
    

    New module in >=0.13:

    from libvcs._internal.run import run
    
  • #361: run’s params are now a pass-through to subprocess.Popen.

    • run(cmd, ...) is now run(args, ...) to match Popen’s convention.

  • libvcs.sync.base.BaseSync:

    • Removed parent_dir:

      Before: project.parent_dir

      After: project.parent.dir.

    • repo_name switched from attribute to property

  • Keyword-only arguments via PEP 3102, PEP 570

    • #366: libvcs.cmd for 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')
      

What’s new#

Bug fixes#

  • Fix argument input for commands, e.g. git config --get color.diff would not properly pass-through to subprocess. git: #360, svn and hg: #365

Internals#

Documentation#

  • Document libvcs.types

  • #362: Improve developer documentation to note mypy and have tabbed examples for flake8.

Packaging#

  • Update description and keywords

libvcs 0.12.4 (2022-05-30)#

  • Backport from 0.13.x Fix argument input for hg and svn commands, would not properly pass-through to subprocess. #365

libvcs 0.12.3 (2022-05-28)#

Bug fixes#

  • Backport from 0.13.x. Fix argument input for git commands, e.g. git config --get color.diff would not properly pass-through to subprocess. #360

libvcs 0.12.2 (2022-05-10)#

Packaging#

libvcs 0.12.1 (2022-05-10)#

Packaging#

  • Add keywords and update subscription

  • Add py.typed file to libvcs/py.typed

libvcs 0.12.0, “Nimbus” (2022-04-24)#

Breaking#

  • GitRepo, SVNRepo, MercurialRepo, BaseRepo have been renamed to GitSync, SVNProject, HgSync, BaseSync (#327)

  • GitSync, SVNProject, HgSync, BaseSync have been moved to libvcs.sync.{module}.{Module}Project

  • repo_dir param is renamed to dir:

    Before: GitSync(url='...', repo_dir='...')

    After: GitSync(url='...', dir='...')

    #324

  • dir to pathlib, BaseSync.path -> BaseSync.dir

  • Logging functions moved to libvcs.sync.base.BaseSync.log (#322)

  • Rename ProjectLoggingAdapter to CmdLoggingAdapter

  • CmdLoggingAdapter: Rename repo_name param to keyword

  • create_repo -> create_project

  • GitRemote and GitStatus: Move to dataclasses.dataclass() (#329)

  • extract_status(): Move to GitStatus.from_stdout (#329)

What’s new#

Compatibility#

  • Python 3.7 and 3.8 dropped (#308)

    Maintenance and bug support exists in v0.11.x

Development#

Documentation#

  • API: Split documentation of modules to separate pages

  • Fix sphinx-issues (#321)

  • Experiment with sphinx-autoapi (#328) for table of contents support

libvcs 0.11.1 (2022-03-12)#

CVE-2022-21187: Command Injection with mercurial repositories#

  • 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.

Development#

  • Run pyupgrade formatting (#305)

  • Tests:

    • Move from pytest tmp_dir (py.path.local) to tmp_path (pathlib.Path)

    • Text fixture updates: Use home directory via tmp_path_factory, generate config for git and hg.

Documentation#

  • Move to furo theme

  • Root: make start_docs, make design_docs

  • docs/: make start, make design

libvcs 0.11.0, “Phebe” (2022-01-08)#

Compatibility#

  • Add python 3.10 (#300)

  • Drop python 3.6 (#300)

Development#

  • Poetry: 1.1.7 -> 1.1.12 (#300)

  • Add .pre-commit-config.yaml

libvcs 0.10.1 (2021-11-30)#

  • #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.py installer

    • Relock poetry.lock at 1.1 (w/ 1.1.7’s fix)

libvcs 0.10 (2021-06-16)#

  • #311: Convert to markdown

libvcs 0.9 (2021-06-14)#

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 return GitStatus named tuple

  • Breaking change: Repo objects now require repo_dir to be passed

  • Update black to 21.6b0

libvcs 0.5 (2020-08-11)#

  • [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

libvcs 0.4.4 (2020-08-05)#

  • #268 libvcs.base.BaseRepo:

    • no longer sets **kwargs to dictionary on the object

    • remove __slot__ and rename name attribute to repo_name

libvcs 0.4.3 (2020-08-01)#

  • [bug] libvcs.git.extract_status() Fix issue capturing branch names with special characters

libvcs 0.4.2 (2020-08-01)#

  • [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 from git status

libvcs 0.4.1 (2020-08-01)#

  • Remove log statement

libvcs 0.4 (2020-08-01)#

Breaking changes

Internal functionality relating to remotes have been reorganized to avoid implicit behavior.

  • ~libvcs.git.GitRepo methods have been renamed, they will be deprecated in 0.5:

    • GitRepo.remotes_get renamed to libvcs.git.GitRepo.remotes()

    • GitRepo.remote_get renamed to libvcs.git.GitRepo.remote()

    • GitRepo.remote_set renamed to libvcs.git.GitRepo.set_remote()

  • ~libvcs.git.GitRepo the remotes argument is deprecated and no longer used. Use libvcs.git.GitRepo.set_remote after repo is instantiated.

  • libvcs.git.GitRepo.obtain no longer set remotes based on a dict passed to ~libvcs.git.GitRepo. This was deemed to specialized / implicit.

  • libvcs.git.GitRepo.set_remote() (formerly remote_set)

    The new method accepts name and url (in that order). name no longer has a default value (was origin).

  • libvcs.git.GitRepo.remote() (formerly remote_get):

    • remote argument renamed to name. It will be removed in 0.5.0

      The default value of 'origin' has been removed

    • Now returns ~libvcs.git.GitRemote (a :pycollections.namedtuple object)

      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() (formerly remotes_get) are now methods instead of properties.

    Passing flat=True to return a dict of tuple instead of dict

  • New method: libvcs.git.GitRepo.get_git_version()

  • New method: libvcs.git.GitRepo.get_current_remote_name()

libvcs 0.3.3 (2020-07-29)#

  • Remove f-string from test

  • libvcs.git.GitRepo.obtain Overwrite remote if exists

libvcs 0.3.2 (2020-07-26)#

  • 258 libvcs.git.GitRepo.remote_set

    • Fix updating of remote URLs

    • Add new param: overwrite, usage: repo.remote_set(url, 'origin', overwrite=True)

libvcs 0.3.1post1 (2020-07-26)#

  • Fix version in pyroject.toml

  • Update developer docs

libvcs 0.3.1 (2020-07-25)#

  • 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 isort task to Makefile.

  • Add project_urls to setup.py

[#296] https://github.com/vcs-python/libvcs/pull/296

libvcs 0.3.0 (2018-03-12)#

  • Move vcspull to the vcs-python organization

  • Fix issue where VCS objects failed to set attribute in Ubuntu 18.04.

libvcs 0.2.3 (2016-12-22)#

  • 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

libvcs 0.2.2 (2016-11-23)#

  • Fix bug with unused support module in vcspull. See vcspull#43

libvcs 0.2.1 (2016-09-13)#

  • Update pytest to 3.0.2, remove unused pytest-raisesregexp dependency.

  • Fix bug in which when executable is not found. Allow specifying search paths manually.

  • Better support for missing VCS when testing on git and subversion.

libvcs 0.2.0 (2016-06-24)#

  • #9 Support for progress_callback to use realtime output from commands in progress (such as git fetch).

  • #9 More tests, internal factoring and documentation, thanks @jcfr

  • #9 Official support for pypy, pypy3

  • #11 : Fix unbound local when updating git repos

libvcs 0.1.7 (2016-06-21)#

  • 7 Add check_returncode property to run, thanks @jcfr

  • 8 Remove all cases of run_buffered / buffering from the library.

libvcs 0.1.6 (2016-06-21)#

  • 5 Remove colorama dependency

  • 6 Remove 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.Formatter variables repo_name and bin_name with 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)
    

libvcs 0.1.5 (2016-06-21)#

  • Fix issue where repo context wouldn’t pass to repo logging adapter

libvcs 0.1.4 (2016-06-20)#

  • Fix print_stdout_on_progress_end signature in git update

libvcs 0.1.3 (2016-06-20)#

  • create_repo function for regular vcs urls

  • API docs updated

libvcs 0.1.2 (2016-06-20)#

  • change signature on create_repo_from_pip_url to accept pip_url instead of url.

  • Base to accept repo_dir instead of name and parent_dir.

libvcs 0.1.1 (2016-06-20)#

  • remove unneeded pyyaml, kaptan and click dependencies

libvcs 0.1.0 (2016-06-20)#