Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: reanahub/reana-commons
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 150afd2966bcd5d969a56a6c1d1fe42736cf2a3b
Choose a base ref
..
head repository: reanahub/reana-commons
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 794c79b5c7616d0d977bf12b636f71833ebff97c
Choose a head ref
Showing with 7 additions and 5 deletions.
  1. +6 −4 reana_commons/snakemake.py
  2. +1 −1 tests/test_snakemake.py
10 changes: 6 additions & 4 deletions reana_commons/snakemake.py
Original file line number Diff line number Diff line change
@@ -40,15 +40,15 @@
def snakemake_validate(
workflow_file: str, configfiles: List[str], workdir: Optional[str] = None
):
"""Validate snakemake workflow."""
"""Validate Snakemake workflow."""
if sys.version_info >= (3, 11):
snakemake_validate_v8(workflow_file, configfiles, workdir)
else:
snakemake_validate_v7(workflow_file, configfiles, workdir)

Check warning on line 47 in reana_commons/snakemake.py

Codecov / codecov/patch

reana_commons/snakemake.py#L47

Added line #L47 was not covered by tests


def snakemake_load(workflow_file: str, **kwargs: Any):
"""Load snakemake specification."""
"""Load Snakemake specification."""
if sys.version_info >= (3, 11):
return snakemake_load_v8(workflow_file, **kwargs)
else:
@@ -58,7 +58,7 @@ def snakemake_load(workflow_file: str, **kwargs: Any):
def snakemake_validate_v7(
workflow_file: str, configfiles: List[str], workdir: Optional[str] = None
):
"""Old snakemake validate version for python versions < 3.11, it is needed since snakemake8 dropped support for python < 3.11.
"""Snakemake 7 workflow validation function, necessary for Python versions < 3.11.
:param workflow_file: A specification file compliant with
`snakemake` workflow specification.
@@ -82,7 +82,9 @@ def snakemake_validate_v7(
def snakemake_validate_v8(
workflow_file: str, configfiles: List[str], workdir: Optional[str] = None
):
"""Seems to be enough for the first validation. We may move to snakemake --dry-run when the validation process will be fully moved to the server-side.
"""Snakemake 8 workflow validation function for Python versions >= 3.11.
Note that we may move to using snakemake --dry-run when the validation process will be fully moved to the server side.
:param workflow_file: A specification file compliant with
`snakemake` workflow specification.
2 changes: 1 addition & 1 deletion tests/test_snakemake.py
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@

@pytest.mark.xfail(
sys.version_info >= (3, 11),
reason="Test expted to fail for python versions 3.11 and above as we currently return only empty dictionary in snakemake_load function for python >= 3.11. Development is blocked until we move validation to the server side.",
reason="Test expected to fail for python versions 3.11 and above as we currently return only empty dictionary in snakemake_load function for python >= 3.11.",
)
def test_snakemake_load(tmpdir, dummy_snakefile):
"""Test that Snakemake metadata is loaded properly."""