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

[Backport release-1.7] [python] Support Python 3.12 #2135

Merged
merged 1 commit into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/python-ci-minimal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ jobs:
fail-fast: true
matrix:
os: [ubuntu-22.04, macos-12]
python-version: ['3.10', '3.7']
# Just testing this out for https://github.com/single-cell-data/TileDB-SOMA/issues/1849
python-version: ['3.7, '3.12']
include:
- os: ubuntu-22.04
cc: gcc-11
Expand Down
1 change: 1 addition & 0 deletions apis/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ def run(self):
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
package_dir={"": "src"},
packages=setuptools.find_packages("src"),
Expand Down
19 changes: 14 additions & 5 deletions apis/python/src/tiledbsoma/_general_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import sys

import tiledb
from pkg_resources import DistributionNotFound, get_distribution

from .pytiledbsoma import version as libtiledbsoma_version

Expand All @@ -36,10 +35,20 @@ def get_implementation_version() -> str:

Lifecycle: maturing
"""
try:
return get_distribution("tiledbsoma").version
except DistributionNotFound:
return "unknown"
if sys.version_info < (3, 8, 0):
from pkg_resources import DistributionNotFound, get_distribution

try:
return get_distribution("tiledbsoma").version
except DistributionNotFound:
return "unknown"
else:
import importlib.metadata

try:
return importlib.metadata.version("tiledbsoma")
except importlib.metadata.PackageNotFoundError:
return "unknown"


def get_storage_engine() -> str:
Expand Down
Loading