From dd543d75738c46e8de5aab99df68810e758c2401 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 12 Oct 2024 12:03:30 -0500 Subject: [PATCH 1/4] py(deps) libvcs 0.30.1 -> 0.33.0 (pytest plugin performance improved) See also: - https://github.com/vcs-python/libvcs/blob/v0.33.0/CHANGES#libvcs-0330-2024-10-13 - https://libvcs.git-pull.com/history.html#libvcs-0-33-0-2024-10-13 --- poetry.lock | 8 ++++---- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/poetry.lock b/poetry.lock index 6ca22a93..fe44296a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -456,13 +456,13 @@ i18n = ["Babel (>=2.7)"] [[package]] name = "libvcs" -version = "0.30.1" +version = "0.33.0" description = "Lite, typed, python utilities for Git, SVN, Mercurial, etc." optional = false python-versions = "<4.0,>=3.9" files = [ - {file = "libvcs-0.30.1-py3-none-any.whl", hash = "sha256:ffc5f1f837db2e095d520dd5d264128739c84c04d8fd4b06f853e690d0d1c53a"}, - {file = "libvcs-0.30.1.tar.gz", hash = "sha256:1197167222cf1e9f17c34a756f907e5053469e7aacb4bbbd0ffa2c3e617a5c4b"}, + {file = "libvcs-0.33.0-py3-none-any.whl", hash = "sha256:053385430afe69755598d971b670a227b6034a37e607a00b1a5ae4ec206a7f04"}, + {file = "libvcs-0.33.0.tar.gz", hash = "sha256:c7f2dfdcecb136efda9c76920a176526b6ad634144f0d27d16d3ec6d9956919a"}, ] [package.dependencies] @@ -1598,4 +1598,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "742881a9c50fa352a5ad74073456f5a543507fc87c49e53da43b91650c54b637" +content-hash = "60745b22e8b3d00e5da4ef5f365464c1420277237b7a9cd37d57edd879cf7793" diff --git a/pyproject.toml b/pyproject.toml index 151e98d7..82423d41 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,7 +62,7 @@ vcspull = 'vcspull:cli.cli' [tool.poetry.dependencies] python = "^3.9" -libvcs = "~0.30.1" +libvcs = "~0.33.0" colorama = ">=0.3.9" PyYAML = "^6.0" From da18ac1cb81ed7e4cd70a85aad95bba9daf99057 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 12 Oct 2024 12:01:53 -0500 Subject: [PATCH 2/4] tests(sync[git]) Update for libtmux v0.31.0 cached fixtures --- tests/test_sync.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/test_sync.py b/tests/test_sync.py index 36f2eb6e..8777b912 100644 --- a/tests/test_sync.py +++ b/tests/test_sync.py @@ -146,8 +146,7 @@ def test_config_variations( remote_list: list[str], ) -> None: """Test vcspull sync'ing across a variety of configurations.""" - dummy_repo_name = "dummy_repo" - dummy_repo = create_git_remote_repo(remote_repo_name=dummy_repo_name) + dummy_repo = create_git_remote_repo() config_file = write_config_remote( config_path=tmp_path / "myrepos.yaml", @@ -252,11 +251,10 @@ def test_updating_remote( has_extra_remotes: bool, ) -> None: """Verify yaml configuration state is applied and reflected to local VCS clone.""" - dummy_repo_name = "dummy_repo" - dummy_repo = create_git_remote_repo(remote_repo_name=dummy_repo_name) + dummy_repo = create_git_remote_repo() mirror_name = "mirror_repo" - mirror_repo = create_git_remote_repo(remote_repo_name=mirror_name) + mirror_repo = create_git_remote_repo() repo_parent = tmp_path / "study" / "myrepo" repo_parent.mkdir(parents=True) From 2dd0694760c3e72f8bf492852fb2eeca0ca6585e Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 12 Oct 2024 17:33:23 -0500 Subject: [PATCH 3/4] tests: Ruff fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed 5 errors: - conftest.py: 2 × PT001 (pytest-fixture-incorrect-parentheses-style) - tests/test_config.py: 1 × PT001 (pytest-fixture-incorrect-parentheses-style) - tests/test_config_file.py: 2 × PT001 (pytest-fixture-incorrect-parentheses-style) --- conftest.py | 4 ++-- tests/test_config.py | 2 +- tests/test_config_file.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/conftest.py b/conftest.py index ef3e6685..ffd28691 100644 --- a/conftest.py +++ b/conftest.py @@ -56,7 +56,7 @@ def xdg_config_path( return p -@pytest.fixture() +@pytest.fixture def config_path( xdg_config_path: pathlib.Path, request: pytest.FixtureRequest, @@ -81,7 +81,7 @@ def set_xdg_config_path( monkeypatch.setenv("XDG_CONFIG_HOME", str(xdg_config_path)) -@pytest.fixture() +@pytest.fixture def repos_path(user_path: pathlib.Path, request: pytest.FixtureRequest) -> pathlib.Path: """Return temporary directory for repository checkout guaranteed unique.""" path = user_path / "repos" diff --git a/tests/test_config.py b/tests/test_config.py index 03536c8e..0ed1b9fb 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -24,7 +24,7 @@ def __call__( ... -@pytest.fixture() +@pytest.fixture def load_yaml(tmp_path: pathlib.Path) -> LoadYAMLFn: """Return a yaml loading function that uses temporary directory path.""" diff --git a/tests/test_config_file.py b/tests/test_config_file.py index a50806d7..b273f6df 100644 --- a/tests/test_config_file.py +++ b/tests/test_config_file.py @@ -15,7 +15,7 @@ from .helpers import EnvironmentVarGuard, load_raw, write_config -@pytest.fixture() +@pytest.fixture def yaml_config(config_path: pathlib.Path) -> pathlib.Path: """Ensure and return vcspull yaml configuration file path.""" yaml_file = config_path / "repos1.yaml" @@ -23,7 +23,7 @@ def yaml_config(config_path: pathlib.Path) -> pathlib.Path: return yaml_file -@pytest.fixture() +@pytest.fixture def json_config(config_path: pathlib.Path) -> pathlib.Path: """Ensure and return vcspull json configuration file path.""" json_file = config_path / "repos2.json" From f2bead6011a71391785cc87971e1c83624d4d809 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sun, 13 Oct 2024 07:29:02 -0500 Subject: [PATCH 4/4] docs(CHANGES) Note libvcs package update, performance improvements --- CHANGES | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGES b/CHANGES index be217aa0..d33c47a0 100644 --- a/CHANGES +++ b/CHANGES @@ -27,6 +27,17 @@ $ pipx install --suffix=@next 'vcspull' --pip-args '\--pre' --force Added Python 3.13 to package trove classifiers and CI tests. +#### libvcs 0.30.1 -> 0.33.0 (#453) + +Faster, cached pytest fixtures. Upstream tests are 50% faster. + +- https://github.com/vcs-python/libvcs/blob/v0.32.1/CHANGES#libvcs-0310-2024-10-12 +- https://libvcs.git-pull.com/history.html#libvcs-0-32-1-2024-10-12 + +#### Faster tests fixtures (#453) + +libvcs's included test fixtures beyond v0.31.0+ are 33%+ faster. + ## vcspull v1.31.0 (2024-06-18) ### Breaking changes