diff --git a/autoroot/autoroot/__init__.py b/autoroot/autoroot/__init__.py index dd77fb8..5b28be5 100644 --- a/autoroot/autoroot/__init__.py +++ b/autoroot/autoroot/__init__.py @@ -7,8 +7,12 @@ # this line finds the absolute path of the original python script that is being run startfile = os.path.abspath(sys.argv[0]) -# if we are in notebook or pytest, just use current working directory -if startfile.endswith("ipykernel_launcher.py") or startfile.endswith("pytest"): +# if we are in notebook, pytest, or ipython, just use current working directory +if ( + startfile.endswith("ipykernel_launcher.py") + or startfile.endswith("pytest") + or startfile.endswith("ipython") +): startfile = os.getcwd() # convert to Path object diff --git a/autorootcwd/autorootcwd/__init__.py b/autorootcwd/autorootcwd/__init__.py index 10e0990..6f5b778 100644 --- a/autorootcwd/autorootcwd/__init__.py +++ b/autorootcwd/autorootcwd/__init__.py @@ -7,8 +7,12 @@ # this line finds the absolute path of the original python script that is being run startfile = os.path.abspath(sys.argv[0]) -# if we are in notebook or pytest, just use current working directory -if startfile.endswith("ipykernel_launcher.py") or startfile.endswith("pytest"): +# if we are in notebook, pytest, or ipython, just use current working directory +if ( + startfile.endswith("ipykernel_launcher.py") + or startfile.endswith("pytest") + or startfile.endswith("ipython") +): startfile = os.getcwd() # convert to Path object