mlrun 1.5.0rc23__py3-none-any.whl → 1.5.1rc2__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.

Potentially problematic release.


This version of mlrun might be problematic. Click here for more details.

mlrun/model.py CHANGED
@@ -423,7 +423,7 @@ class ImageBuilder(ModelObj):
423
423
  self.base_image = base_image
424
424
  if commands:
425
425
  self.with_commands(commands, overwrite=overwrite)
426
- if requirements:
426
+ if requirements or requirements_file:
427
427
  self.with_requirements(requirements, requirements_file, overwrite=overwrite)
428
428
  if extra:
429
429
  self.extra = extra
@@ -471,7 +471,7 @@ class ImageBuilder(ModelObj):
471
471
 
472
472
  def with_requirements(
473
473
  self,
474
- requirements: Union[str, List[str]],
474
+ requirements: Optional[Union[str, List[str]]] = None,
475
475
  requirements_file: str = "",
476
476
  overwrite: bool = False,
477
477
  ):
@@ -483,6 +483,7 @@ class ImageBuilder(ModelObj):
483
483
  when False (default) will append to existing requirements
484
484
  :return: function object
485
485
  """
486
+ requirements = requirements or []
486
487
  if isinstance(requirements, str) and mlrun.utils.is_file_path(requirements):
487
488
  # TODO: remove in 1.6.0
488
489
  warnings.warn(
@@ -507,6 +508,7 @@ class ImageBuilder(ModelObj):
507
508
  def _resolve_requirements(
508
509
  requirements: typing.Union[str, list], requirements_file: str = ""
509
510
  ) -> list:
511
+ requirements = requirements or []
510
512
  requirements_to_resolve = []
511
513
 
512
514
  # handle the requirements_file argument
@@ -280,8 +280,8 @@ def build_function(
280
280
  if engine == "kfp":
281
281
  if overwrite_build_params:
282
282
  function.spec.build.commands = None
283
- if requirements:
284
- function.with_requirements(requirements, requirements_file)
283
+ if requirements or requirements_file:
284
+ function.with_requirements(requirements, requirements_file, overwrite=True)
285
285
  if commands:
286
286
  function.with_commands(commands)
287
287
  return function.deploy_step(
mlrun/projects/project.py CHANGED
@@ -2002,6 +2002,7 @@ class MlrunProject(ModelObj):
2002
2002
  "with_repo": with_repo,
2003
2003
  "tag": tag,
2004
2004
  "requirements": requirements,
2005
+ "requirements_file": requirements_file,
2005
2006
  }
2006
2007
  func = {k: v for k, v in function_dict.items() if v}
2007
2008
  resolved_function_name, function_object = _init_function_from_dict(
@@ -2022,9 +2023,9 @@ class MlrunProject(ModelObj):
2022
2023
  if with_repo:
2023
2024
  # mark source to be enriched before run with project source (enrich_function_object)
2024
2025
  function_object.spec.build.source = "./"
2025
- if requirements:
2026
+ if requirements or requirements_file:
2026
2027
  function_object.with_requirements(
2027
- requirements, requirements_file=requirements_file
2028
+ requirements, requirements_file=requirements_file, overwrite=True
2028
2029
  )
2029
2030
  if not resolved_function_name:
2030
2031
  raise ValueError("Function name must be specified")
@@ -3321,6 +3322,7 @@ def _init_function_from_dict(
3321
3322
  handler = f.get("handler", None)
3322
3323
  with_repo = f.get("with_repo", False)
3323
3324
  requirements = f.get("requirements", None)
3325
+ requirements_file = f.get("requirements_file", None)
3324
3326
  tag = f.get("tag", None)
3325
3327
 
3326
3328
  has_module = _has_module(handler, kind)
@@ -3383,8 +3385,12 @@ def _init_function_from_dict(
3383
3385
  if with_repo:
3384
3386
  # mark source to be enriched before run with project source (enrich_function_object)
3385
3387
  func.spec.build.source = "./"
3386
- if requirements:
3387
- func.with_requirements(requirements)
3388
+ if requirements or requirements_file:
3389
+ func.with_requirements(
3390
+ requirements=requirements,
3391
+ requirements_file=requirements_file,
3392
+ overwrite=True,
3393
+ )
3388
3394
 
3389
3395
  return _init_function_from_obj(func, project)
3390
3396
 
mlrun/run.py CHANGED
@@ -667,7 +667,7 @@ def new_function(
667
667
  else:
668
668
  runner.spec.default_handler = handler
669
669
 
670
- if requirements:
670
+ if requirements or requirements_file:
671
671
  runner.with_requirements(
672
672
  requirements,
673
673
  requirements_file=requirements_file,
@@ -821,7 +821,7 @@ def code_to_function(
821
821
  fn.spec.build.commands = get_in(spec, "spec.build.commands")
822
822
  fn.spec.build.secret = get_in(spec, "spec.build.secret")
823
823
 
824
- if requirements:
824
+ if requirements or requirements_file:
825
825
  fn.with_requirements(requirements, requirements_file=requirements_file)
826
826
 
827
827
  if embed_code:
mlrun/runtimes/base.py CHANGED
@@ -792,7 +792,7 @@ class BaseRuntime(ModelObj):
792
792
 
793
793
  def with_requirements(
794
794
  self,
795
- requirements: Union[str, List[str]],
795
+ requirements: Optional[Union[str, List[str]]] = None,
796
796
  overwrite: bool = False,
797
797
  verify_base_image: bool = False,
798
798
  prepare_image_for_deploy: bool = True,
@@ -1,4 +1,4 @@
1
1
  {
2
- "git_commit": "eda0f94564d928ba33eaba02436bb367110a75b3",
3
- "version": "1.5.0-rc23"
2
+ "git_commit": "49dc443de0204565aa7823c76a55cfc29fe63189",
3
+ "version": "1.5.1-rc2"
4
4
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mlrun
3
- Version: 1.5.0rc23
3
+ Version: 1.5.1rc2
4
4
  Summary: Tracking and config of machine learning runs
5
5
  Home-page: https://github.com/mlrun/mlrun
6
6
  Author: Yaron Haviv
@@ -7,9 +7,9 @@ mlrun/features.py,sha256=UQQ2uh5Xh9XsMGiYBqh3bKgDhOHANjv1gQgWyId9qQE,15624
7
7
  mlrun/k8s_utils.py,sha256=UJTo0uHTphDi-o305l7R-oeyDfqVVfoYbk0EW6cm38Q,5382
8
8
  mlrun/kfpops.py,sha256=Aqp0r43jpBFf1IJ-h_ZV1UvL0udxw3z1_pWKyFY61ZI,29860
9
9
  mlrun/lists.py,sha256=XFv87TKpfdkah_KFoOVUHNxoouOT2sS306aZnGO4nKQ,8779
10
- mlrun/model.py,sha256=J8WV70QRExOhq_CxB5CcJE_3mqqc4IMyE2GR-0iFEgs,62820
10
+ mlrun/model.py,sha256=A6thnspZpv31h7LEAOc0Ljg7dwZ1xQ1eTNloeTl2w20,62942
11
11
  mlrun/render.py,sha256=a_s-kzQ35bJg7e7cBxk3MCnoIK4qvDS2dGO8RzHgI1c,13016
12
- mlrun/run.py,sha256=X1oy0p-7eA-TLQtm4LhSHHc0GxSaABuRbPjVuY58cN4,47807
12
+ mlrun/run.py,sha256=MyKt9nAizLr3xXCPZoQmeRu2ZJCgkmTPROu8XJ73IR4,47849
13
13
  mlrun/secrets.py,sha256=hr2Ia9kLkoMM3KoxijXqO6AIJOUrrLxvz4Q7Xk39d4Y,7783
14
14
  mlrun/api/__init__.py,sha256=xY3wHC4TEJgez7qtnn1pQvHosi8-5UJOCtyGBS7FcGE,571
15
15
  mlrun/api/alembic.ini,sha256=oeSJRHwBbF3c3-N_RJilcZD-diq3F-oPv21gDIkrZGs,2105
@@ -408,11 +408,11 @@ mlrun/platforms/__init__.py,sha256=ArWn_iZiEE6qz7hvY_1RqMkFnHGuKjP3k5xYKnfKA58,2
408
408
  mlrun/platforms/iguazio.py,sha256=LU1d33ll5EKIyp2zitCffZIbq-3fRwNSNO9MK2cIsHc,21729
409
409
  mlrun/platforms/other.py,sha256=z4pWqxXkVVuMLk-MbNb0Y_ZR5pmIsUm0R8vHnqpEnew,11852
410
410
  mlrun/projects/__init__.py,sha256=Lv5rfxyXJrw6WGOWJKhBz66M6t3_zsNMCfUD6waPwx4,1153
411
- mlrun/projects/operations.py,sha256=Fot74eIimCWb1DflMcp5gl8kG3li-A783Lp2xhziu80,18122
411
+ mlrun/projects/operations.py,sha256=H-YYZezd4nP6sI8ffRCX6DNr2l4G9z6knkAfP5A6N2o,18159
412
412
  mlrun/projects/pipelines.py,sha256=8jCk6gyVNgUJK-J6R4bRPM3TZo-4sUil5cJMxocRNeA,36895
413
- mlrun/projects/project.py,sha256=P11VYOYntNZgUE6jxwULoT5N_VhJ3O-vcP8_BrcF0LY,138181
413
+ mlrun/projects/project.py,sha256=JaEZhBDEA5sjhIXrS9bglcM_0k6PEk0AePZrLBpmLZA,138465
414
414
  mlrun/runtimes/__init__.py,sha256=OuwnzCoaoXnqAv_RhoYRF6mRPfZ2pkslenxASpXhHQM,6707
415
- mlrun/runtimes/base.py,sha256=Xv5qOlb070_eU1H5IGpc_TY5p1uBlh-ghz8kSVKu6z0,38097
415
+ mlrun/runtimes/base.py,sha256=8frflsMi-gAs4t3ndUFVqCRVJLyW2vqsYYAhigGh7lo,38114
416
416
  mlrun/runtimes/constants.py,sha256=TnkD0nQ7pcFq1aJvbweoM4BgbkhaA6fHhg9rnAkxDBE,6689
417
417
  mlrun/runtimes/daskjob.py,sha256=LgA4Y1gcNUHvRz0YlFT-mfEfzn8-yPD5Y1MCF2HPgFk,16226
418
418
  mlrun/runtimes/funcdoc.py,sha256=UGMHyhu9NGdD3iKotdfbFj6J-KlR1hxkwjjpiZPMs4E,10268
@@ -470,11 +470,11 @@ mlrun/utils/notifications/notification/ipython.py,sha256=qrBmtECiRG6sZpCIVMg7RZc
470
470
  mlrun/utils/notifications/notification/slack.py,sha256=5JysqIpUYUZKXPSeeZtbl7qb2L9dj7p2NvnEBcEsZkA,3898
471
471
  mlrun/utils/notifications/notification/webhook.py,sha256=QHezCuN5uXkLcroAGxGrhGHaxAdUvkDLIsp27_Yrfd4,2390
472
472
  mlrun/utils/version/__init__.py,sha256=7kkrB7hEZ3cLXoWj1kPoDwo4MaswsI2JVOBpbKgPAgc,614
473
- mlrun/utils/version/version.json,sha256=Grz9O6E01_0aanPq_eoMyc4_Kk-x0vUdHZ88RIe9BkY,89
473
+ mlrun/utils/version/version.json,sha256=TbEmWFNDKCtb0cQcNzva4DHtourhHTcAHOySJlWIzOA,88
474
474
  mlrun/utils/version/version.py,sha256=HMwseV8xjTQ__6T6yUWojx_z6yUj7Io7O4NcCCH_sz8,1970
475
- mlrun-1.5.0rc23.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
476
- mlrun-1.5.0rc23.dist-info/METADATA,sha256=TZS8XvcYwhV6VUr5QKEwfNnQrKoP-uhC3verGzg5gLM,17826
477
- mlrun-1.5.0rc23.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
478
- mlrun-1.5.0rc23.dist-info/entry_points.txt,sha256=ZbXmb36B9JmK7EaleP8MIAbZSOQXQV0iwKR6si0HUWk,47
479
- mlrun-1.5.0rc23.dist-info/top_level.txt,sha256=NObLzw3maSF9wVrgSeYBv-fgnHkAJ1kEkh12DLdd5KM,6
480
- mlrun-1.5.0rc23.dist-info/RECORD,,
475
+ mlrun-1.5.1rc2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
476
+ mlrun-1.5.1rc2.dist-info/METADATA,sha256=sHSvnEX2aOMyy9cd4agZbomHpAH7FVsFit6aup4iVAs,17825
477
+ mlrun-1.5.1rc2.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
478
+ mlrun-1.5.1rc2.dist-info/entry_points.txt,sha256=ZbXmb36B9JmK7EaleP8MIAbZSOQXQV0iwKR6si0HUWk,47
479
+ mlrun-1.5.1rc2.dist-info/top_level.txt,sha256=NObLzw3maSF9wVrgSeYBv-fgnHkAJ1kEkh12DLdd5KM,6
480
+ mlrun-1.5.1rc2.dist-info/RECORD,,