metaist / ds

run dev scripts
https://metaist.github.io/ds/
MIT License
4 stars 0 forks source link

add: `--self-update` for cosmopolitan installs #88

Open metaist opened 2 weeks ago

metaist commented 2 weeks ago

I'd want to see how far I could get with just the built-in python calls before jumping ship and using requests.

metaist commented 2 weeks ago

I'd have to:

Could put version number + checksum as a release asset .json so I can fetch both. I should see what uv does for receipts.

metaist commented 2 weeks ago
import hashlib
def compute_file_hash(file_path, hash_function='sha256'):
    hash_func = getattr(hashlib, hash_function)()
    with open(file_path, 'rb') as f:
        for chunk in iter(lambda: f.read(4096), b""):
            hash_func.update(chunk)
    return hash_func.hexdigest()