8000 Merge pull request #757 from bnavigator/conda-forge · python-control/python-control@a73a03d · GitHub
[go: up one dir, main page]

Skip to content

Commit a73a03d

Browse files
authored
Merge pull request #757 from bnavigator/conda-forge
Switch CI to mambaforge and conda-forge channel
2 parents a19c501 + afb1ce0 commit a73a03d

File tree

2 files changed

+40
-24
lines changed

2 files changed

+40
-24
lines changed

.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: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ on: [push, pull_request]
44

55
jobs:
66
test-linux:
7-
name: Python ${{ matrix.python-version }}${{ matrix.slycot && format(' with Slycot from {0}', matrix.slycot) || ' without Slycot' }}${{ matrix.pandas && ', with pandas' || '' }}${{ matrix.array-and-matrix == 1 && ', array and matrix' || '' }}${{ matrix.cvxopt && format(' with cvxopt from {0}', matrix.cvxopt) || ' without cvxopt' }}
7+
name: >
8+
Py${{ matrix.python-version }};
9+
${{ matrix.slycot || 'no' }} Slycot;
10+
${{ matrix.pandas || 'no' }} Pandas;
11+
${{ matrix.cvxopt || 'no' }} CVXOPT;
12+
${{ matrix.array-and-matrix == 1 && '; array and matrix' || '' }}
813
runs-on: ubuntu-latest
914

1015
strategy:
@@ -22,43 +27,43 @@ jobs:
2227
array-and-matrix: 1
2328

2429
steps:
25-
- uses: actions/checkout@v2
30+
- uses: actions/checkout@v3
2631

27-
- name: Install dependencies
28-
run: |
29-
# Set up conda
30-
echo $CONDA/bin >> $GITHUB_PATH
31-
conda create -q -n test-environment python=${{matrix.python-version}}
32-
source $CONDA/bin/activate test-environment
33-
34-
# Set up (virtual) X11
35-
sudo apt install -y xvfb
32+
- name: Set up (virtual) X11
33+
run: sudo apt install -y xvfb
3634

37-
# Install test tools
38-
conda install pip coverage pytest pytest-timeout
39-
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
4047

41-
# Install python-control dependencies
42-
conda install numpy matplotlib scipy
48+
- name: Install optional dependencies
49+
shell: bash -l {0}
50+
run: |
4351
if [[ '${{matrix.slycot}}' == 'conda' ]]; then
44-
conda install -c conda-forge slycot
52+
mamba install slycot
4553
fi
4654
if [[ '${{matrix.pandas}}' == 'conda' ]]; then
47-
conda install pandas
55+
mamba install pandas
4856
fi
4957
if [[ '${{matrix.cvxopt}}' == 'conda' ]]; then
50-
conda install -c conda-forge cvxopt
58+
mamba install cvxopt
5159
fi
5260
5361
- name: Test with pytest
62+
shell: bash -l {0}
5463
env:
5564
PYTHON_CONTROL_ARRAY_AND_MATRIX: ${{ matrix.array-and-matrix }}
5665
run: |
57-
source $CONDA/bin/activate test-environment
58-
# Use xvfb-run instead of pytest-xvfb to get proper mpl backend
59-
# Use coverage instead of pytest-cov to get .coverage file
60-
# See https://github.com/python-control/python-control/pull/504
61-
xvfb-run --auto-servernum coverage run -m pytest control/tests
66+
xvfb-run --auto-servernum pytest --cov=control --cov-config=.coveragerc control/tests
6267
6368
- name: Coveralls parallel
6469
# https://github.com/coverallsapp/github-action

0 commit comments

Comments
 (0)
0