Update pins #132
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Python Package using Conda | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
env: | |
latest_python: "3.12" | |
supported_pythons: '["3.8", "3.9", "3.10", "3.11", "3.12"]' | |
miniforge_version: "22.9.0-2" | |
miniforge_variant: "Mambaforge" | |
jobs: | |
conf: | |
# This job is needed to route the global environment variables into | |
# a context that's available for matrix (and name, but that's unimportant) | |
name: Prepare Test Plan | |
runs-on: "ubuntu-latest" | |
outputs: | |
latest_python: ${{ steps.set-vars.outputs.latest_python }} | |
supported_pythons: ${{ steps.set-vars.outputs.supported_pythons }} | |
steps: | |
- name: Report Plan | |
id: set-vars | |
run: | | |
echo "latest_python=$latest_python" >> $GITHUB_OUTPUT | |
echo "supported_pythons=$supported_pythons" >> $GITHUB_OUTPUT | |
build-lint-test: | |
needs: conf | |
strategy: | |
max-parallel: 5 | |
fail-fast: true | |
matrix: | |
python_version: ${{ fromJSON(needs.conf.outputs.supported_pythons) }} | |
os: [ubuntu-latest, macos-13, macos-14] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- uses: conda-incubator/setup-miniconda@v2 | |
with: | |
auto-update-conda: true | |
python-version: ${{ matrix.python_version }} | |
miniforge-version: ${{ env.miniforge_version }} | |
miniforge-variant: ${{ env.miniforge_variant }} | |
environment-file: ci/conda_host_env.yml | |
- name: Install dependencies | |
shell: bash -l {0} | |
run: | | |
conda install --yes -c conda-forge --file ci/conda_requirements.txt | |
- name: Lint with flake8 | |
shell: bash -l {0} | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 bp --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 bp --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Test with pytest | |
shell: bash -l {0} | |
run: | | |
pip install --no-deps -e . | |
pytest |