Skip to content

Commit

Permalink
Testing: Use conda-forge and mamba for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ccordoba12 committed Sep 25, 2021
1 parent 95efd22 commit 2ed9e05
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 35 deletions.
24 changes: 7 additions & 17 deletions .github/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,17 @@ fi
# Install dependencies
if [ "$USE_CONDA" = "true" ]; then

if [ "$OS" != "win" ]; then
# Install nomkl to avoid installing Intel MKL libraries
conda install nomkl -q -y
fi

# Install main dependencies
conda install python=$PYTHON_VERSION --file requirements/conda.txt -q -y -c spyder-ide/label/dev
mamba install python=$PYTHON_VERSION --file requirements/conda.txt -q -y -c conda-forge

# Install test ones
conda install python=$PYTHON_VERSION --file requirements/tests.txt -c spyder-ide -q -y
mamba install python=$PYTHON_VERSION --file requirements/tests.txt -c conda-forge -q -y

# Install Pyzmq 19 because our tests are failing with version 20
if [ "$OS" = "win" ]; then
conda install pyzmq=19
mamba install pyzmq=19
fi

# Constrain jupyter_client version on conda based tests
# The actual dependency constrain is done in spyder-kernels since v2.1.1
conda install jupyter_client=6

# Remove packages we have subrepos for.
conda remove spyder-kernels --force -q -y
conda remove python-lsp-server --force -q -y
Expand Down Expand Up @@ -55,7 +46,6 @@ else
pip uninstall spyder-kernels -q -y
pip uninstall python-lsp-server -q -y
pip uninstall qdarkstyle -q -y

fi

# Install subrepos in development mode
Expand All @@ -82,12 +72,12 @@ pip install --no-deps dist/spyder*.whl
pip install check-manifest

# Create environment for Jedi environments tests
conda create -n jedi-test-env -q -y python=3.6 flask spyder-kernels
conda list -n jedi-test-env
mamba create -n jedi-test-env -q -y python=3.6 flask spyder-kernels
mamba list -n jedi-test-env

# Create environment to test conda activation before launching a spyder kernel
conda create -n spytest-ž -q -y python=3.6 spyder-kernels
conda list -n spytest-ž
mamba create -n spytest-ž -q -y python=3.6 spyder-kernels
mamba list -n spytest-ž

# Install pyenv
if [ "$RUN_SLOW" = "false" ]; then
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/test-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
sudo apt-get update --fix-missing
sudo apt-get install libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev libegl1-mesa libxkbcommon-x11-0 xterm --fix-missing
- name: Cache conda
uses: actions/cache@v1
uses: actions/cache@v2
env:
# Increase this value to reset cache if requirements/*.txt has not changed
CACHE_NUMBER: 0
Expand All @@ -78,19 +78,22 @@ jobs:
key: ${{ runner.os }}-cacheconda-installconda-${{ matrix.PYTHON_VERSION }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements/*.txt') }}
- name: Cache pip
if: env.RUN_BUILD == 'true'
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-cachepip-installconda-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements/*.txt') }}
key: ${{ runner.os }}-cachepip-installconda-${{ env.CACHE_NUMBER }}-${{ hashFiles('setup.py') }}
- name: Install Conda
if: env.RUN_BUILD == 'true'
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test
auto-update-conda: true
auto-update-conda: false
auto-activate-base: false
python-version: ${{ matrix.PYTHON_VERSION }}
use-only-tar-bz2: true
channels: conda-forge,defaults
channel-priority: strict
mamba-version: "*"
- name: Create test environment
if: env.RUN_BUILD == 'true'
shell: bash -l {0}
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/test-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
sudo apt-get update --fix-missing
sudo apt-get install libxcb-randr0-dev libxcb-xtest0-dev libxcb-xinerama0-dev libxcb-shape0-dev libxcb-xkb-dev libegl1-mesa libxkbcommon-x11-0 xterm --fix-missing
- name: Cache conda
uses: actions/cache@v1
uses: actions/cache@v2
env:
# Increase this value to reset cache if requirements/*.txt has not changed
CACHE_NUMBER: 0
Expand All @@ -82,19 +82,22 @@ jobs:
key: ${{ runner.os }}-cacheconda-install${{ matrix.INSTALL_TYPE }}-${{ matrix.PYTHON_VERSION }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements/*.txt') }}
- name: Cache pip
if: env.RUN_BUILD == 'true'
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-cachepip-install${{ matrix.INSTALL_TYPE }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements/*.txt') }}
key: ${{ runner.os }}-cachepip-install${{ matrix.INSTALL_TYPE }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('setup.py') }}
- name: Install Conda
if: env.RUN_BUILD == 'true'
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test
auto-update-conda: true
auto-update-conda: false
auto-activate-base: false
python-version: ${{ matrix.PYTHON_VERSION }}
use-only-tar-bz2: true
channels: conda-forge,defaults
channel-priority: strict
mamba-version: "*"
- name: Create test environment
if: env.RUN_BUILD == 'true'
shell: bash -l {0}
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/test-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
shell: bash -l {0}
run: echo "RUN_BUILD=true" >> $GITHUB_ENV
- name: Cache conda
uses: actions/cache@v1
uses: actions/cache@v2
env:
# Increase this value to reset cache if requirements/*.txt has not changed
CACHE_NUMBER: 0
Expand All @@ -75,19 +75,22 @@ jobs:
key: ${{ runner.os }}-cacheconda-install${{ matrix.INSTALL_TYPE }}-${{ matrix.PYTHON_VERSION }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements/*.txt') }}
- name: Cache pip
if: env.RUN_BUILD == 'true'
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-cachepip-install${{ matrix.INSTALL_TYPE }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements/*.txt') }}
key: ${{ runner.os }}-cachepip-install${{ matrix.INSTALL_TYPE }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('setup.py') }}
- name: Install Conda
if: env.RUN_BUILD == 'true'
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test
auto-update-conda: true
auto-update-conda: false
auto-activate-base: false
python-version: ${{ matrix.PYTHON_VERSION }}
use-only-tar-bz2: true
channels: conda-forge,defaults
channel-priority: strict
mamba-version: "*"
- name: Create test environment
if: env.RUN_BUILD == 'true'
shell: bash -l {0}
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/test-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
shell: bash -l {0}
run: echo "RUN_BUILD=true" >> $GITHUB_ENV
- name: Cache conda
uses: actions/cache@v1
uses: actions/cache@v2
env:
# Increase this value to reset cache if requirements/*.txt has not changed
CACHE_NUMBER: 0
Expand All @@ -75,19 +75,22 @@ jobs:
key: ${{ runner.os }}-cacheconda-install${{ matrix.INSTALL_TYPE }}-${{ matrix.PYTHON_VERSION }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements/*.txt') }}
- name: Cache pip
if: env.RUN_BUILD == 'true'
uses: actions/cache@v1
uses: actions/cache@v2
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-cachepip-install${{ matrix.INSTALL_TYPE }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements/*.txt') }}
key: ${{ runner.os }}-cachepip-install${{ matrix.INSTALL_TYPE }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('setup.py') }}
- name: Install Conda
if: env.RUN_BUILD == 'true'
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test
auto-update-conda: true
auto-update-conda: false
auto-activate-base: false
python-version: ${{ matrix.PYTHON_VERSION }}
use-only-tar-bz2: true
channels: conda-forge,defaults
channel-priority: strict
mamba-version: "*"
- name: Create test environment
if: env.RUN_BUILD == 'true'
shell: bash -l {0}
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ $ workon spyder-dev
After you have created your development environment, you need to install Spyder's necessary dependencies. The easiest way to do so (with Anaconda) is

```bash
$ conda install -c spyder-ide/label/dev --file requirements/conda.txt
$ conda install -c conda-forge --file requirements/conda.txt
```

This installs all Spyder's dependencies into the environment.
Expand Down Expand Up @@ -99,7 +99,7 @@ $ python bootstrap.py --debug
To install our test dependencies under Anaconda:

```bash
$ conda install -c spyder-ide --file requirements/tests.txt
$ conda install -c conda-forge --file requirements/tests.txt
```

If using `pip` (for experts only), run the following from the directory where your git clone is stored:
Expand Down

0 comments on commit 2ed9e05

Please sign in to comment.