From 424a9cfa1caa6b7dd592aae0290a168eaec152cf Mon Sep 17 00:00:00 2001 From: David Verdeguer <47184891+Daverlo@users.noreply.github.com> Date: Thu, 8 Oct 2020 11:59:35 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Arthur Baars <aibaars@github.com> --- python-setup/auto_install_packages.py | 8 ++++---- src/init.ts | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python-setup/auto_install_packages.py b/python-setup/auto_install_packages.py index ffc795592..fc276431d 100755 --- a/python-setup/auto_install_packages.py +++ b/python-setup/auto_install_packages.py @@ -24,7 +24,7 @@ def _check_output(command): def install_packages_with_poetry(): if sys.platform.startswith('win32'): - os.environ['POETRY_VIRTUALENVS_PATH'] = os.environ['RUNNER_WORKSPACE'] + '\\virtualenvs' + os.environ['POETRY_VIRTUALENVS_PATH'] = os.path.join(os.environ['RUNNER_WORKSPACE', 'virtualenvs') try: _check_call(['poetry', 'install', '--no-root']) except subprocess.CalledProcessError: @@ -45,7 +45,7 @@ def install_packages_with_poetry(): def install_packages_with_pipenv(): if sys.platform.startswith('win32'): - os.environ['WORKON_HOME'] = os.environ['RUNNER_WORKSPACE'] + '\\virtualenvs' + os.environ['WORKON_HOME'] = os.path.join(os.environ['RUNNER_WORKSPACE'], 'virtualenvs') try: _check_call(['pipenv', 'install', '--keep-outdated', '--ignore-pipfile']) except subprocess.CalledProcessError: @@ -61,8 +61,8 @@ def install_packages_with_pipenv(): def _create_venv(version: int): # create temporary directory ... that just lives "forever" - venv_path = os.environ['RUNNER_WORKSPACE']+'/codeql-action-python-autoinstall' - print ("Creating venv in "+venv_path, flush = True) + venv_path = os.path.join(os.environ['RUNNER_WORKSPACE'], 'codeql-action-python-autoinstall') + print ("Creating venv in " + venv_path, flush = True) # virtualenv is a bit nicer for setting up virtual environment, since it will provide # up-to-date versions of pip/setuptools/wheel which basic `python3 -m venv venv` won't diff --git a/src/init.ts b/src/init.ts index d9af96d6c..1379e7336 100644 --- a/src/init.ts +++ b/src/init.ts @@ -188,7 +188,7 @@ export async function installPythonDeps(codeql: CodeQL, logger: Logger) { if (process.platform === "darwin") { logger.info( - "Currently, auto-installing python dependancies is not supported on MacOS" + "Currently, auto-installing python dependencies is not supported on MacOS" ); logger.endGroup(); return;