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

Make version dynamic #25

Merged
merged 1 commit into from
Jan 21, 2025
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
12 changes: 12 additions & 0 deletions .github/workflows/python-tiledbsoma-ml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # for setuptools-scm

- uses: actions/setup-python@v5
with:
Expand All @@ -75,3 +77,13 @@ jobs:
run: |
pip install --upgrade build pip wheel setuptools setuptools-scm
python -m build .

- name: Install (and test version string)
run: |
git tag -l
git describe --dirty --tags --long --match *[0-9]*
python -m setuptools_scm
pip install --prefer-binary dist/tiledbsoma_ml-*.whl
pip list | grep tiledbsoma-ml
# Change directory to avoid importing local source package
cd .. && python -c "import tiledbsoma_ml as soma_ml; print(soma_ml.__version__)"
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools >= 61.0"]
requires = ["setuptools>=64", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"

[project]
Expand Down Expand Up @@ -50,8 +50,7 @@ Repository = "https://github.com/TileDB-Inc/TileDB-SOMA-ML.git"
Issues = "https://github.com/TileDB-Inc/TileDB-SOMA-ML/issues"
Changelog = "https://github.com/TileDB-Inc/TileDB-SOMA-ML/blob/main/CHANGELOG.md"

[tool.setuptools.dynamic]
version = {attr = "tiledbsoma_ml.__version__"}
[tool.setuptools_scm]

[tool.setuptools.package-data]
"tiledbsoma_ml" = ["py.typed"]
Expand Down
9 changes: 8 additions & 1 deletion src/tiledbsoma_ml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,18 @@

"""An API to support machine learning applications built on SOMA."""

from importlib.metadata import PackageNotFoundError, version

from .dataloader import experiment_dataloader
from .datapipe import ExperimentAxisQueryIterDataPipe
from .dataset import ExperimentAxisQueryIterableDataset

__version__ = "0.1.0-dev"
try:
__version__ = version("tiledbsoma-ml")
except PackageNotFoundError:
# package is not installed
pass


__all__ = [
"ExperimentAxisQueryIterDataPipe",
Expand Down
Loading