zenml-nightly 0.74.0.dev20250212__py3-none-any.whl → 0.74.0.dev20250213__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.
zenml/VERSION CHANGED
@@ -1 +1 @@
1
- 0.74.0.dev20250212
1
+ 0.74.0.dev20250213
@@ -757,10 +757,16 @@ To avoid this consider setting pipeline parameters only in one place (config or
757
757
  build=build_model,
758
758
  can_download_from_code_repository=can_download_from_code_repository,
759
759
  ):
760
- code_archive = code_utils.CodeArchive(
761
- root=source_utils.get_source_root()
760
+ source_root = source_utils.get_source_root()
761
+ code_archive = code_utils.CodeArchive(root=source_root)
762
+ logger.info(
763
+ "Archiving pipeline code directory: `%s`. If this is taking "
764
+ "longer than you expected, make sure your source root "
765
+ "is set correctly by running `zenml init`, and that it "
766
+ "does not contain unnecessarily huge files.",
767
+ source_root,
762
768
  )
763
- logger.info("Archiving pipeline code...")
769
+
764
770
  code_path = code_utils.upload_code_if_necessary(code_archive)
765
771
 
766
772
  request = PipelineDeploymentRequest(
@@ -275,6 +275,35 @@ def resolve(
275
275
  )
276
276
 
277
277
 
278
+ def get_implicit_source_root() -> str:
279
+ """Get the implicit source root (the parent directory of the main module).
280
+
281
+ Raises:
282
+ RuntimeError: If the main module file can't be found.
283
+
284
+ Returns:
285
+ The implicit source root.
286
+ """
287
+ main_module = sys.modules.get("__main__")
288
+ if main_module is None:
289
+ raise RuntimeError(
290
+ "Unable to determine source root because the main module could not "
291
+ "be found."
292
+ )
293
+
294
+ if not hasattr(main_module, "__file__") or not main_module.__file__:
295
+ raise RuntimeError(
296
+ "Unable to determine source root because the main module does not "
297
+ "have an associated file. This could be because you're running in "
298
+ "an interactive Python environment. If you are trying to run from "
299
+ "within a Jupyter notebook, please run `zenml init` from the root "
300
+ "where your notebook is located and restart your notebook server."
301
+ )
302
+
303
+ path = Path(main_module.__file__).resolve().parent
304
+ return str(path)
305
+
306
+
278
307
  def get_source_root() -> str:
279
308
  """Get the source root.
280
309
 
@@ -286,9 +315,6 @@ def get_source_root() -> str:
286
315
 
287
316
  Returns:
288
317
  The source root.
289
-
290
- Raises:
291
- RuntimeError: If the main module file can't be found.
292
318
  """
293
319
  if _CUSTOM_SOURCE_ROOT:
294
320
  logger.debug("Using custom source root: %s", _CUSTOM_SOURCE_ROOT)
@@ -301,26 +327,12 @@ def get_source_root() -> str:
301
327
  logger.debug("Using repository root as source root: %s", repo_root)
302
328
  return str(repo_root.resolve())
303
329
 
304
- main_module = sys.modules.get("__main__")
305
- if main_module is None:
306
- raise RuntimeError(
307
- "Unable to determine source root because the main module could not "
308
- "be found."
309
- )
310
-
311
- if not hasattr(main_module, "__file__") or not main_module.__file__:
312
- raise RuntimeError(
313
- "Unable to determine source root because the main module does not "
314
- "have an associated file. This could be because you're running in "
315
- "an interactive Python environment. If you are trying to run from "
316
- "within a Jupyter notebook, please run `zenml init` from the root "
317
- "where your notebook is located and restart your notebook server. "
318
- )
319
-
320
- path = Path(main_module.__file__).resolve().parent
321
-
322
- logger.debug("Using main module parent directory as source root: %s", path)
323
- return str(path)
330
+ implicit_source_root = get_implicit_source_root()
331
+ logger.debug(
332
+ "Using main module parent directory as source root: %s",
333
+ implicit_source_root,
334
+ )
335
+ return implicit_source_root
324
336
 
325
337
 
326
338
  def set_custom_source_root(source_root: Optional[str]) -> None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: zenml-nightly
3
- Version: 0.74.0.dev20250212
3
+ Version: 0.74.0.dev20250213
4
4
  Summary: ZenML: Write production-ready ML code.
5
5
  License: Apache-2.0
6
6
  Keywords: machine learning,production,pipeline,mlops,devops
@@ -1,5 +1,5 @@
1
1
  zenml/README.md,sha256=827dekbOWAs1BpW7VF1a4d7EbwPbjwccX-2zdXBENZo,1777
2
- zenml/VERSION,sha256=UhG6I4o4NTBc6VFy231HJr7TSwPCzeLflYctAPsY-y8,19
2
+ zenml/VERSION,sha256=m5UFAlfM2bHdwaLw8Ttt42SvpS5yV6jrrfa_bMCNvyA,19
3
3
  zenml/__init__.py,sha256=SkMObQA41ajqdZqGErN00S1Vf3KAxpLvbZ-OBy5uYoo,2130
4
4
  zenml/actions/__init__.py,sha256=mrt6wPo73iKRxK754_NqsGyJ3buW7RnVeIGXr1xEw8Y,681
5
5
  zenml/actions/base_action.py,sha256=UcaHev6BTuLDwuswnyaPjdA8AgUqB5xPZ-lRtuvf2FU,25553
@@ -695,7 +695,7 @@ zenml/pipelines/__init__.py,sha256=hpIX7hN8jsQRHT5R-xSXZL88qrHwkmrvGLQeu1rWt4o,8
695
695
  zenml/pipelines/build_utils.py,sha256=DkID1YnRYkw569uU-gidpF8WR8E7K55_wn3CzRPQ3Cs,27562
696
696
  zenml/pipelines/pipeline_context.py,sha256=V_p-F9W7cBIlTjS0iv5-uJYMzaOj8bAUkc_uNhQgBms,3579
697
697
  zenml/pipelines/pipeline_decorator.py,sha256=FIbflYOMavbuyGmqsx3F5zZgg0oXMTi1eAcGXciljOs,4293
698
- zenml/pipelines/pipeline_definition.py,sha256=Pi4OGs7-WXbsm8_zczY5lpQEyLJPqkKZHjXAKfnk3HY,56936
698
+ zenml/pipelines/pipeline_definition.py,sha256=pl5tV4_h03MQDaIJZQCJJ8mY5S3Js-89r5NFIBpxB6A,57244
699
699
  zenml/pipelines/run_utils.py,sha256=4KuHIQFtLXTZNQBScTEkIG5pqNtu6xGm6UZT7ptyyKs,11623
700
700
  zenml/plugins/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
701
701
  zenml/plugins/base_plugin_flavor.py,sha256=88IxFW91UB_rQ8xPlfRnIhIJh7A308NEq2epMMdlOng,2530
@@ -787,7 +787,7 @@ zenml/utils/secret_utils.py,sha256=gEvqnhzAZwPO6mdOQWvioeH-xLoSObfaNRzt17N8zyU,5
787
787
  zenml/utils/settings_utils.py,sha256=lAK13CiDCDkcLygizDbWB9q-9ukteVBJPypzFCrne9k,4631
788
788
  zenml/utils/singleton.py,sha256=uFRrUlUdS5VyY9lLJyl_n5kqppsqJLKkBhSj4g5VPkY,2757
789
789
  zenml/utils/source_code_utils.py,sha256=8iyNA2MGIORYVEkSdxNTXfS1ZdFKXTAG1dZRkeQtPL0,3751
790
- zenml/utils/source_utils.py,sha256=ow3fbodjmAfpwmUXBSg3oyibHk065aSvi4UV9uJD6Yk,26736
790
+ zenml/utils/source_utils.py,sha256=joKLghhDq9dh0fd8B0WRGX-nN-uwnGQdgmsyY_n-8gY,27033
791
791
  zenml/utils/string_utils.py,sha256=VPuAwFzxwXXo1cKmBWxHnoeTyDX35XPf_lXGiDMXPEw,7254
792
792
  zenml/utils/time_utils.py,sha256=-9Y9zwJ-6Gv7hoZQCoftPyC2LCLo2bYj6OgdyBaE44o,4076
793
793
  zenml/utils/typed_model.py,sha256=00EAo1I1VnOBHG4-ce8dPkyHRPpgi67SRIU-KdewRWs,4757
@@ -1280,8 +1280,8 @@ zenml/zen_stores/secrets_stores/sql_secrets_store.py,sha256=nEO0bAPlULBLxLVk-UTR
1280
1280
  zenml/zen_stores/sql_zen_store.py,sha256=tKOghX2Wa0f0xSYu_ReqHgCwslvHrBhE3RePJG2tcA0,415921
1281
1281
  zenml/zen_stores/template_utils.py,sha256=EKYBgmDLTS_PSMWaIO5yvHPLiQvMqHcsAe6NUCrv-i4,9068
1282
1282
  zenml/zen_stores/zen_store_interface.py,sha256=vf2gKBWfUUPtcGZC35oQB6pPNVzWVyQC8nWxVLjfrxM,92692
1283
- zenml_nightly-0.74.0.dev20250212.dist-info/LICENSE,sha256=wbnfEnXnafPbqwANHkV6LUsPKOtdpsd-SNw37rogLtc,11359
1284
- zenml_nightly-0.74.0.dev20250212.dist-info/METADATA,sha256=FzxLNILSrBhOG7JLb1Gs6gaiP3LOibyLTJWhRHHKIUQ,21430
1285
- zenml_nightly-0.74.0.dev20250212.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
1286
- zenml_nightly-0.74.0.dev20250212.dist-info/entry_points.txt,sha256=QK3ETQE0YswAM2mWypNMOv8TLtr7EjnqAFq1br_jEFE,43
1287
- zenml_nightly-0.74.0.dev20250212.dist-info/RECORD,,
1283
+ zenml_nightly-0.74.0.dev20250213.dist-info/LICENSE,sha256=wbnfEnXnafPbqwANHkV6LUsPKOtdpsd-SNw37rogLtc,11359
1284
+ zenml_nightly-0.74.0.dev20250213.dist-info/METADATA,sha256=FfHRQAkvQcU-SpjOdUwnsKp1KURqE1eBLVm5L6Pd67M,21430
1285
+ zenml_nightly-0.74.0.dev20250213.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
1286
+ zenml_nightly-0.74.0.dev20250213.dist-info/entry_points.txt,sha256=QK3ETQE0YswAM2mWypNMOv8TLtr7EjnqAFq1br_jEFE,43
1287
+ zenml_nightly-0.74.0.dev20250213.dist-info/RECORD,,