deriva-ml 1.17.3__py3-none-any.whl → 1.17.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -254,6 +254,7 @@ class Execution:
254
254
 
255
255
  # Make sure we have a good workflow.
256
256
  if isinstance(self.configuration.workflow, Workflow):
257
+ self._ml_object.lookup_term(MLVocab.workflow_type, configuration.workflow.workflow_type)
257
258
  self.workflow_rid = (
258
259
  self._ml_object.add_workflow(self.configuration.workflow) if not self._dry_run else DRY_RUN_RID
259
260
  )
@@ -22,14 +22,13 @@ Typical usage example:
22
22
 
23
23
  from __future__ import annotations
24
24
 
25
- from dataclasses import dataclass
26
25
  import json
27
26
  import sys
27
+ from dataclasses import dataclass
28
28
  from pathlib import Path
29
- from typing import Any
30
29
 
31
30
  from hydra_zen import builds
32
- from pydantic import BaseModel, ConfigDict, Field, field_validator
31
+ from pydantic import BaseModel, ConfigDict, Field
33
32
 
34
33
  from deriva_ml.core.definitions import RID
35
34
  from deriva_ml.dataset.aux_classes import DatasetSpec
@@ -74,26 +73,13 @@ class ExecutionConfiguration(BaseModel):
74
73
 
75
74
  model_config = ConfigDict(arbitrary_types_allowed=True)
76
75
 
77
- # @field_validator("datasets", mode="before")
78
- # @classmethod
79
- # def validate_datasets(cls, value: Any) -> Any:
80
- # if isinstance(value, DatasetList):
81
- # config_list: DatasetList = value
82
- # value = config_list.datasets
83
- # return value
84
-
85
- @field_validator("workflow", mode="before")
86
- @classmethod
87
- def validate_workflow(cls, value: Any) -> Any:
88
- """Validates workflow specification.
89
-
90
- Args:
91
- value: Workflow value to validate (RID or Workflow object).
92
-
93
- Returns:
94
- RID | Workflow: Validated workflow specification.
95
- """
96
- return value
76
+ # @field_validator("datasets", mode="before")
77
+ # @classmethod
78
+ # def validate_datasets(cls, value: Any) -> Any:
79
+ # if isinstance(value, DatasetList):
80
+ # config_list: DatasetList = value
81
+ # value = config_list.datasets
82
+ # return value
97
83
 
98
84
  @staticmethod
99
85
  def load_configuration(path: Path) -> ExecutionConfiguration:
@@ -151,8 +137,5 @@ class AssetRID(str):
151
137
  obj.description = description
152
138
  return obj
153
139
 
154
- AssetRIDConfig = builds(AssetRID, populate_full_signature=True)
155
-
156
-
157
-
158
140
 
141
+ AssetRIDConfig = builds(AssetRID, populate_full_signature=True)
@@ -9,7 +9,6 @@ from typing import Any
9
9
  import requests
10
10
  from pydantic import BaseModel, PrivateAttr, model_validator
11
11
  from requests import RequestException
12
- from setuptools_scm import get_version
13
12
 
14
13
  from deriva_ml.core.definitions import RID
15
14
  from deriva_ml.core.exceptions import DerivaMLException
@@ -130,12 +129,7 @@ class Workflow(BaseModel):
130
129
  self.url, self.checksum = Workflow.get_url_and_checksum(path)
131
130
  self.git_root = Workflow._get_git_root(path)
132
131
 
133
- self.version = get_version(
134
- root=str(self.git_root or Path.cwd()),
135
- search_parent_directories=True,
136
- # Optional but recommended: provide a safe fallback when tags are absent
137
- fallback_version="0.0",
138
- )
132
+ self.version = Workflow.get_dynamic_version(root=str(self.git_root or Path.cwd()))
139
133
 
140
134
  self._logger = logging.getLogger("deriva_ml")
141
135
  return self
@@ -389,3 +383,22 @@ class Workflow(BaseModel):
389
383
  sha = result.stdout.strip()
390
384
  url = f"{github_url}/blob/{sha}/{executable_path.relative_to(repo_root)}"
391
385
  return url, is_dirty
386
+
387
+ @staticmethod
388
+ def get_dynamic_version(root: str | os.PathLike | None = None) -> str:
389
+ """
390
+ Return a dynamic version string based on VCS state (setuptools_scm),
391
+ including dirty/uncommitted changes if configured.
392
+
393
+ Works under uv / Python 3.10+ by forcing setuptools to use stdlib distutils.
394
+ """
395
+ # Ensure setuptools doesn't try to override stdlib distutils
396
+ os.environ.setdefault("SETUPTOOLS_USE_DISTUTILS", "stdlib")
397
+
398
+ from setuptools_scm import get_version # imported *after* env var is set
399
+
400
+ if root is None:
401
+ # Adjust this to point at your repo root if needed
402
+ root = Path(__file__).resolve().parents[1]
403
+
404
+ return get_version(root=root)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deriva-ml
3
- Version: 1.17.3
3
+ Version: 1.17.4
4
4
  Summary: Utilities to simplify use of Dervia and Pandas to create reproducable ML pipelines
5
5
  Author-email: ISRD <isrd-dev@isi.edu>
6
6
  Requires-Python: >=3.10
@@ -23,9 +23,9 @@ deriva_ml/dataset/history.py,sha256=FK5AYYz11p4E4FWMVg4r7UPWOD4eobrq3b3xMjWF59g,
23
23
  deriva_ml/dataset/upload.py,sha256=n1aXSbOx1hghCDxuF8yf03jZmOLMueXL-rSnQMrfHq0,16535
24
24
  deriva_ml/execution/__init__.py,sha256=5kKpPwQbxhmRn7Npz7DpavuCxYwCQaDdl4-6z62hbds,705
25
25
  deriva_ml/execution/environment.py,sha256=B7nywqxFTRUWgyu8n7rFoKcVC9on422kjeFG2FPQfvg,9302
26
- deriva_ml/execution/execution.py,sha256=Gwrj2ICOH6ZsysM1aHCofBD_AwPgqjDemffHzY300tg,46210
27
- deriva_ml/execution/execution_configuration.py,sha256=RT0x9n0uyJgEsrLCUTu16nAUJN7X-XLDvfezln0PTDQ,5775
28
- deriva_ml/execution/workflow.py,sha256=rTlspICp2Q6prUwPCeukjhO64rbcJivcFs4zH60B16U,13906
26
+ deriva_ml/execution/execution.py,sha256=pso488INQ9eZx_VO6XHv4N6e3CwclOtgTEDE-qyGnNg,46311
27
+ deriva_ml/execution/execution_configuration.py,sha256=lftW9tAzpCiQw83vLT0IG5JjlL4K6Q-qHjkhVquh8-E,5384
28
+ deriva_ml/execution/workflow.py,sha256=80mFNRd-4H_DOJUT00aO4k9OFYSj1UOQBJTGm_kTlf8,14439
29
29
  deriva_ml/model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
30
  deriva_ml/model/catalog.py,sha256=O6_Ll4Uxg6DyxoBXT9P9CPTt9jx1guVTeX1L3KW1A5c,19645
31
31
  deriva_ml/model/database.py,sha256=BG5FSisl9tWTBnf5k9dNnijOIDyCUDeRhN_inkmIqTw,31132
@@ -37,9 +37,9 @@ deriva_ml/schema/create_schema.py,sha256=9qK9_8SRQT-DwcEwTGSkhi3j2NaoH5EVgthvV2k
37
37
  deriva_ml/schema/deriva-ml-reference.json,sha256=AEOMIgwKO3dNMMWHb0lxaXyamvfAEbUPh8qw0aAtsUQ,242460
38
38
  deriva_ml/schema/policy.json,sha256=5ykB8nnZFl-oCHzlAwppCFKJHWJFIkYognUMVEanfY8,1826
39
39
  deriva_ml/schema/table_comments_utils.py,sha256=4flCqnZAaqg_uSZ9I18pNUWAZoLfmMCXbmI5uERY5vM,2007
40
- deriva_ml-1.17.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
41
- deriva_ml-1.17.3.dist-info/METADATA,sha256=_-xDLOnjctq5V0U60iduW-vrjo5j4pGaAsY0eyEUQX8,1272
42
- deriva_ml-1.17.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
43
- deriva_ml-1.17.3.dist-info/entry_points.txt,sha256=XsHSbfp7S1cKMjHoPUdFIaFcp9lHXHS6CV1zb_MEXkg,463
44
- deriva_ml-1.17.3.dist-info/top_level.txt,sha256=I1Q1dkH96cRghdsFRVqwpa2M7IqJpR2QPUNNc5-Bnpw,10
45
- deriva_ml-1.17.3.dist-info/RECORD,,
40
+ deriva_ml-1.17.4.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
41
+ deriva_ml-1.17.4.dist-info/METADATA,sha256=rCfFB1SBVMXGd4aNxpgelYzZQjyxg6HnB4idrmV3tKo,1272
42
+ deriva_ml-1.17.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
43
+ deriva_ml-1.17.4.dist-info/entry_points.txt,sha256=XsHSbfp7S1cKMjHoPUdFIaFcp9lHXHS6CV1zb_MEXkg,463
44
+ deriva_ml-1.17.4.dist-info/top_level.txt,sha256=I1Q1dkH96cRghdsFRVqwpa2M7IqJpR2QPUNNc5-Bnpw,10
45
+ deriva_ml-1.17.4.dist-info/RECORD,,