From ebbd61603645a85879e4cb0d2accf766a64e1980 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 00:41:23 +0000 Subject: [PATCH 1/7] Bump behave from 1.2.6 to 1.3.0 Bumps [behave](https://github.com/behave/behave) from 1.2.6 to 1.3.0. - [Release notes](https://github.com/behave/behave/releases) - [Changelog](https://github.com/behave/behave/blob/main/CHANGES.rst) - [Commits](https://github.com/behave/behave/compare/v1.2.6...v1.3.0) --- updated-dependencies: - dependency-name: behave dependency-version: 1.3.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f5dc784e..e232c631 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -99,7 +99,7 @@ docs = [ 'sphinxcontrib-details-directive==0.1.0', 'sphinx-sitemap==2.7.2', ] -test = ['pytest==8.4.1', 'pytest-cov==6.2.1', 'behave==1.2.6'] +test = ['pytest==8.4.1', 'pytest-cov==6.2.1', 'behave==1.3.0'] casts = ['asciinema==2.4.0'] From b138780a54b699cc99eece76fce1f2b029b601f1 Mon Sep 17 00:00:00 2001 From: Ben Spoor <37540691+ben-edna@users.noreply.github.com> Date: Mon, 11 Aug 2025 13:05:07 +0000 Subject: [PATCH 2/7] Use colon in step implementation --- features/steps/generic_steps.py | 2 +- features/steps/git_steps.py | 2 +- features/steps/manifest_steps.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/features/steps/generic_steps.py b/features/steps/generic_steps.py index 261f9eb6..93c7c98a 100644 --- a/features/steps/generic_steps.py +++ b/features/steps/generic_steps.py @@ -268,7 +268,7 @@ def step_impl(context): assert os.listdir(project["path"]), f"{project} is just an empty directory!" -@then("'{path}' looks like") +@then("'{path}' looks like:") def step_impl(context, path): expected_dir = context.text.strip() actual_dir = list_dir(path).strip() diff --git a/features/steps/git_steps.py b/features/steps/git_steps.py index 3500dfdd..91979676 100644 --- a/features/steps/git_steps.py +++ b/features/steps/git_steps.py @@ -62,7 +62,7 @@ def step_impl(context, tagname, name): tag(tagname) -@given('a git-repository "{name}" with the manifest') +@given('a git-repository "{name}" with the manifest:') @given('a git repository "{name}"') def step_impl(context, name): remote_path = os.path.join(context.remotes_dir, name) diff --git a/features/steps/manifest_steps.py b/features/steps/manifest_steps.py index c9089670..2dcb488a 100644 --- a/features/steps/manifest_steps.py +++ b/features/steps/manifest_steps.py @@ -40,7 +40,7 @@ def step_impl(context, name): check_file(name, context.text) -@given("the manifest '{name}' with the projects") +@given("the manifest '{name}' with the projects:") def step_impl(context, name): projects = "\n".join(f" - name: {row['name']}" for row in context.table) manifest = f"""manifest: From e259400fe5096b9405980983e994a949d1c25f67 Mon Sep 17 00:00:00 2001 From: Ben Spoor <37540691+ben-edna@users.noreply.github.com> Date: Mon, 11 Aug 2025 14:05:08 +0000 Subject: [PATCH 3/7] Use immutable capture object context.log_capture was replaced with immutable context.captured. Don't clear, but remember position and only store new output in context.cmd_output. --- features/steps/generic_steps.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/features/steps/generic_steps.py b/features/steps/generic_steps.py index 93c7c98a..094c0808 100644 --- a/features/steps/generic_steps.py +++ b/features/steps/generic_steps.py @@ -12,6 +12,7 @@ from typing import Iterable, List, Optional, Pattern, Tuple from behave import given, then, when # pylint: disable=no-name-in-module +from behave.runner import Context from dfetch.__main__ import DfetchFatalException, run from dfetch.util.util import in_directory @@ -29,8 +30,8 @@ def remote_server_path(context): return "/".join(context.remotes_dir_path.split(os.sep)) -def call_command(context, args: list[str], path: Optional[str] = ".") -> None: - context.log_capture.buffer = [] +def call_command(context: Context, args: list[str], path: Optional[str] = ".") -> None: + length_at_start = len(context.captured.output) with in_directory(path or "."): try: run(args) @@ -39,7 +40,7 @@ def call_command(context, args: list[str], path: Optional[str] = ".") -> None: context.cmd_returncode = 1 # Remove the color code + title context.cmd_output = dfetch_title.sub( - "", ansi_escape.sub("", context.log_capture.getvalue()) + "", ansi_escape.sub("", context.captured.output[length_at_start:].strip("\n")) ) From 7e4731a438bcf5389a922c0d38964d148a9881b1 Mon Sep 17 00:00:00 2001 From: Ben Spoor <37540691+ben-edna@users.noreply.github.com> Date: Mon, 11 Aug 2025 14:09:26 +0000 Subject: [PATCH 4/7] Add new pyright suppressions --- features/steps/generic_steps.py | 2 +- features/steps/git_steps.py | 2 +- features/steps/manifest_steps.py | 2 +- features/steps/svn_steps.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/features/steps/generic_steps.py b/features/steps/generic_steps.py index 094c0808..0e9ec3e1 100644 --- a/features/steps/generic_steps.py +++ b/features/steps/generic_steps.py @@ -1,6 +1,6 @@ """Steps for features tests.""" -# pyright: reportRedeclaration=false, reportAttributeAccessIssue=false +# pyright: reportRedeclaration=false, reportAttributeAccessIssue=false, reportCallIssue=false # pylint: disable=function-redefined, missing-function-docstring import difflib diff --git a/features/steps/git_steps.py b/features/steps/git_steps.py index 91979676..9d6355ef 100644 --- a/features/steps/git_steps.py +++ b/features/steps/git_steps.py @@ -1,7 +1,7 @@ """Steps for features tests.""" # pylint: disable=function-redefined, missing-function-docstring, import-error -# pyright: reportRedeclaration=false, reportAttributeAccessIssue=false +# pyright: reportRedeclaration=false, reportAttributeAccessIssue=false, reportCallIssue=false import os import pathlib diff --git a/features/steps/manifest_steps.py b/features/steps/manifest_steps.py index 2dcb488a..e5720d3b 100644 --- a/features/steps/manifest_steps.py +++ b/features/steps/manifest_steps.py @@ -1,7 +1,7 @@ """Steps for features tests.""" # pylint: disable=function-redefined, missing-function-docstring, import-error -# pyright: reportRedeclaration=false, reportAttributeAccessIssue=false +# pyright: reportRedeclaration=false, reportAttributeAccessIssue=false, reportCallIssue=false import os import pathlib diff --git a/features/steps/svn_steps.py b/features/steps/svn_steps.py index 54411a87..772407cb 100644 --- a/features/steps/svn_steps.py +++ b/features/steps/svn_steps.py @@ -1,7 +1,7 @@ """Steps for features tests.""" # pylint: disable=function-redefined, missing-function-docstring, import-error -# pyright: reportRedeclaration=false, reportAttributeAccessIssue=false +# pyright: reportRedeclaration=false, reportAttributeAccessIssue=false, reportCallIssue=false import os import pathlib From 90035d45e73ce7b0b0ec1a8ae4b3643da4ddc15b Mon Sep 17 00:00:00 2001 From: Ben Spoor <37540691+ben-edna@users.noreply.github.com> Date: Mon, 11 Aug 2025 14:10:19 +0000 Subject: [PATCH 5/7] Rephrase to help autocomplete problems --- features/keep-license-in-project.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/keep-license-in-project.feature b/features/keep-license-in-project.feature index f99ed884..ec4433ec 100644 --- a/features/keep-license-in-project.feature +++ b/features/keep-license-in-project.feature @@ -1,8 +1,8 @@ Feature: Keep license in project - A lot of people in the world do a lot of hard work to create software + Lots of people in the world do a lot of hard work to create software to use freely. They only ask to keep the license with their code. - When fetching only a part of a repository with the 'src:' tag, the risk + If fetching only a part of a repository with the 'src:' tag, the risk is you forget the license file. Scenario: License is preserved in git repo sparse checkout and cannot be ignored From 6f9d8169491d45cc91f2147d6081f3f56f51f50c Mon Sep 17 00:00:00 2001 From: Ben Spoor <37540691+ben-edna@users.noreply.github.com> Date: Mon, 11 Aug 2025 14:12:17 +0000 Subject: [PATCH 6/7] Fix end of line --- .github/workflows/run.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml index 04127b2b..5ca0cf36 100644 --- a/.github/workflows/run.yml +++ b/.github/workflows/run.yml @@ -90,4 +90,3 @@ jobs: uses: ./ with: working-directory: '.' - From e50a9568712aaa501f6629a0a35a1162ef440a34 Mon Sep 17 00:00:00 2001 From: Ben Spoor <37540691+ben-edna@users.noreply.github.com> Date: Mon, 11 Aug 2025 14:12:42 +0000 Subject: [PATCH 7/7] Add new pylint suppression --- features/steps/generic_steps.py | 2 +- features/steps/git_steps.py | 2 +- features/steps/manifest_steps.py | 2 +- features/steps/svn_steps.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/features/steps/generic_steps.py b/features/steps/generic_steps.py index 0e9ec3e1..c4256cce 100644 --- a/features/steps/generic_steps.py +++ b/features/steps/generic_steps.py @@ -1,7 +1,7 @@ """Steps for features tests.""" +# pylint: disable=function-redefined, missing-function-docstring, not-callable # pyright: reportRedeclaration=false, reportAttributeAccessIssue=false, reportCallIssue=false -# pylint: disable=function-redefined, missing-function-docstring import difflib import json diff --git a/features/steps/git_steps.py b/features/steps/git_steps.py index 9d6355ef..bb6336e5 100644 --- a/features/steps/git_steps.py +++ b/features/steps/git_steps.py @@ -1,6 +1,6 @@ """Steps for features tests.""" -# pylint: disable=function-redefined, missing-function-docstring, import-error +# pylint: disable=function-redefined, missing-function-docstring, import-error, not-callable # pyright: reportRedeclaration=false, reportAttributeAccessIssue=false, reportCallIssue=false import os diff --git a/features/steps/manifest_steps.py b/features/steps/manifest_steps.py index e5720d3b..13641e22 100644 --- a/features/steps/manifest_steps.py +++ b/features/steps/manifest_steps.py @@ -1,6 +1,6 @@ """Steps for features tests.""" -# pylint: disable=function-redefined, missing-function-docstring, import-error +# pylint: disable=function-redefined, missing-function-docstring, import-error, not-callable # pyright: reportRedeclaration=false, reportAttributeAccessIssue=false, reportCallIssue=false import os diff --git a/features/steps/svn_steps.py b/features/steps/svn_steps.py index 772407cb..c2c5bb7a 100644 --- a/features/steps/svn_steps.py +++ b/features/steps/svn_steps.py @@ -1,6 +1,6 @@ """Steps for features tests.""" -# pylint: disable=function-redefined, missing-function-docstring, import-error +# pylint: disable=function-redefined, missing-function-docstring, import-error, not-callable # pyright: reportRedeclaration=false, reportAttributeAccessIssue=false, reportCallIssue=false import os