Skip to content

Commit

Permalink
Merge pull request #1274 from thewtex/itkwasm-pixi
Browse files Browse the repository at this point in the history
itkwasm pixi
  • Loading branch information
thewtex authored Nov 16, 2024
2 parents b166aa3 + 6200c8e commit 0b21e7c
Show file tree
Hide file tree
Showing 8 changed files with 4,617 additions and 3,257 deletions.
2 changes: 2 additions & 0 deletions packages/core/python/itkwasm/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# GitHub syntax highlighting
pixi.lock linguist-language=YAML linguist-generated=true
5 changes: 5 additions & 0 deletions packages/core/python/itkwasm/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
dist/
pyodide/

# pixi environments
.pixi
*.egg-info
5 changes: 3 additions & 2 deletions packages/core/python/itkwasm/itkwasm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
"""itkwasm: Python interface to itk-wasm WebAssembly modules."""

__version__ = "1.0b179"
__version__ = "1.0b180"

from .interface_types import InterfaceTypes
from .image import Image, ImageType, ImageRegion
from .point_set import PointSet, PointSetType
from .mesh import Mesh, MeshType
from .transform import Transform, TransformType, TransformParameterizations
from .transform import TransformList, Transform, TransformType, TransformParameterizations
from .polydata import PolyData, PolyDataType
from .binary_file import BinaryFile
from .binary_stream import BinaryStream
Expand Down Expand Up @@ -43,6 +43,7 @@
"MeshType",
"PolyData",
"PolyDataType",
"TransformList",
"Transform",
"TransformType",
"TransformParameterizations",
Expand Down
6 changes: 4 additions & 2 deletions packages/core/python/itkwasm/itkwasm/transform.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from dataclasses import dataclass, field
from enum import Enum
from typing import Sequence, Union, Dict, Optional
from typing import Sequence, Union, Dict, Optional, List

try:
from numpy.typing import ArrayLike
Expand Down Expand Up @@ -62,4 +62,6 @@ class Transform:

def __post_init__(self):
if isinstance(self.transformType, dict):
self.transformType = TransformType(**self.transformType)
self.transformType = TransformType(**self.transformType)

TransformList = List[Transform]
4,260 changes: 4,260 additions & 0 deletions packages/core/python/itkwasm/pixi.lock

Large diffs are not rendered by default.

70 changes: 45 additions & 25 deletions packages/core/python/itkwasm/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ classifiers = [
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
]
keywords = [
"itk",
Expand All @@ -28,44 +28,64 @@ keywords = [
]
dynamic = ["version"]

requires-python = ">=3.8"
requires-python = ">=3.9"
dependencies = [
"numpy",
"typing_extensions",
"platformdirs; sys_platform != \"emscripten\"",
"wasmtime >= 13.0.2; sys_platform != \"emscripten\"",
"importlib_metadata; python_version < \"3.10\"",
"importlib_metadata; python_version < \"3.10\"", "dask[array]>=2024.11.2,<2025",
]

[project.urls]
Home = "https://itkwasm.readthedocs.io"
Source = "https://github.com/InsightSoftwareConsortium/ITK-Wasm"
Issues = "https://github.com/InsightSoftwareConsortium/ITK-Wasm/issues"

[tool.hatch.envs.default]
dependencies = [
"itk>=5.4.0",
"pytest >=2.7.3",
"pytest-pyodide",
"pyodide-py",
"dask[array]",
"test_accelerator @ {root:uri}/test/test-accelerator",
]

[tool.hatch.envs.default.scripts]
test = [
"hatch build -t wheel",
"pytest --dist-dir=./dist --rt=chrome",
]
download-pyodide = [
"curl -L https://github.com/pyodide/pyodide/releases/download/0.26.2/pyodide-0.26.2.tar.bz2 -o pyodide.tar.bz2",
"tar xjf pyodide.tar.bz2",
"rm -rf dist pyodide.tar.bz2",
"mv pyodide dist",
]

[tool.hatch.version]
path = "itkwasm/__init__.py"

[tool.black]
line-length = 120

[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["win-64", "linux-64", "linux-aarch64", "osx-arm64"]

[tool.pixi.dependencies]
python = "3.13.*"
hatch = ">=1.13.0,<2"
pip = ">=24.2,<25"
pytest = ">=8.3.3,<9"

[tool.pixi.pypi-dependencies]
itkwasm = { path = ".", editable = true }
pyodide-py = ">=0.26.3, <0.27"
pytest-pyodide = ">=0.58.3, <0.59"
itk = ">=5.4.0"
test_accelerator = { path = "test/test-accelerator", editable = true }

[tool.pixi.tasks.build]
cmd = "hatch build"
description = "Build package wheels"

[tool.pixi.tasks.download-pyodide]
cmd = '''curl -L https://github.com/pyodide/pyodide/releases/download/0.26.3/pyodide-0.26.3.tar.bz2 -o pyodide.tar.bz2 &&
tar xjf pyodide.tar.bz2 &&
rm pyodide.tar.bz2'''
outputs = ["pyodide"]
description = "Download Pyodide"

[tool.pixi.tasks.test]
cmd = '''mkdir -p dist/pyodide &&
cp -r pyodide dist/ &&
hatch build -t wheel ./dist/pyodide/ &&
pytest --dist-dir=./dist/pyodide --rt=chrome'''
depends-on = ["download-pyodide"]
description = "Run tests"

[tool.pixi.tasks.publish]
cmd = '''rm -rf dist &&
hatch build &&
hatch publish'''
description = "Publish package wheels"
3,524 changes: 297 additions & 3,227 deletions packages/transform-io/pixi.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/transform-io/pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pillow = ">=10.4.0,<12"
pyodide-py = ">=0.26.3, <0.27"
pytest-pyodide = ">=0.58.3, <0.59"
itk-webassemblyinterface = ">=1.0b175, <2"
itkwasm = ">=1.0b179, <2"
itkwasm = ">=1.0b180, <2"

[feature.python.tasks.test-wasi]
cmd = "pytest"
Expand Down

0 comments on commit 0b21e7c

Please sign in to comment.