-
-
Notifications
You must be signed in to change notification settings - Fork 28
60 lines (52 loc) · 1.77 KB
/
python-package-conda.yml
File metadata and controls
60 lines (52 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Python Package using Conda
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.12", "3.13"]
steps:
- uses: actions/checkout@v4
# 1) Install Conda (Miniforge) + activate an env
- name: Set up Conda (Miniforge) + Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Miniforge3
miniforge-version: latest
auto-update-conda: true
activate-environment: ci
python-version: ${{ matrix.python-version }}
channels: conda-forge,defaults
channel-priority: strict
# Important: ensures "conda activate ci" applies to all run steps
- name: Show conda info
shell: bash -l {0}
run: |
conda info
python --version
which python || where python
# 2) Install uv (so "uv pip ..." works)
- name: Set up uv
uses: astral-sh/setup-uv@v3
# 3) Install dependencies
- name: Install dependencies
shell: bash -l {0}
run: |
conda install -y -c conda-forge glpk cartopy
uv pip install --system -r requirements.lock
pip install -e .
pip install highspy
- name: Lint with flake8
shell: bash -l {0}
run: |
conda install -y flake8
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
shell: bash -l {0}
run: |
conda install -y pytest
pytest -vv tests/test_run.py