Skip to content

Commit

Permalink
[python] Support Python 3.12 (#2108)
Browse files Browse the repository at this point in the history
* [python] Probe Python 3.12

* more

* google search

* 3.7 too
  • Loading branch information
johnkerl authored and github-actions[bot] committed Feb 13, 2024
1 parent 74a9c9f commit 82e5f93
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
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

0 comments on commit 82e5f93

Please sign in to comment.