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

download should use CHECKSUMS #25

Open
GavinHuttley opened this issue May 19, 2021 · 0 comments
Open

download should use CHECKSUMS #25

GavinHuttley opened this issue May 19, 2021 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@GavinHuttley
Copy link
Contributor

GavinHuttley commented May 19, 2021

The ensembldb3.download.Download class should check that all downloaded files match the value in Ensembl's provided CHECKSUMS file.

Add a function based on the following code that is called by Download.

def get_invalid_files(path):
    """return files with invalid checksums"""
    checkpath = (path / "CHECKSUMS")
    failed = []
    with open(checkpath) as infile:
        for record in infile.readlines():
            record = record.split()
            filepath = path / record[-1]
            if not filepath.exists():
                continue

            result = exec_command(f"sum {filepath}")
            result = result.split()
            if result != record[:2]:
                failed.append(filepath)
    return failed
@GavinHuttley GavinHuttley added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant