single-cell-data / TileDB-SOMA

Python and R SOMA APIs using TileDB’s cloud-native format. Ideal for single-cell data at any scale.
https://tiledbsoma.readthedocs.io
MIT License
91 stars 25 forks source link

[python] CI `mypy` issue as of 2024-08-05 #2839

Closed johnkerl closed 3 months ago

johnkerl commented 3 months ago

To be investigated:

On the one hand this might seem to be a minor annoyance; on the other, it's clouding CI just when we're trying to make the TileDB-SOMA 1.13.0 release. Thus we should solve this sooner than later.

See also #2838 (just created) which has significant narrative by @ryan-williams on it.

Some background info (something that's been in place for a year now, I am reading up on now):

[sc-52471]

johnkerl commented 3 months ago

Re-assigning to @ryan-williams

ryan-williams commented 3 months ago

At a minimum, actions/setup-python is doing something buggy, I filed https://github.com/actions/setup-python/issues/919.

This issue is live on #2853, until we find a work-around, so I'm reopening it.

ryan-williams commented 3 months ago

Issue persists with setup-python cache disabled (and no pre-commit cache found/restored), on both macos and ubuntu. Very strange.

ryan-williams commented 3 months ago

I believe I've root-caused this:

I believe #2854 actually fixes it; we can keep an eye on setup-python caching behavior as well.

Here is a little script I wrote that mimics the GHA hashFiles helper (used in setup-python and in some of our actions/cache invocations):

#!/usr/bin/env python
import hashlib
import sys

sha256 = hashlib.sha256()

for path in sys.argv[1:]:
    file_sha256 = hashlib.sha256()
    with open(path, "rb") as f:
        for byte_block in iter(lambda: f.read(4096), b""):
            file_sha256.update(byte_block)
    sha256.update(file_sha256.digest())

print(sha256.hexdigest())