Skip to content
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

archive cli docs inconsistent with code #2877

Open
nate-d-olson opened this issue May 15, 2024 · 1 comment
Open

archive cli docs inconsistent with code #2877

nate-d-olson opened this issue May 15, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@nate-d-olson
Copy link

Snakemake version
8.11.3
Describe the bug
snakemake --archive filename.tar.gz, returns error

WorkflowError:
Unsupported archive format (supported: .tar, .tar.gz, .tar.bz2, .tar.xz)

Additional context

From the codebase it looks like only .tar and .xz extensions are allowed

assert path.suffixes == [".tar", ".xz"]
. The cli argpase documentation indicates additional archive formats are supported,
"formats are .tar, .tar.gz, .tar.bz2 and .tar.xz.",
.

It would be nice if snakemake would support tar.gz archive files again but at minimum the cli help docs and error message should be consistent with the codebase.

@nate-d-olson nate-d-olson added the bug Something isn't working label May 15, 2024
@NelisDrost
Copy link
Contributor

I had a look into this to see if it might be an easy fix. The error is actually being thrown by a different part of the code DAG.archive():

if path.suffix == ".tar":
    mode = "x"
elif path.suffixes == [".tar", ".bz2"]:
    mode = "x:bz2"
elif path.suffixes == [".tar", ".xz"]:
    mode = "x:xz"
elif path.suffixes == [".tar", ".gz"]:
    mode = "x:gz"
else:
    raise WorkflowError(
        "Unsupported archive format "
        "(supported: .tar, .tar.gz, .tar.bz2, .tar.xz)"
    )

From that, it looks like the supported formats match those reported via argparse. I tried to recreate the issue, but archiving to .tar.gz works fine on my system (windows 10, python 3.12).

There may be nothing to fix here, or there may be something else in OPs setup that's causing the issue.
@nate-d-olson - are you still getting the same error? Could you provide some more details about your setup?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants