[pre-commit.ci] pre-commit autoupdate (#9756)

* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/asottile/pyupgrade: v3.9.0 → v3.10.1](https://github.com/asottile/pyupgrade/compare/v3.9.0...v3.10.1)
- [github.com/astral-sh/ruff-pre-commit: v0.0.278 → v0.0.281](https://github.com/astral-sh/ruff-pre-commit/compare/v0.0.278...v0.0.281)
- [github.com/PyCQA/flake8: 6.0.0 → 6.1.0](https://github.com/PyCQA/flake8/compare/6.0.0...6.1.0)

* fix issues reported by ruff

- also remove redundant flake8 plugins
- remove beautysh as we don't have any scripts now
- remove pyupgrade as it is redundant due to ruff

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Saugat Pachhai (सौगात) <[email protected]>
This commit is contained in:
pre-commit-ci[bot]
2023-08-02 18:08:30 +05:45
committed by GitHub
co-authored by Saugat Pachhai
parent 5c2fd67e6d
commit 502b3df6c9
25 changed files with 59 additions and 66 deletions
+4 -4
View File
@@ -7,11 +7,11 @@ import pytest
from dvc import env
from dvc.stage import PipelineStage
from dvc.testing.fixtures import * # noqa, pylint: disable=wildcard-import
from dvc.testing.fixtures import * # noqa: F403, pylint: disable=wildcard-import
from .dir_helpers import * # noqa, pylint: disable=wildcard-import
from .remotes import * # noqa, pylint: disable=wildcard-import
from .scripts import * # noqa, pylint: disable=wildcard-import
from .dir_helpers import * # noqa: F403 # pylint: disable=wildcard-import
from .remotes import * # noqa: F403 # pylint: disable=wildcard-import
from .scripts import * # noqa: F403, pylint: disable=wildcard-import
# Prevent updater and analytics from running their processes
os.environ["DVC_TEST"] = "true"
+1 -1
View File
@@ -5,7 +5,7 @@ from funcy import first, get_in
from dvc import api
from dvc.exceptions import OutputNotFoundError, PathMissingError
from dvc.testing.api_tests import TestAPI # noqa, pylint: disable=unused-import
from dvc.testing.api_tests import TestAPI # noqa: F401, pylint: disable=unused-import
from dvc.testing.tmp_dir import make_subrepo
from dvc.utils.fs import remove
+2 -1
View File
@@ -1,6 +1,7 @@
import pytest
from tests.unit.repo.experiments.conftest import ( # noqa, pylint disable=unused-argument
# pylint: disable-next=unused-argument
from tests.unit.repo.experiments.conftest import ( # noqa: F401
exp_stage,
failed_exp_stage,
session_app,
+3 -1
View File
@@ -10,7 +10,9 @@ from dvc_ssh.tests.cloud import TEST_SSH_KEY_PATH, TEST_SSH_USER
from dvc.repo.experiments.executor.base import ExecutorInfo, ExecutorResult
from dvc.repo.experiments.executor.ssh import SSHExecutor
from dvc.repo.experiments.refs import EXEC_HEAD, EXEC_MERGE
from tests.func.machine.conftest import * # noqa, pylint: disable=wildcard-import
# pylint: disable-next=wildcard-import
from tests.func.machine.conftest import * # noqa: F403
@contextmanager
+2 -2
View File
@@ -452,9 +452,9 @@ def temporary_windows_drive(tmp_path_factory):
if len(s) > 0
]
new_drive_name = [
new_drive_name = next(
letter for letter in string.ascii_uppercase if letter not in drives
][0]
)
new_drive = f"{new_drive_name}:"
target_path = tmp_path_factory.mktemp("tmp_windows_drive")
+2 -4
View File
@@ -218,7 +218,7 @@ def test_list_bad_args(tmp_dir, dvc, caplog, args):
def test_set_invalid_key(dvc):
with pytest.raises(ConfigError, match=r"extra keys not allowed"): # noqa: PT012
with pytest.raises(ConfigError, match=r"extra keys not allowed"):
with dvc.config.edit() as conf:
conf["core"]["invalid_key"] = "value"
@@ -227,9 +227,7 @@ def test_merging_two_levels(dvc):
with dvc.config.edit() as conf:
conf["remote"]["test"] = {"url": "ssh://example.com"}
with pytest.raises( # noqa: PT012
ConfigError, match=r"expected 'url' for dictionary value"
):
with pytest.raises(ConfigError, match=r"expected 'url' for dictionary value"):
with dvc.config.edit("global") as conf:
conf["remote"]["test"] = {"password": "1"}
+3 -1
View File
@@ -10,7 +10,9 @@ from dvc.cli import main
from dvc.exceptions import CheckoutError
from dvc.repo.open_repo import clean_repos
from dvc.stage.exceptions import StageNotFound
from dvc.testing.remote_tests import TestRemote # noqa, pylint: disable=unused-import
from dvc.testing.remote_tests import ( # noqa: F401, pylint: disable=unused-import
TestRemote,
)
from dvc.utils.fs import remove
from dvc_data.hashfile.db import HashFileDB
from dvc_data.hashfile.db.local import LocalHashFileDB
+9 -5
View File
@@ -84,7 +84,7 @@ def test_default_wdir_ignored_in_checksum(tmp_dir, dvc):
stage = dvc.run(cmd="cp bar foo", deps=["bar"], outs=["foo"], name="copy-foo-bar")
d = stage.dumpd()
assert Stage.PARAM_WDIR not in d.keys()
assert Stage.PARAM_WDIR not in d
d = load_yaml("dvc.yaml")
assert Stage.PARAM_WDIR not in d["stages"]["copy-foo-bar"]
@@ -246,13 +246,17 @@ def test_collect_symlink(tmp_dir, dvc, with_deps):
with pytest.raises(StageNotFoundError):
dvc.stage.collect(target=str(data_link / "foo.dvc"), with_deps=with_deps)
else:
stage = list(
dvc.stage.collect(target=str(data_link / "foo.dvc"), with_deps=with_deps)
)[0]
stage = next(
iter(
dvc.stage.collect(
target=str(data_link / "foo.dvc"), with_deps=with_deps
)
)
)
assert stage.addressing == os.path.join("data_link", "foo.dvc")
stage = list(dvc.stage.collect(target=f"{foo_path}.dvc", with_deps=with_deps))[0]
stage = next(iter(dvc.stage.collect(target=f"{foo_path}.dvc", with_deps=with_deps)))
assert stage.addressing == os.path.join("data", "foo.dvc")
+1 -1
View File
@@ -1,4 +1,4 @@
from dvc_ssh.tests.fixtures import ( # noqa, pylint: disable=unused-import
from dvc_ssh.tests.fixtures import ( # noqa: F401, pylint: disable=unused-import
make_ssh,
ssh,
ssh_server,