Skip to content

remove unused imports #4778

remove unused imports

remove unused imports #4778

Workflow file for this run

name: ASPIRE Python Pip CI
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
push:
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install dependencies
run: |
pip install tox tox-gh-actions
- name: Run Tox Check
run: tox -e check
build:
needs: check
runs-on: ubuntu-latest
# Run on every code push, but only on review ready PRs
if: ${{ github.event_name == 'push' || github.event.pull_request.draft == false }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
pyenv: [pip]
exclude:
# Exclude 3.8-pip so we can add pre/post tasks to that environment.
- python-version: '3.8'
pyenv: pip
include:
# Re-include 3.8 with additional tox tasks.
- python-version: '3.8'
pyenv: pip,docs
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }} ${{ matrix.pyenv }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install tox tox-gh-actions
- name: Test with tox
run: tox --skip-missing-interpreters false -e py${{ matrix.python-version }}-${{ matrix.pyenv }}
- name: Upload Coverage to CodeCov
uses: codecov/codecov-action@v3
conda-build:
needs: check
runs-on: ${{ matrix.os }}
# Only run on review ready pull_requests
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.draft == false }}
defaults:
run:
shell: bash -el {0}
strategy:
matrix:
os: [ubuntu-latest, ubuntu-20.04, macOS-latest, macOS-11]
backend: [default, openblas]
python-version: ['3.8']
include:
- os: ubuntu-latest
backend: intel
- os: macOS-latest
backend: accelerate
- os: windows-2019
backend: default
steps:
- uses: actions/checkout@v3
- name: Set up Conda ${{ matrix.os }} Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
activate-environment: aspire
environment-file: environment-${{ matrix.backend }}.yml
auto-activate-base: false
- name: Complete Install and Log Environment ${{ matrix.os }} Python ${{ matrix.python-version }}
run: |
conda info
conda list
pip install -e ".[dev]"
pip freeze
python -c "import numpy; numpy.show_config()"
- name: Execute Pytest Conda ${{ matrix.os }} Python ${{ matrix.python-version }}
run: |
export OMP_NUM_THREADS=2
# -n runs test in parallel using pytest-xdist
pytest -n2 --durations=50 -s
# Build and Deploy production (master) docs.
docs_deploy:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install Dependencies
run: |
pip install -e ".[dev]"
- name: Run Sphinx doc build script
env:
GITHUB_ACTOR: ${{ github.actor }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: "docs/buildsite.sh"
shell: bash
ampere_gpu:
needs: check
runs-on: self-hosted
# Run on every code push, but only on review ready PRs
if: ${{ github.event_name == 'push' || github.event.pull_request.draft == false }}
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
pip install -e ".[dev,gpu_11x]"
- name: Customize config
run: |
echo "Setup tmp dirs and chmod so others can cleanup."
CI_TMP_DIR=/var/ci/tmp
mkdir -p ${CI_TMP_DIR}
chmod g+rwx ${CI_TMP_DIR}
echo "Create and assign a unique temp dir to hold our config."
WORK_DIR=$(mktemp -d -p "${CI_TMP_DIR}")
echo "WORK_DIR=${WORK_DIR}"
echo "Stash the WORK_DIR to GitHub env so we can clean it up later."
echo "WORK_DIR=${WORK_DIR}" >> $GITHUB_ENV
echo -e "ray:\n temp_dir: ${WORK_DIR}\n" > ${WORK_DIR}/config.yaml
echo "Log the config: ${WORK_DIR}/config.yaml"
cat ${WORK_DIR}/config.yaml
- name: Run
run: |
ASPIREDIR=${{ env.WORK_DIR }} python -c \
"import aspire; print(aspire.config['ray']['temp_dir'])"
ASPIREDIR=${{ env.WORK_DIR }} pytest --durations=50
- name: Cleanup
run: rm -rf ${{ env.WORK_DIR }}
# Build branch's docs and gallery.
docs:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"
- name: Build Sphinx docs
run: |
make distclean
sphinx-apidoc -f -o ./source ../src -H Modules
make html
working-directory: ./docs
- name: Archive Sphinx docs
uses: actions/upload-artifact@v3
with:
name: sphinx-docs
path: docs/build
retention-days: 7