From 0d514d1893d8012ceecdab5e952e4d2ba1902e05 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 19:45:11 +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/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v5.0.0) - [github.com/astral-sh/ruff-pre-commit: v0.4.4 → v0.9.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.4...v0.9.6) - [github.com/executablebooks/mdformat: 0.7.17 → 0.7.22](https://github.com/executablebooks/mdformat/compare/0.7.17...0.7.22) - [github.com/codespell-project/codespell: v2.2.6 → v2.4.1](https://github.com/codespell-project/codespell/compare/v2.2.6...v2.4.1) --- .pre-commit-config.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c895a37..c6bd3a8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v5.0.0 hooks: - id: check-added-large-files args: ['--maxkb=100'] @@ -25,7 +25,7 @@ repos: - id: python-use-type-annotations - id: text-unicode-replacement-char - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.4 + rev: v0.9.6 hooks: - id: ruff - id: ruff-format @@ -34,7 +34,7 @@ repos: hooks: - id: refurb - repo: https://github.com/executablebooks/mdformat - rev: 0.7.17 + rev: 0.7.22 hooks: - id: mdformat additional_dependencies: [ @@ -43,7 +43,7 @@ repos: ] args: [--wrap, "88"] - repo: https://github.com/codespell-project/codespell - rev: v2.2.6 + rev: v2.4.1 hooks: - id: codespell - repo: meta From 0b14a2e089aa615d13bd8f40fd39560f2ed803fc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 19:45:41 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/ISSUE_TEMPLATE/enhancement.md | 2 +- src/pytask_julia/serialization.py | 2 +- tests/conftest.py | 4 ++-- tests/test_collect.py | 6 +++--- tests/test_config.py | 2 +- tests/test_execute.py | 22 +++++++++++----------- tests/test_normal_execution_w_plugin.py | 2 +- tests/test_parallel.py | 4 ++-- tests/test_parametrize.py | 2 +- tests/test_shared.py | 3 ++- 10 files changed, 25 insertions(+), 24 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/enhancement.md b/.github/ISSUE_TEMPLATE/enhancement.md index dec2fab..822c3cb 100644 --- a/.github/ISSUE_TEMPLATE/enhancement.md +++ b/.github/ISSUE_TEMPLATE/enhancement.md @@ -8,7 +8,7 @@ ______________________________________________________________________ #### Is your feature request related to a problem? Provide a description of what the problem is, e.g. "I wish I could use pytask-julia to -do \[...\]". +do [...]". #### Describe the solution you'd like diff --git a/src/pytask_julia/serialization.py b/src/pytask_julia/serialization.py index 5beb6b4..ee55b85 100644 --- a/src/pytask_julia/serialization.py +++ b/src/pytask_julia/serialization.py @@ -11,7 +11,7 @@ from pytask import PTask from pytask import PTaskWithPath -__all__ = ["create_path_to_serialized", "serialize_keyword_arguments", "SERIALIZERS"] +__all__ = ["SERIALIZERS", "create_path_to_serialized", "serialize_keyword_arguments"] _HIDDEN_FOLDER = ".pytask/pytask-julia" diff --git a/tests/conftest.py b/tests/conftest.py index 74128c6..1bf3fa1 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -20,7 +20,7 @@ parametrize_parse_code_serializer_suffix = pytest.mark.parametrize( - "parse_config_code, serializer, suffix", + ("parse_config_code", "serializer", "suffix"), [ ("import JSON; config = JSON.parse(read(ARGS[1], String))", "json", ".json"), ("import YAML; config = YAML.load_file(ARGS[1])", "yaml", ".yaml"), @@ -87,6 +87,6 @@ def invoke(self, *args, **kwargs): return super().invoke(*args, **kwargs) -@pytest.fixture() +@pytest.fixture def runner(): return CustomCliRunner() diff --git a/tests/test_collect.py b/tests/test_collect.py index 7dafc0e..53a3e35 100644 --- a/tests/test_collect.py +++ b/tests/test_collect.py @@ -4,14 +4,14 @@ import pytest from pytask import Mark + from pytask_julia.collect import SERIALIZERS from pytask_julia.collect import _parse_julia_mark from pytask_julia.collect import _parse_project - from tests.conftest import ROOT -@pytest.mark.unit() +@pytest.mark.unit @pytest.mark.parametrize( ( "mark", @@ -91,7 +91,7 @@ def test_parse_julia_mark( # noqa: PLR0913 assert out == expected -@pytest.mark.unit() +@pytest.mark.unit @pytest.mark.parametrize( ("project", "root", "expected"), [ diff --git a/tests/test_config.py b/tests/test_config.py index efe4f2f..b6adf01 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -4,7 +4,7 @@ from pytask import build -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_marker_is_configured(tmp_path): session = build(paths=tmp_path) assert "julia" in session.config["markers"] diff --git a/tests/test_execute.py b/tests/test_execute.py index e206612..718b27b 100644 --- a/tests/test_execute.py +++ b/tests/test_execute.py @@ -11,14 +11,14 @@ from pytask import Task from pytask import build from pytask import cli -from pytask_julia.execute import pytask_execute_task_setup +from pytask_julia.execute import pytask_execute_task_setup from tests.conftest import ROOT from tests.conftest import needs_julia from tests.conftest import parametrize_parse_code_serializer_suffix -@pytest.mark.unit() +@pytest.mark.unit def test_pytask_execute_task_setup_missing_julia(monkeypatch): """Make sure that the task setup raises errors.""" # Act like julia is installed since we do not test this. @@ -37,7 +37,7 @@ def test_pytask_execute_task_setup_missing_julia(monkeypatch): @needs_julia -@pytest.mark.end_to_end() +@pytest.mark.end_to_end @parametrize_parse_code_serializer_suffix @pytest.mark.parametrize("depends_on", ["'in_1.txt'", "['in_1.txt', 'in_2.txt']"]) def test_run_jl_script( # noqa: PLR0913 @@ -86,7 +86,7 @@ def task_run_jl_script(): @needs_julia -@pytest.mark.end_to_end() +@pytest.mark.end_to_end @parametrize_parse_code_serializer_suffix def test_run_jl_script_w_task_decorator( runner, tmp_path, parse_config_code, serializer, suffix @@ -123,7 +123,7 @@ def run_jl_script(): @needs_julia -@pytest.mark.end_to_end() +@pytest.mark.end_to_end @parametrize_parse_code_serializer_suffix def test_raise_error_if_julia_is_not_found( tmp_path, @@ -169,7 +169,7 @@ def task_run_jl_script(): @needs_julia -@pytest.mark.end_to_end() +@pytest.mark.end_to_end @parametrize_parse_code_serializer_suffix def test_run_jl_script_w_wrong_cmd_option( runner, @@ -208,7 +208,7 @@ def task_run_jl_script(): @needs_julia -@pytest.mark.end_to_end() +@pytest.mark.end_to_end @pytest.mark.parametrize("n_threads", [2, 3]) @parametrize_parse_code_serializer_suffix def test_check_passing_cmd_line_options( # noqa: PLR0913 @@ -249,7 +249,7 @@ def task_run_jl_script(): @needs_julia -@pytest.mark.end_to_end() +@pytest.mark.end_to_end @pytest.mark.xfail( condition=sys.platform == "win32" and os.environ.get("CI") == "true", reason="Test folder and repo are on different drives causing relpath to fail.", @@ -303,7 +303,7 @@ def task_run_jl_script(): @needs_julia -@pytest.mark.end_to_end() +@pytest.mark.end_to_end @pytest.mark.xfail( condition=sys.platform == "win32" and os.environ.get("CI") == "true", reason="Test folder and repo are on different drives causing relpath to fail.", @@ -349,7 +349,7 @@ def task_run_jl_script(): @needs_julia -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_run_jl_script_w_custom_serializer(runner, tmp_path): task_source = f""" import pytask @@ -382,7 +382,7 @@ def task_run_jl_script(): @needs_julia -@pytest.mark.end_to_end() +@pytest.mark.end_to_end def test_run_jl_script_fails_w_multiple_markers(runner, tmp_path): task_source = """ import pytask diff --git a/tests/test_normal_execution_w_plugin.py b/tests/test_normal_execution_w_plugin.py index 1d71ade..bc83230 100644 --- a/tests/test_normal_execution_w_plugin.py +++ b/tests/test_normal_execution_w_plugin.py @@ -9,7 +9,7 @@ from pytask import cli -@pytest.mark.end_to_end() +@pytest.mark.end_to_end @pytest.mark.parametrize( "dependencies", [(), ("in.txt",), ("in_1.txt", "in_2.txt")], diff --git a/tests/test_parallel.py b/tests/test_parallel.py index 8806418..ea87888 100644 --- a/tests/test_parallel.py +++ b/tests/test_parallel.py @@ -27,7 +27,7 @@ @needs_julia -@pytest.mark.end_to_end() +@pytest.mark.end_to_end @parametrize_parse_code_serializer_suffix def test_parallel_parametrization_over_source_files_w_loop( runner, @@ -75,7 +75,7 @@ def task_execute_julia(): @needs_julia -@pytest.mark.end_to_end() +@pytest.mark.end_to_end @parametrize_parse_code_serializer_suffix def test_parallel_parametrization_over_source_file_w_loop( runner, diff --git a/tests/test_parametrize.py b/tests/test_parametrize.py index 54606ce..4c2b43c 100644 --- a/tests/test_parametrize.py +++ b/tests/test_parametrize.py @@ -12,7 +12,7 @@ @needs_julia -@pytest.mark.end_to_end() +@pytest.mark.end_to_end @parametrize_parse_code_serializer_suffix def test_parametrized_execution_of_jl_script_w_loop( runner, diff --git a/tests/test_shared.py b/tests/test_shared.py index 39a0206..d9f9bb4 100644 --- a/tests/test_shared.py +++ b/tests/test_shared.py @@ -3,10 +3,11 @@ from contextlib import ExitStack as does_not_raise # noqa: N813 import pytest + from pytask_julia.shared import julia -@pytest.mark.unit() +@pytest.mark.unit @pytest.mark.parametrize( ("args", "kwargs", "expectation", "expected"), [