From e07a42251dca274ee677f708e2b85b67d67404a3 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 17:24:48 +0000 Subject: [PATCH 1/2] [pre-commit.ci] pre-commit autoupdate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit updates: - [github.com/crate-ci/typos: dictgen-v0.3.1 → typos-dict-v0.12.4](https://github.com/crate-ci/typos/compare/dictgen-v0.3.1...typos-dict-v0.12.4) - [github.com/astral-sh/ruff-pre-commit: v0.8.6 → v0.9.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.6...v0.9.4) --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 84d9376ad..7cf308b28 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,12 +24,12 @@ repos: - --py36-plus - repo: https://github.com/crate-ci/typos - rev: dictgen-v0.3.1 + rev: typos-dict-v0.12.4 hooks: - id: typos - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.8.6 + rev: v0.9.4 hooks: - id: ruff args: [ --fix ] From e18f8ef9e31ce1d4b33202741e014e7781c88742 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 17:24:59 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- conda_forge_tick/auto_tick.py | 2 +- conda_forge_tick/lazy_json_backends.py | 2 +- conda_forge_tick/make_migrators.py | 4 ++-- conda_forge_tick/migrators/arch.py | 6 +++--- conda_forge_tick/utils.py | 4 ++-- tests/test_container_tasks.py | 24 ++++++++++++------------ tests/test_matplotlib_base.py | 2 +- tests/test_migrator_to_json.py | 6 ++---- tests/test_migrators.py | 2 +- tests/test_migrators_v1.py | 2 +- tests/test_version_migrator.py | 4 ++-- 11 files changed, 28 insertions(+), 30 deletions(-) diff --git a/conda_forge_tick/auto_tick.py b/conda_forge_tick/auto_tick.py index ca7ef6f46..09dbc6c1a 100644 --- a/conda_forge_tick/auto_tick.py +++ b/conda_forge_tick/auto_tick.py @@ -363,7 +363,7 @@ def _handle_solvability_error(
-        {'
'.join(sorted(set(errors)))}
+        {"
".join(sorted(set(errors)))}
         
diff --git a/conda_forge_tick/lazy_json_backends.py b/conda_forge_tick/lazy_json_backends.py index 968e8dc36..2624af26d 100644 --- a/conda_forge_tick/lazy_json_backends.py +++ b/conda_forge_tick/lazy_json_backends.py @@ -1091,7 +1091,7 @@ def default(obj: Any) -> Any: elif isinstance(obj, nx.DiGraph): nld = nx.node_link_data(obj, edges="links") links = nld["links"] - links2 = sorted(links, key=lambda x: f'{x["source"]}{x["target"]}') + links2 = sorted(links, key=lambda x: f"{x['source']}{x['target']}") nld["links"] = links2 return {"__nx_digraph__": True, "node_link_data": nld} raise TypeError(repr(obj) + " is not JSON serializable") diff --git a/conda_forge_tick/make_migrators.py b/conda_forge_tick/make_migrators.py index cd0aef98e..e4fc13978 100644 --- a/conda_forge_tick/make_migrators.py +++ b/conda_forge_tick/make_migrators.py @@ -830,8 +830,8 @@ def initialize_migrators( for m in migrators + pinning_migrators: if isinstance(m, GraphMigrator): print( - f' {getattr(m, "name", m)} graph size: ' - f'{len(getattr(m, "graph", []))}', + f" {getattr(m, 'name', m)} graph size: " + f"{len(getattr(m, 'graph', []))}", flush=True, ) diff --git a/conda_forge_tick/migrators/arch.py b/conda_forge_tick/migrators/arch.py index a4de37d36..b75543d49 100644 --- a/conda_forge_tick/migrators/arch.py +++ b/conda_forge_tick/migrators/arch.py @@ -357,9 +357,9 @@ def __init__( effective_graph=effective_graph, ) - assert ( - not self.check_solvable - ), "We don't want to check solvability for arm osx!" + assert not self.check_solvable, ( + "We don't want to check solvability for arm osx!" + ) self.target_packages = target_packages self.name = name diff --git a/conda_forge_tick/utils.py b/conda_forge_tick/utils.py index c318d15b2..b6ff2f91d 100644 --- a/conda_forge_tick/utils.py +++ b/conda_forge_tick/utils.py @@ -904,7 +904,7 @@ def filter(self, record): try: return _run(use_orig_cbc_path=True) except (SystemExit, Exception): - logger.debug("parsing w/ conda_build_config.yaml failed! " "trying without...") + logger.debug("parsing w/ conda_build_config.yaml failed! trying without...") try: return _run(use_orig_cbc_path=False) except (SystemExit, Exception) as e: @@ -1117,7 +1117,7 @@ def pluck(G: nx.DiGraph, node_id: Any) -> None: def dump_graph_json(gx: nx.DiGraph, filename: str = "graph.json") -> None: nld = nx.node_link_data(gx, edges="links") links = nld["links"] - links2 = sorted(links, key=lambda x: f'{x["source"]}{x["target"]}') + links2 = sorted(links, key=lambda x: f"{x['source']}{x['target']}") nld["links"] = links2 lzj = LazyJson(filename) diff --git a/tests/test_container_tasks.py b/tests/test_container_tasks.py index 2e2a542ad..878bf62d4 100644 --- a/tests/test_container_tasks.py +++ b/tests/test_container_tasks.py @@ -318,16 +318,16 @@ def test_container_tasks_rerender_feedstock_containerized_same_as_local( print(f"out: {captured.out}\nerr: {captured.err}") if "git commit -m " in captured.err: - assert ( - msg is not None - ), f"msg: {msg}\nout: {captured.out}\nerr: {captured.err}" - assert msg.startswith( - "MNT:" - ), f"msg: {msg}\nout: {captured.out}\nerr: {captured.err}" + assert msg is not None, ( + f"msg: {msg}\nout: {captured.out}\nerr: {captured.err}" + ) + assert msg.startswith("MNT:"), ( + f"msg: {msg}\nout: {captured.out}\nerr: {captured.err}" + ) else: - assert ( - msg is None - ), f"msg: {msg}\nout: {captured.out}\nerr: {captured.err}" + assert msg is None, ( + f"msg: {msg}\nout: {captured.out}\nerr: {captured.err}" + ) with pushd(tmpdir_local): subprocess.run( @@ -377,9 +377,9 @@ def test_container_tasks_rerender_feedstock_containerized_same_as_local( rel_local_fnames = { os.path.relpath(fname, tmpdir_local) for fname in local_fnames } - assert ( - rel_cont_fnames == rel_local_fnames - ), f"{rel_cont_fnames} != {rel_local_fnames}" + assert rel_cont_fnames == rel_local_fnames, ( + f"{rel_cont_fnames} != {rel_local_fnames}" + ) for cfname in cont_fnames: lfname = os.path.join(tmpdir_local, os.path.relpath(cfname, tmpdir_cont)) diff --git a/tests/test_matplotlib_base.py b/tests/test_matplotlib_base.py index ec4b85595..ba5124620 100644 --- a/tests/test_matplotlib_base.py +++ b/tests/test_matplotlib_base.py @@ -9,7 +9,7 @@ old_pkg="matplotlib", new_pkg="matplotlib-base", rationale=( - "Unless you need `pyqt`, recipes should depend only on " "`matplotlib-base`." + "Unless you need `pyqt`, recipes should depend only on `matplotlib-base`." ), pr_limit=5, ) diff --git a/tests/test_migrator_to_json.py b/tests/test_migrator_to_json.py index 4b0650fc4..bb0810dc0 100644 --- a/tests/test_migrator_to_json.py +++ b/tests/test_migrator_to_json.py @@ -142,8 +142,7 @@ def test_migrator_to_json_matplotlib_base(): old_pkg="matplotlib", new_pkg="matplotlib-base", rationale=( - "Unless you need `pyqt`, recipes should depend only on " - "`matplotlib-base`." + "Unless you need `pyqt`, recipes should depend only on `matplotlib-base`." ), pr_limit=5, ) @@ -193,8 +192,7 @@ def test_migrator_to_json_rebuild(): old_pkg="matplotlib", new_pkg="matplotlib-base", rationale=( - "Unless you need `pyqt`, recipes should depend only on " - "`matplotlib-base`." + "Unless you need `pyqt`, recipes should depend only on `matplotlib-base`." ), pr_limit=5, ) diff --git a/tests/test_migrators.py b/tests/test_migrators.py index 2302f1b06..35a74da05 100644 --- a/tests/test_migrators.py +++ b/tests/test_migrators.py @@ -442,7 +442,7 @@ def test_yaml_migration_rebuild_no_buildno(tmpdir): old_pkg="matplotlib", new_pkg="matplotlib-base", rationale=( - "Unless you need `pyqt`, recipes should depend only on " "`matplotlib-base`." + "Unless you need `pyqt`, recipes should depend only on `matplotlib-base`." ), pr_limit=5, ) diff --git a/tests/test_migrators_v1.py b/tests/test_migrators_v1.py index 0cf98b78c..602d1982e 100644 --- a/tests/test_migrators_v1.py +++ b/tests/test_migrators_v1.py @@ -163,7 +163,7 @@ def test_yaml_migration_rebuild_no_buildno(tmpdir): old_pkg="matplotlib", new_pkg="matplotlib-base", rationale=( - "Unless you need `pyqt`, recipes should depend only on " "`matplotlib-base`." + "Unless you need `pyqt`, recipes should depend only on `matplotlib-base`." ), pr_limit=5, ) diff --git a/tests/test_version_migrator.py b/tests/test_version_migrator.py index 5d2040fd0..d6acd2545 100644 --- a/tests/test_version_migrator.py +++ b/tests/test_version_migrator.py @@ -203,9 +203,9 @@ def test_version_noup(case, new_ver, tmpdir, caplog): tmpdir=tmpdir, ) - assert "The recipe did not change in the version migration," in str( + assert "The recipe did not change in the version migration," in str(e.value), ( e.value - ), e.value + ) def test_version_cupy(tmpdir, caplog):