Apply suggestions from code review

Co-authored-by: Arthur Baars <aibaars@github.com>
This commit is contained in:
David Verdeguer 2020-10-08 11:59:35 +02:00 committed by GitHub
parent e97bdbdfac
commit 424a9cfa1c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -24,7 +24,7 @@ def _check_output(command):
def install_packages_with_poetry(): def install_packages_with_poetry():
if sys.platform.startswith('win32'): 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: try:
_check_call(['poetry', 'install', '--no-root']) _check_call(['poetry', 'install', '--no-root'])
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
@ -45,7 +45,7 @@ def install_packages_with_poetry():
def install_packages_with_pipenv(): def install_packages_with_pipenv():
if sys.platform.startswith('win32'): 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: try:
_check_call(['pipenv', 'install', '--keep-outdated', '--ignore-pipfile']) _check_call(['pipenv', 'install', '--keep-outdated', '--ignore-pipfile'])
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
@ -61,8 +61,8 @@ def install_packages_with_pipenv():
def _create_venv(version: int): def _create_venv(version: int):
# create temporary directory ... that just lives "forever" # create temporary directory ... that just lives "forever"
venv_path = os.environ['RUNNER_WORKSPACE']+'/codeql-action-python-autoinstall' venv_path = os.path.join(os.environ['RUNNER_WORKSPACE'], 'codeql-action-python-autoinstall')
print ("Creating venv in "+venv_path, flush = True) print ("Creating venv in " + venv_path, flush = True)
# virtualenv is a bit nicer for setting up virtual environment, since it will provide # 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 # up-to-date versions of pip/setuptools/wheel which basic `python3 -m venv venv` won't

View file

@ -188,7 +188,7 @@ export async function installPythonDeps(codeql: CodeQL, logger: Logger) {
if (process.platform === "darwin") { if (process.platform === "darwin") {
logger.info( logger.info(
"Currently, auto-installing python dependancies is not supported on MacOS" "Currently, auto-installing python dependencies is not supported on MacOS"
); );
logger.endGroup(); logger.endGroup();
return; return;