Skip to content

Commit b334bbc

Browse files
authored
Merge branch 'main' into input-value-type2
2 parents 5685e9f + a372769 commit b334bbc

File tree

7 files changed

+59
-2
lines changed

7 files changed

+59
-2
lines changed

.github/workflows/pypi.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ jobs:
2626
environment-file: binder/environment.yml
2727
- name: Build
2828
shell: bash -l {0}
29-
run: hatchling build -t sdist -t wheel
29+
run: |
30+
git update-index --assume-unchanged src/python_workflow_definition/_version.py
31+
hatchling build -t sdist -t wheel
3032
- name: Publish distribution 📦 to PyPI
3133
uses: pypa/gh-action-pypi-publish@release/v1

binder/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ dependencies:
55
- click =8.1.8
66
- pydantic =2.12.4
77
- hatchling =1.28.0
8+
- hatch-vcs =0.5.0
89
- httpcore =1.0.7
910
- jobflow =0.2.1
1011
- executorlib =1.7.4

pyproject.toml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "python_workflow_definition"
7-
version = "0.1.2"
87
description = "Python Workflow Definition - workflow interoperability for aiida, jobflow and pyiron"
98
authors = [
109
{ name = "Jan Janssen", email = "janssen@mpie.de" },
@@ -19,6 +18,7 @@ dependencies = [
1918
"numpy>=1.21",
2019
"pydantic>=2.7.0,<=2.12.4",
2120
]
21+
dynamic = ["version"]
2222

2323
[project.optional-dependencies]
2424
aiida = [
@@ -36,6 +36,28 @@ plot = [
3636
"ipython>=7.33.0,<=9.8.0",
3737
]
3838

39+
[tool.hatch.build]
40+
include = [
41+
"src/python_workflow_definition"
42+
]
43+
44+
[tool.hatch.build.hooks.vcs]
45+
version-file = "src/python_workflow_definition/_version.py"
46+
47+
[tool.hatch.build.targets.sdist]
48+
include = [
49+
"src/python_workflow_definition"
50+
]
51+
52+
[tool.hatch.build.targets.wheel]
53+
packages = [
54+
"src/python_workflow_definition"
55+
]
56+
57+
[tool.hatch.version]
58+
source = "vcs"
59+
path = "src/python_workflow_definition/_version.py"
60+
3961
[tool.coverage.run]
4062
source = ["python_workflow_definition"]
4163
command_line = "-m unittest discover tests"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import python_workflow_definition._version
2+
3+
__version__ = python_workflow_definition._version.__version__
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# file generated by setuptools-scm
2+
# don't change, don't track in version control
3+
4+
__all__ = ["__version__", "__version_tuple__", "version", "version_tuple"]
5+
6+
TYPE_CHECKING = False
7+
if TYPE_CHECKING:
8+
from typing import Tuple
9+
from typing import Union
10+
11+
VERSION_TUPLE = Tuple[Union[int, str], ...]
12+
else:
13+
VERSION_TUPLE = object
14+
15+
version: str
16+
__version__: str
17+
__version_tuple__: VERSION_TUPLE
18+
version_tuple: VERSION_TUPLE
19+
20+
__version__ = version = "0.0.1"
21+
__version_tuple__ = version_tuple = (0, 0, 1)

src/python_workflow_definition/models.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@
3434
)
3535

3636

37+
JsonPrimitive = Union[str, int, float, bool, None]
38+
AllowableDefaults = TypeAliasType(
39+
"AllowableDefaults",
40+
"Union[JsonPrimitive, dict[str, AllowableDefaults], list[AllowableDefaults]]",
41+
)
42+
43+
3744
class PythonWorkflowDefinitionBaseNode(BaseModel):
3845
"""Base model for all node types, containing common fields."""
3946

tests/test_models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from unittest import mock
55
from pydantic import ValidationError
66
from python_workflow_definition.models import (
7+
JsonPrimitive,
78
PythonWorkflowDefinitionInputNode,
89
PythonWorkflowDefinitionOutputNode,
910
PythonWorkflowDefinitionFunctionNode,

0 commit comments

Comments
 (0)