@@ -383,7 +383,23 @@ def _warn_on_ignored_manifest(directory):
383383 """
384384 if exists (join (directory , "manifest.json" )):
385385 click .secho (
386- " Warning: the existing manifest.json file will not be used or considered." , fg = "yellow" ,
386+ " Warning: the existing manifest.json file will not be used or considered." ,
387+ fg = "yellow" ,
388+ )
389+
390+
391+ def _warn_if_no_requirements_file (directory ):
392+ """
393+ Checks for the existence of a file called requirements.txt in the given directory.
394+ If it's not there, a warning will be printed.
395+
396+ :param directory: the directory to check in.
397+ """
398+ if not exists (join (directory , "requirements.txt" )):
399+ click .secho (
400+ " Warning: Capturing the environment using 'pip freeze'.\n "
401+ " Consider creating a requirements.txt file instead." ,
402+ fg = "yellow" ,
387403 )
388404
389405
@@ -560,6 +576,7 @@ def deploy_notebook(
560576 click .secho (' Deploying %s to server "%s"' % (file , connect_server .url ))
561577
562578 _warn_on_ignored_manifest (dirname (file ))
579+ _warn_if_no_requirements_file (dirname (file ))
563580
564581 with cli_feedback ("Inspecting Python environment" ):
565582 python , environment = get_python_env_info (file , python , conda , force_generate )
@@ -863,6 +880,7 @@ def _deploy_by_framework(
863880 click .secho (' Deploying %s to server "%s"' % (directory , connect_server .url ))
864881
865882 _warn_on_ignored_manifest (directory )
883+ _warn_if_no_requirements_file (directory )
866884
867885 with cli_feedback ("Inspecting Python environment" ):
868886 _ , environment = get_python_env_info (module_file , python , conda , force_generate )
0 commit comments