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

[python] verify_core_versions() during import tiledbsoma #2437

Merged
merged 2 commits into from
Apr 12, 2024

Conversation

ryan-williams
Copy link
Member

Issue and/or context: #1837

Changes:

  • Add verify_core_versions helper which asserts that TileDB-Py's and libtiledbsoma's core versions match
  • Add verify_core_versions() to tiledbsoma.__init__.py
  • Add TILEDB_CORE_MISMATCHED_VERSIONS_ERROR_LEVEL=err "escape hatch"; if the check above catches any users, and they really want to just keep running and fix it later, this allows it (but prints a relevant error message).
  • Minor reformatting of show_package_versions output:
    < tiledbsoma.__version__        1.5.0rc0.post272.dev2332272127
    < TileDB-Py tiledb.version()    (0, 27, 1)
    < TileDB core version           2.21.1
    < libtiledbsoma version()       libtiledb=2.21.1
    < python version                3.11.8.final.0
    < OS version                    Darwin 23.2.0
    ---
    > tiledbsoma.__version__              1.5.0rc0.post272.dev2332272127
    > TileDB-Py version                   0.27.1
    > TileDB core version (tiledb)        2.21.1
    > TileDB core version (libtiledbsoma) 2.21.1
    > python version                      3.11.8.final.0
    > OS version                          Darwin 23.2.0

Notes for Reviewer:

  • We could probably put together a test for this in a Docker image where we intentionally install mismatched versions… not sure it's worth it.
  • I am fetching libtiledbsoma's "core" version via pytiledbsoma.version, which calls tiledbsoma::version::as_string(), which calls tiledb_version.
    • The naming feels a bit off, the former two seem like they'd return a version of libtiledbsoma, not libtiledb.
    • Don't need to change it here, just want to make sure I'm understanding.

@ryan-williams ryan-williams requested a review from johnkerl April 11, 2024 22:35
@eddelbuettel
Copy link
Contributor

I like the 'hatch' -- thumps up. I considered adding such an override in the R package's R/Init.R but haven't yet. May reconsider.

Copy link

codecov bot commented Apr 11, 2024

Codecov Report

Merging #2437 (fbe7a03) into main (7c76c4a) will decrease coverage by 0.19%.
Report is 2 commits behind head on main.
The diff coverage is 78.57%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2437      +/-   ##
==========================================
- Coverage   90.61%   90.43%   -0.19%     
==========================================
  Files          37       37              
  Lines        3900     3940      +40     
==========================================
+ Hits         3534     3563      +29     
- Misses        366      377      +11     
Flag Coverage Δ
python 90.43% <78.57%> (-0.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
python_api 90.43% <78.57%> (-0.19%) ⬇️
libtiledbsoma ∅ <ø> (∅)

@@ -156,7 +156,7 @@
get_SOMA_version,
get_storage_engine,
show_package_versions,
verify_core_versions,
_verify_core_versions,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I wasn't clear -- let's keep this tiledbsoma._general_utilities.verify_core_versions but just don't auto-export it in the package-level __init__.py

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryan-williams so sorry!! I misread this as you populating __all__ -- but you very much are not

Let's just call it verify_core_versions and this will be fine

@johnkerl johnkerl self-requested a review April 12, 2024 20:03
Copy link
Member

@johnkerl johnkerl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢
Sorry again about the misdirect! 😓

@johnkerl johnkerl merged commit 8fd9357 into main Apr 12, 2024
28 checks passed
@johnkerl johnkerl deleted the rw/verify-cores branch April 12, 2024 20:53
github-actions bot pushed a commit that referenced this pull request Apr 12, 2024
* verify_core_versions() during `import tiledbsoma`

* add comment
johnkerl pushed a commit that referenced this pull request Apr 12, 2024
…2443)

* verify_core_versions() during `import tiledbsoma`

* add comment

Co-authored-by: Ryan Williams <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants