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

Inspection False Positive: Unresolved reference: 'storage', 'github', 'gitfile', 'gitlab' #550

Closed
iromeo opened this issue Oct 21, 2024 · 1 comment

Comments

@iromeo
Copy link
Contributor

iromeo commented Oct 21, 2024

shell.executable("bash")

shell("touch C && sleep 1 && touch B && sleep 1 && touch A && touch D && \
    mkdir -p .snakemake/storage/http/github.com/snakemake/snakemake/raw/series-7/tests/test_remote_http/expected-results && \
    touch .snakemake/storage/http/github.com/snakemake/snakemake/raw/series-7/tests/test_remote_http/expected-results/landsat-data.txt && \
    touch -t 200101010101 old_file")

#Will not be executed even though A is newer
rule a:
    input:
        ancient("A")
    output:
        "B"
    shell:
        "echo \"B recreated\" > {output}"

#Will be executed because B is newer
rule b:
    input:
        "B"
    output:
        "C"
    shell:
        "echo \"C recreated\" > {output}"

rule c:
    input:
        ancient("C")
    output:
        "D"
    shell:
        "echo \"D recreated\" > {output}"

# This should not run even though output is older than input
rule remote_ancient:
    input:
        storage(
            "https://github.com/snakemake/snakemake/raw/series-7/tests/test_remote_http/expected-results/landsat-data.txt"
        )
    output:
        "old_file"
    shell:
        "cp {input} {output}"

Also 'github', 'gitfile', 'gitlab'
See registration in snakemake/workflow.py :

        _globals["shell"] = shell
        _globals["workflow"] = self
        _globals["checkpoints"] = Checkpoints()
        _globals["scatter"] = Scatter()
        _globals["gather"] = Gather()
        _globals["github"] = sourcecache.GithubFile
        _globals["gitlab"] = sourcecache.GitlabFile
        _globals["gitfile"] = sourcecache.LocalGitFile
        _globals["storage"] = self._storage_registry
        snakemake.ioutils.register_in_globals(_globals)
        snakemake.ioflags.register_in_globals(_globals)
        _globals["from_queue"] = from_queue
@iromeo iromeo added this to the next release milestone Oct 22, 2024
@iromeo iromeo changed the title Inspeciton False Positive: Unresolved reference 'storage' Inspeciton False Positive: Unresolved reference: 'storage', 'github', 'gitfile', 'gitlab' Oct 22, 2024
@iromeo
Copy link
Contributor Author

iromeo commented Oct 22, 2024

workflow.py: self.globals & _globals

8.0.0: storage
7.13.0: gitfile
6.8.1: github, gitlab
<= 6.1.0 : workflow, gather, scatter, checkpoints, rules, cluster_config, config

@iromeo iromeo changed the title Inspeciton False Positive: Unresolved reference: 'storage', 'github', 'gitfile', 'gitlab' Inspection False Positive: Unresolved reference: 'storage', 'github', 'gitfile', 'gitlab' Oct 22, 2024
@iromeo iromeo closed this as completed in 3e7b3b6 Oct 22, 2024
@iromeo iromeo modified the milestones: next release, 2024.2.2 Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant