Esempio n. 1
0
def pip_deps_changed(ctx):
    hash_file_path = os.path.join(ctx.hash_store, 'external_requirements')
    saved_hash = b''

    try:
        with open(hash_file_path) as f:
            saved_hash = f.read()
    except:
        pass

    full_path = os.path.join(ctx.root, 'external_requirements.txt')
    computed_hash = hash_file(full_path, hashlib.sha256)

    return saved_hash != computed_hash
Esempio n. 2
0
def save_pip_deps_hash(ctx):
    full_path = os.path.join(ctx.root, 'external_requirements.txt')
    hash_file_path = os.path.join(ctx.hash_store, 'external_requirements')
    with open(hash_file_path, 'w') as f:
        f.write(hash_file(full_path, hashlib.sha256))