-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(snakemake): update to v7.32.4 to make Python 3.11 clients compatible #435
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,7 +93,7 @@ def _create_snakemake_dag( | |
if workdir: | ||
workflow.workdir(workdir) | ||
|
||
workflow.include(snakefile=snakefile, overwrite_first_rule=True) | ||
workflow.include(snakefile=snakefile, overwrite_default_target=True) | ||
workflow.check() | ||
|
||
# code copied and adapted from `snakemake.workflow.Workflow.execute()` | ||
|
@@ -113,16 +113,20 @@ def files(items): | |
else: | ||
|
||
def files(items): | ||
relpath = ( | ||
lambda f: f | ||
if os.path.isabs(f) or f.startswith("root://") | ||
else os.path.relpath(f) | ||
) | ||
def relpath(f): | ||
return ( | ||
f | ||
if os.path.isabs(f) or f.startswith("root://") | ||
else os.path.relpath(f) | ||
) | ||
|
||
return map(relpath, filterfalse(workflow.is_rule, items)) | ||
|
||
if not kwargs.get("targets"): | ||
targets = ( | ||
[workflow.first_rule] if workflow.first_rule is not None else list() | ||
[workflow.default_target] | ||
if workflow.default_target is not None | ||
else list() | ||
) | ||
|
||
prioritytargets = kwargs.get("prioritytargets", []) | ||
|
@@ -157,7 +161,11 @@ def files(items): | |
omitrules=omitrules, | ||
) | ||
|
||
workflow.persistence = Persistence(dag=dag) | ||
if hasattr(workflow, "_persistence"): | ||
workflow._persistence = Persistence(dag=dag) | ||
else: | ||
# for backwards compatibility (Snakemake < 7 for Python 3.6) | ||
workflow.persistence = Persistence(dag=dag) | ||
Comment on lines
+164
to
+168
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is needed to also support Python 3.6, that uses a Snakemake version (6.15) in which the new There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is good and I prefer it over checking Snakemake/Python version |
||
dag.init() | ||
dag.update_checkpoint_dependencies() | ||
dag.check_dynamic() | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,10 +17,6 @@ | |
|
||
def test_snakemake_load(tmpdir, dummy_snakefile): | ||
"""Test that Snakemake metadata is loaded properly.""" | ||
if sys.version_info.major == 3 and sys.version_info.minor in (11, 12): | ||
pytest.xfail( | ||
"Snakemake features of reana-client are not supported on Python 3.11" | ||
) | ||
Comment on lines
-20
to
-23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should also be removed from tests in reana-client |
||
workdir = tmpdir.mkdir("sub") | ||
# write Snakefile | ||
p = workdir.join("Snakefile") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change should rather be a feature, not a fix. While it's technically true that we are fixing things for py311 clients, we are also upgrading Snakemake to a new major version, which might affect all clients for all other Python versions. So we should rather bring attention to that. I would suggest putting something like
feat(snakemake): upgrade to Snakemake 7.32.4
for the release announcement headline.