##// END OF EJS Templates
Move optional dependencies to a separate set
Nikita Kniazev -
Show More
@@ -16,12 +16,19 b' jobs:'
16 matrix:
16 matrix:
17 os: [ubuntu-latest]
17 os: [ubuntu-latest]
18 python-version: ["3.7", "3.8", "3.9", "3.10"]
18 python-version: ["3.7", "3.8", "3.9", "3.10"]
19 deps: [test_extra]
19 # Test all on ubuntu, test ends on macos
20 # Test all on ubuntu, test ends on macos
20 include:
21 include:
21 - os: macos-latest
22 - os: macos-latest
22 python-version: "3.7"
23 python-version: "3.7"
24 deps: test_extra
23 - os: macos-latest
25 - os: macos-latest
24 python-version: "3.10"
26 python-version: "3.10"
27 deps: test_extra
28 # Tests minimal dependencies set
29 - os: ubuntu-latest
30 python-version: "3.10"
31 deps: test
25
32
26 steps:
33 steps:
27 - uses: actions/checkout@v2
34 - uses: actions/checkout@v2
@@ -30,15 +37,13 b' jobs:'
30 with:
37 with:
31 python-version: ${{ matrix.python-version }}
38 python-version: ${{ matrix.python-version }}
32 - name: Install latex
39 - name: Install latex
33 if: runner.os == 'Linux'
40 if: runner.os == 'Linux' && matrix.deps == 'test_extra'
34 run: sudo apt-get -yq -o Acquire::Retries=3 --no-install-suggests --no-install-recommends install texlive dvipng
41 run: sudo apt-get -yq -o Acquire::Retries=3 --no-install-suggests --no-install-recommends install texlive dvipng
35 - name: Install and update Python dependencies
42 - name: Install and update Python dependencies
36 run: |
43 run: |
37 python -m pip install --upgrade pip setuptools wheel
44 python -m pip install --upgrade pip setuptools wheel
38 python -m pip install --upgrade -e file://$PWD#egg=ipython[test]
45 python -m pip install --upgrade -e .[${{ matrix.deps }}]
39 python -m pip install --upgrade --upgrade-strategy eager trio curio
46 python -m pip install --upgrade check-manifest pytest-cov
40 python -m pip install --upgrade pytest pytest-cov pytest-trio 'matplotlib!=3.2.0' pandas
41 python -m pip install --upgrade check-manifest pytest-cov anyio
42 - name: Check manifest
47 - name: Check manifest
43 run: check-manifest
48 run: check-manifest
44 - name: pytest
49 - name: pytest
@@ -742,6 +742,7 b' def test_extension():'
742
742
743
743
744 def test_notebook_export_json():
744 def test_notebook_export_json():
745 pytest.importorskip("nbformat")
745 _ip = get_ipython()
746 _ip = get_ipython()
746 _ip.history_manager.reset() # Clear any existing history.
747 _ip.history_manager.reset() # Clear any existing history.
747 cmds = ["a=1", "def b():\n return a**2", "print('noël, été', b())"]
748 cmds = ["a=1", "def b():\n return a**2", "print('noël, été', b())"]
@@ -381,6 +381,7 b' tclass.py: deleting object: C-third'
381
381
382 def test_run_nb(self):
382 def test_run_nb(self):
383 """Test %run notebook.ipynb"""
383 """Test %run notebook.ipynb"""
384 pytest.importorskip("nbformat")
384 from nbformat import v4, writes
385 from nbformat import v4, writes
385 nb = v4.new_notebook(
386 nb = v4.new_notebook(
386 cells=[
387 cells=[
@@ -397,6 +398,7 b' tclass.py: deleting object: C-third'
397
398
398 def test_run_nb_error(self):
399 def test_run_nb_error(self):
399 """Test %run notebook.ipynb error"""
400 """Test %run notebook.ipynb error"""
401 pytest.importorskip("nbformat")
400 from nbformat import v4, writes
402 from nbformat import v4, writes
401 # %run when a file name isn't provided
403 # %run when a file name isn't provided
402 pytest.raises(Exception, _ip.magic, "run")
404 pytest.raises(Exception, _ip.magic, "run")
@@ -66,6 +66,9 b' class Audio(DisplayObject):'
66 Examples
66 Examples
67 --------
67 --------
68
68
69 >>> import pytest
70 >>> np = pytest.importorskip("numpy")
71
69 Generate a sound
72 Generate a sound
70
73
71 >>> import numpy as np
74 >>> import numpy as np
@@ -3,6 +3,7 b''
3 # Copyright (c) IPython Development Team.
3 # Copyright (c) IPython Development Team.
4 # Distributed under the terms of the Modified BSD License.
4 # Distributed under the terms of the Modified BSD License.
5
5
6 import pytest
6 import IPython.testing.tools as tt
7 import IPython.testing.tools as tt
7
8
8
9
@@ -25,4 +26,5 b' def test_locate_profile_help():'
25 tt.help_all_output_test("locate profile")
26 tt.help_all_output_test("locate profile")
26
27
27 def test_trust_help():
28 def test_trust_help():
29 pytest.importorskip("nbformat")
28 tt.help_all_output_test("trust")
30 tt.help_all_output_test("trust")
@@ -31,8 +31,8 b' init:'
31 install:
31 install:
32 - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
32 - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
33 - python -m pip install --upgrade setuptools pip
33 - python -m pip install --upgrade setuptools pip
34 - pip install pytest pytest-cov pytest-trio matplotlib pandas
34 - pip install pytest-cov
35 - pip install -e .[test]
35 - pip install -e .[test_extra]
36 test_script:
36 test_script:
37 - pytest --color=yes -ra --cov --cov-report=xml
37 - pytest --color=yes -ra --cov --cov-report=xml
38 on_finish:
38 on_finish:
@@ -178,9 +178,18 b' extras_require = dict('
178 "pytest",
178 "pytest",
179 "testpath",
179 "testpath",
180 "pygments",
180 "pygments",
181 ],
182 test_extra=[
183 "pytest",
184 "testpath",
185 "curio",
186 "matplotlib!=3.2.0",
181 "nbformat",
187 "nbformat",
182 "ipykernel",
188 "ipykernel",
183 "numpy>=1.17",
189 "numpy>=1.17",
190 "pandas",
191 "pygments",
192 "trio",
184 ],
193 ],
185 terminal=[],
194 terminal=[],
186 kernel=["ipykernel"],
195 kernel=["ipykernel"],
General Comments 0
You need to be logged in to leave comments. Login now