Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test Python Package Installation on Linux
name: Test Python Package Installation on Linux and Mac
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we move the windows job here too? So that we have all these workflows in one place?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows jobs are completely different, I prefer to have them separated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize my comment might have been ambiguous. Ok if you prefer to keep it separate, but let me clarify below.

I am suggesting you copy the job from the python-deps-windows.yml workflow file into this workflow file, not that you combine the jobs directly, as indeed they are very different. You would still have one job for both linux and mac, and one job for windows (e.g., test-setup-python-scripts and test-setup-python-scripts-win). However, since they both test the python dependencies, I would have put them in the same file.


on:
push:
Expand All @@ -8,10 +8,11 @@ on:
jobs:

test-setup-python-scripts:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
include:
- test_dir: python-setup/tests/pipenv/requests-2
test_script: $GITHUB_WORKSPACE/python-setup/tests/check_requests_123.sh 2
Expand Down Expand Up @@ -50,14 +51,23 @@ jobs:
run: |
set -x
$GITHUB_WORKSPACE/python-setup/install_tools.sh
echo -e '\n\n\n\n\n' && sleep 0.5

cd $GITHUB_WORKSPACE/${{ matrix.test_dir }}
find /opt/hostedtoolcache/CodeQL -path "*x64/codeql" -exec $GITHUB_WORKSPACE/python-setup/auto_install_packages.py {} \;

case ${{ matrix.os }} in
ubuntu-latest*) basePath="/opt";;
macos-latest*) basePath="/Users/runner";;
esac
echo ${basePath}

find ${basePath}/hostedtoolcache/CodeQL -path "*x64/codeql" -exec $GITHUB_WORKSPACE/python-setup/auto_install_packages.py {} \;
- name: Setup for extractor
run: |
echo $CODEQL_PYTHON
# only run if $CODEQL_PYTHON is set
test ! -z $CODEQL_PYTHON && $GITHUB_WORKSPACE/python-setup/tests/from_python_exe.py $CODEQL_PYTHON || /bin/true
if [ ! -z $CODEQL_PYTHON ]; then
$GITHUB_WORKSPACE/python-setup/tests/from_python_exe.py $CODEQL_PYTHON;
fi
- name: Verify packages installed
run: |
${{ matrix.test_script }}
5 changes: 0 additions & 5 deletions lib/init.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/init.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions python-setup/install_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ python3 -m pip install --user --upgrade pip setuptools wheel
python2 -m pip install --user virtualenv
python3 -m pip install --user virtualenv

# venv is required for installation of poetry or pipenv (I forgot which)
sudo apt-get install -y python3-venv

# We install poetry with pip instead of the recommended way, since the recommended way
# caused some problem since `poetry run` gives output like:
#
Expand Down
8 changes: 0 additions & 8 deletions src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,14 +186,6 @@ export async function injectWindowsTracer(
export async function installPythonDeps(codeql: CodeQL, logger: Logger) {
logger.startGroup("Setup Python dependencies");

if (process.platform === "darwin") {
logger.info(
"Currently, auto-installing python dependencies is not supported on MacOS"
);
logger.endGroup();
return;
}

const scriptsFolder = path.resolve(__dirname, "../python-setup");

// Setup tools on the Github hosted runners
Expand Down