Skip to content
Open
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
2 changes: 2 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.0
with:
fetch-depth: 0
- uses: astral-sh/setup-uv@v8.2.0
with:
python-version: "3.12"
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Store dataset properties as netCDF-safe individual attributes while keeping read compatibility with legacy `attrs["properties"]` dict/JSON data. [\#21](https://github.com/mlwp-tools/mxalign/pull/21) @observingClouds
- Added CI test workflow with first unit tests. [\#21](https://github.com/mlwp-tools/mxalign/pull/21) @observingClouds
- Added CI action for package build and upload to pypi.org on releases. [\#28](https://github.com/mlwp-tools/mxalign/pull/28) @leifdenby
- Package version is now derived from git tags via `setuptools-scm` (build backend switched from hatchling to setuptools) and exposed as `mxalign.__version__`. [\#49](https://github.com/mlwp-tools/mxalign/pull/49) @leifdenby

## [0.1.0](https://github.com/mlwp-tools/mxalign/releases/tag/v0.1.0)

Expand Down
14 changes: 11 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "mxalign"
version = "0.1.0"
dynamic = ["version"]
description = "Add your description here"
readme = "README.md"
authors = [
Expand Down Expand Up @@ -39,8 +39,16 @@ jobqueue = [
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
requires = ["setuptools>=69", "setuptools-scm>=8", "wheel"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
package-dir = {"" = "src"}

[tool.setuptools.packages.find]
where = ["src"]

[tool.setuptools_scm]

[dependency-groups]
dev = [
Expand Down
4 changes: 4 additions & 0 deletions src/mxalign/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from importlib.metadata import version

from .transformations.transform import transform
from .transformations.registry import available_transformations, register_transformation
from .interpolations.interpolate import interpolate
Expand All @@ -10,6 +12,7 @@
from . import interpolations

__all__ = [
"__version__",
"transform",
"available_transformations",
"register_transformation",
Expand All @@ -22,3 +25,4 @@
"transformations",
"interpolations",
]
__version__ = version("mxalign")
11 changes: 11 additions & 0 deletions tests/test_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import mxalign


def test_version_is_set() -> None:
"""Check that the package version is resolved from the git tag.

A fallback version of ``0.0.0`` means setuptools-scm could not find any
git metadata when the package was installed.
"""
assert isinstance(mxalign.__version__, str)
assert mxalign.__version__ not in ("", "0.0.0")
1 change: 0 additions & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading