Skip to content

Update setuptools requirement from <68.0,>=61.0 to >=61.0,<71.0 #102

Update setuptools requirement from <68.0,>=61.0 to >=61.0,<71.0

Update setuptools requirement from <68.0,>=61.0 to >=61.0,<71.0 #102

# Scan the code for security vulnerabilities with CodeQL.
# See https://github.com/github/codeql-action
name: "CodeQL"
on:
push:
branches:
- "main"
- "develop"
pull_request:
# The branches below must be a subset of the branches above.
branches:
- "main"
- "develop"
jobs:
scan:
strategy:
matrix:
os:
- "ubuntu-latest"
python-version:
- "3.9"
runs-on: "${{ matrix.os }}"
permissions:
security-events: "write"
steps:
- name: "Checkout repository"
uses: "actions/checkout@v4"
- name: "Set up Python ${{ matrix.python-version }}"
uses: "actions/setup-python@v5"
with:
python-version: "${{ matrix.python-version }}"
- name: "Export ${HOME}/.local/bin to ${PATH}"
# Executable Python binaries are usually stored there.
run: 'echo "${HOME}/.local/bin" >> ${GITHUB_PATH}'
- name: "Get pip cache dir"
# pip's cache path depends on the operating system. See
# https://github.com/actions/cache/blob/main/examples.md#python---pip
# This requires pip >=20.1.
id: "pip-cache"
run: |
python -m pip install --user --upgrade pip
echo "dir=$(pip cache dir)" >> ${GITHUB_OUTPUT}
- name: "Create/Restore cache"
uses: "actions/cache@v4"
with:
path: "${{ steps.pip-cache.outputs.dir }}/**"
key: |
${{ runner.os }}-${{ matrix.python-version }}-${{ github.job }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}
${{ runner.os }}
- name: "Install/Upgrade setuptools and wheel"
# MDAnalysis requires NumPy (>=1.19.2) for setup (see also
# https://github.com/MDAnalysis/mdanalysis/issues/3374#issuecomment-889189979).
# MDAnalysis <3.0 requires Cython <3.0 (see
# https://github.com/MDAnalysis/mdanalysis/pull/4129 and
# https://github.com/cython/cython/issues/3690).
# Strangely, without `python-dev-tools` the installation of
# MDAnalysis might fail while building the wheel.
run: |
python -m pip install --user --upgrade setuptools wheel
python -m pip install --user --upgrade python-dev-tools
python -m pip install --user "Cython <3.0"
python -m pip install --user "numpy >=1.19.2"
- name: "Install/Upgrade this project"
run: |
python -m pip install --user --upgrade .
# Set the `CODEQL-PYTHON` environment variable to the Python
# executable that includes the dependencies.
echo "CODEQL_PYTHON=$(which python)" >> ${GITHUB_ENV}
- name: "Initialize CodeQL"
uses: "github/codeql-action/init@v3"
with:
languages: "python"
# Override the default behavior so that the action doesn't
# attempt to auto-install Python dependencies. See
# https://docs.github.com/en/code-security/secure-coding/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#analyzing-python-dependencies
setup-python-dependencies: false
- name: "Perform CodeQL Analysis"
uses: "github/codeql-action/analyze@v3"