Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change ";" to os.pathsep #1188

Merged
merged 1 commit into from
Feb 1, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions features/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,8 @@ def _setup_context_with_venv(context, venv_dir):
# this is because exe resolution in subprocess doesn't respect a passed env
if os.name == "posix":
bin_dir = context.venv_dir / "bin"
path_sep = ":"
else:
bin_dir = context.venv_dir / "Scripts"
path_sep = ";"
context.bin_dir = bin_dir
context.pip = str(bin_dir / "pip")
context.python = str(bin_dir / "python")
Expand All @@ -63,11 +61,11 @@ def _setup_context_with_venv(context, venv_dir):

# clone the environment, remove any condas and venvs and insert our venv
context.env = os.environ.copy()
path = context.env["PATH"].split(path_sep)
path = context.env["PATH"].split(os.pathsep)
path = [p for p in path if not (Path(p).parent / "pyvenv.cfg").is_file()]
path = [p for p in path if not (Path(p).parent / "conda-meta").is_dir()]
path = [str(bin_dir)] + path
context.env["PATH"] = path_sep.join(path)
context.env["PATH"] = os.pathsep.join(path)

# Create an empty pip.conf file and point pip to it
pip_conf_path = context.venv_dir / "pip.conf"
Expand Down
2 changes: 1 addition & 1 deletion kedro/framework/startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def _add_src_to_path(source_dir: Path, project_path: Path) -> None:

python_path = os.getenv("PYTHONPATH") or ""
if str(source_dir) not in python_path:
sep = ";" if python_path else ""
sep = os.pathsep if python_path else ""
os.environ["PYTHONPATH"] = f"{str(source_dir)}{sep}{python_path}"


Expand Down