Skip to content

Commit c617b33

Browse files
committed
switch to mambaforge setup with strict conda-forge channel
1 parent 813572f commit c617b33

2 files changed

Lines changed: 36 additions & 27 deletions

File tree

.github/conda-env/test-env.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: test-env
2+
dependencies:
3+
- pip
4+
- coverage
5+
- coveralls
6+
- pytest
7+
- pytest-cov
8+
- pytest-timeout
9+
- numpy
10+
- matplotlib
11+
- scipy

.github/workflows/python-package-conda.yml

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ on: [push, pull_request]
55
jobs:
66
test-linux:
77
name: >
8-
Python ${{ matrix.python-version }};
9-
${{ matrix.slycot || 'without' }} Slycot;
10-
${{ matrix.pandas || 'without' }} Pandas;
11-
${{ matrix.cvxopt || 'without' }} CVXOPT;
8+
Py${{ matrix.python-version }};
9+
${{ matrix.slycot || 'no' }} Slycot;
10+
${{ matrix.pandas || 'no' }} Pandas;
11+
${{ matrix.cvxopt || 'no' }} CVXOPT;
1212
${{ matrix.array-and-matrix == 1 && '; array and matrix' || '' }}
1313
runs-on: ubuntu-latest
1414

@@ -27,43 +27,41 @@ jobs:
2727
array-and-matrix: 1
2828

2929
steps:
30-
- uses: actions/checkout@v2
30+
- uses: actions/checkout@v3
3131

32-
- name: Install dependencies
33-
run: |
34-
# Set up conda
35-
echo $CONDA/bin >> $GITHUB_PATH
36-
conda create -q -n test-environment python=${{matrix.python-version}}
37-
source $CONDA/bin/activate test-environment
38-
39-
# Set up (virtual) X11
40-
sudo apt install -y xvfb
32+
- name: Set up (virtual) X11
33+
run: sudo apt install -y xvfb
4134

42-
# Install test tools
43-
conda install pip coverage pytest pytest-timeout
44-
pip install coveralls
35+
- name: Setup Conda
36+
uses: conda-incubator/setup-miniconda@v2
37+
with:
38+
python-version: ${{ matrix.python-version }}
39+
activate-environment: test-env
40+
environment-file: .github/conda-env/test-env.yml
41+
miniforge-version: latest
42+
miniforge-variant: Mambaforge
43+
channels: conda-forge
44+
channel-priority: strict
45+
auto-update-conda: false
46+
auto-activate-base: false
4547

46-
# Install python-control dependencies
47-
conda install numpy matplotlib scipy
48+
- name: Install optional dependencies
49+
run: |
4850
if [[ '${{matrix.slycot}}' == 'conda' ]]; then
49-
conda install -c conda-forge slycot
51+
mamba install slycot
5052
fi
5153
if [[ '${{matrix.pandas}}' == 'conda' ]]; then
52-
conda install pandas
54+
mamba install pandas
5355
fi
5456
if [[ '${{matrix.cvxopt}}' == 'conda' ]]; then
55-
conda install -c conda-forge cvxopt
57+
mamba install cvxopt
5658
fi
5759
5860
- name: Test with pytest
5961
env:
6062
PYTHON_CONTROL_ARRAY_AND_MATRIX: ${{ matrix.array-and-matrix }}
6163
run: |
62-
source $CONDA/bin/activate test-environment
63-
# Use xvfb-run instead of pytest-xvfb to get proper mpl backend
64-
# Use coverage instead of pytest-cov to get .coverage file
65-
# See https://github.com/python-control/python-control/pull/504
66-
xvfb-run --auto-servernum coverage run -m pytest control/tests
64+
xvfb-run --auto-servernum pytest --cov=control --cov-config=.coveragerc control/tests
6765
6866
- name: Coveralls parallel
6967
# https://github.com/coverallsapp/github-action

0 commit comments

Comments
 (0)