diff --git a/dvc/fs/local.py b/dvc/fs/local.py index 159531800..e64ca48cb 100644 --- a/dvc/fs/local.py +++ b/dvc/fs/local.py @@ -26,8 +26,7 @@ class LocalFileSystem(FileSystem): super().__init__(**config) self.fs = LocalFS() - @staticmethod - def open(path, mode="r", encoding=None, **kwargs): + def open(self, path, mode="r", encoding=None, **kwargs): return open(path, mode=mode, encoding=encoding) def exists(self, path) -> bool: @@ -107,8 +106,7 @@ class LocalFileSystem(FileSystem): self.remove(tmp_info) raise - @staticmethod - def symlink(from_info, to_info): + def symlink(self, from_info, to_info): System.symlink(from_info, to_info) @staticmethod diff --git a/dvc/repo/update.py b/dvc/repo/update.py index 42c9d7d96..d4ec8a9ff 100644 --- a/dvc/repo/update.py +++ b/dvc/repo/update.py @@ -34,6 +34,5 @@ def update( stage.update(rev, to_remote=to_remote, remote=remote, jobs=jobs) dvcfile = Dvcfile(self, stage.path) dvcfile.dump(stage) - stages.add(stage) return list(stages) diff --git a/dvc/utils/table.py b/dvc/utils/table.py index 55bf93b1c..31213bd5a 100644 --- a/dvc/utils/table.py +++ b/dvc/utils/table.py @@ -51,7 +51,11 @@ class Table(RichTable): return widths def _collapse_widths( # type: ignore[override] - self, widths: List[int], wrapable: List[bool], max_width: int + # pylint: disable=arguments-differ + self, + widths: List[int], + wrapable: List[bool], + max_width: int, ) -> List[int]: """Collapse columns right-to-left if possible to fit table into max_width. diff --git a/pyproject.toml b/pyproject.toml index 284868d51..63c463cce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,6 +65,7 @@ disable = [ "logging-format-interpolation", "logging-fstring-interpolation", "missing-function-docstring", "missing-module-docstring", "missing-class-docstring", "raise-missing-from", "import-outside-toplevel", + "cannot-enumerate-pytest-fixtures", ] enable = ["c-extension-no-member", "no-else-return"] diff --git a/setup.cfg b/setup.cfg index d3db330b4..ccda6d94a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -136,7 +136,7 @@ tests = pytest-timeout==2.1.0 filelock==3.6.0 # pylint requirements - pylint==2.12.2 + pylint==2.13.5 # we use this to suppress pytest-related false positives in our tests. pylint-pytest==1.1.2 # we use this to suppress some messages in tests, eg: foo/bar naming, diff --git a/tests/unit/test_logger.py b/tests/unit/test_logger.py index dc766471b..364b69b59 100644 --- a/tests/unit/test_logger.py +++ b/tests/unit/test_logger.py @@ -95,6 +95,8 @@ class TestColorFormatter: assert expected == formatter.format(caplog.records[0]) + # pylint: disable=used-before-assignment + def test_exception_under_verbose(self, caplog, dt): with caplog.at_level(logging.DEBUG, logger="dvc"): try: @@ -191,6 +193,8 @@ class TestColorFormatter: assert "Exception: first" in stack_trace assert "dvc.exceptions.DvcException: second" in stack_trace + # pylint: enable=used-before-assignment + def test_progress_awareness(self, mocker, capsys, caplog): from dvc.progress import Tqdm