File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313# See the License for the specific language governing permissions and
1414# limitations under the License.
1515import importlib
16+ from pathlib import Path
1617import runpy
18+ import sys
1719from typing import List , Union
1820
1921from datacustomcode .config import config
@@ -31,7 +33,7 @@ def run_entrypoint(
3133 entrypoint: The entrypoint script to run.
3234 config_file: The config file to use.
3335 dependencies: The dependencies to import.
34- profile: The profile to use.
36+ profile: The credentials profile to use.
3537 """
3638 if profile != "default" :
3739 if config .reader_config and hasattr (config .reader_config , "options" ):
@@ -54,4 +56,13 @@ def run_entrypoint(
5456 raise exc
5557 except (ModuleNotFoundError , AttributeError ) as inner_exc :
5658 raise inner_exc from exc
59+ add_py_folder (entrypoint )
5760 runpy .run_path (entrypoint , init_globals = globals (), run_name = "__main__" )
61+
62+
63+ def add_py_folder (entrypoint : str ):
64+ default_py_folder = "py-files" # Hardcoded folder name
65+ cwd = Path .cwd ().joinpath (entrypoint )
66+ py_folder = cwd .parent .joinpath (default_py_folder )
67+
68+ sys .path .append (str (py_folder ))
You can’t perform that action at this time.
0 commit comments