8000 Simplify appveyor to only use conda · matplotlib/matplotlib@51b8989 · GitHub
[go: up one dir, main page]

Skip to content

Commit 51b8989

Browse files
committed
Simplify appveyor to only use conda
Closes #24394 Adjust environment.yml skip fontconfig private method test on windows skip fontconfig private method test on windows revert adding fontconfig explicitly to environment Add wxpython back Skip some wx tests Upgrade to gtk4 in environment.yml ignore private modules in getattr test _backend_gtk would fail because it expects one of gtk4 or gtk3 to be imported first Clean up appveyor.yml comments skip memleak test for wxagg conda activate does not, in fact, work revert to simply activate
1 parent 3d6c3da commit 51b8989

File tree

5 files changed

+30
-25
lines changed

5 files changed

+30
-25
lines changed

.appveyor.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,14 @@ environment:
1818
PYTHONIOENCODING: UTF-8
1919
PYTEST_ARGS: -raR --numprocesses=auto --timeout=300 --durations=25
2020
--cov-report= --cov=lib --log-level=DEBUG
21-
PINNEDVERS: "pyzmq!=21.0.0,!=22.0.0"
2221

2322
matrix:
2423
- PYTHON_VERSION: "3.8"
2524
CONDA_INSTALL_LOCN: "C:\\Miniconda3-x64"
2625
TEST_ALL: "no"
27-
EXTRAREQS: "-r requirements/testing/extra.txt"
2826
- PYTHON_VERSION: "3.9"
2927
CONDA_INSTALL_LOCN: "C:\\Miniconda3-x64"
3028
TEST_ALL: "no"
31-
EXTRAREQS: "-r requirements/testing/extra.txt"
3229

3330
# We always use a 64-bit machine, but can build x86 distributions
3431
# with the PYTHON_ARCH variable
@@ -52,19 +49,13 @@ install:
5249
- conda config --prepend channels conda-forge
5350

5451
# For building, use a new environment
55-
- conda create -q -n test-environment python=%PYTHON_VERSION% tk "pip<22.0"
56-
- activate test-environment
57-
# pull pywin32 from conda because on py38 there is something wrong with finding
58-
# the dlls when installed from pip
52+
# Add python version to environment
53+
# `^ ` escapes spaces for indentation
54+
- echo ^ ^ - python=%PYTHON_VERSION% >> environment.yml
55+
- conda env create -f environment.yml
56+
- activate mpl-dev
5957
- conda install -c conda-forge pywin32
60-
# install pyqt from conda-forge
61-
- conda install -c conda-forge pyqt
6258
- echo %PYTHON_VERSION% %TARGET_ARCH%
63-
# Install dependencies from PyPI.
64-
- python -m pip install --upgrade -r requirements/testing/all.txt %EXTRAREQS% %PINNEDVERS%
65-
# Install optional dependencies from PyPI.
66-
# Sphinx is needed to run sphinxext tests
67-
- python -m pip install --upgrade sphinx
6859
# Show the installed packages + versions
6960
- conda list
7061

@@ -104,7 +95,7 @@ artifacts:
10495
type: zip
10596

10697
on_finish:
107-
- pip install codecov
98+
- conda install codecov
10899
- codecov -e PYTHON_VERSION PLATFORM
109100

110101
on_failure:

environment.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ dependencies:
4444
- coverage
4545
- flake8>=3.8
4646
- flake8-docstrings>=1.4.0
47-
- gtk3
47+
- gtk4
4848
- ipykernel
4949
- nbconvert[execute]!=6.0.0,!=6.0.1
5050
- nbformat!=5.0.0,!=5.0.1

lib/matplotlib/tests/test_backends_interactive.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ def test_interactive_backend(env, toolbar):
166166
if env["MPLBACKEND"] == "macosx":
167167
if toolbar == "toolmanager":
168168
pytest.skip("toolmanager is not implemented for macosx.")
169+
if env["MPLBACKEND"] == "wx":
170+
pytest.skip("wx backend is deprecated; tests failed on appveyor")
169171
proc = _run_helper(_test_interactive_impl,
170172
json.dumps({"toolbar": toolbar}),
171173
timeout=_test_timeout,
@@ -568,6 +570,11 @@ def test_figure_leak_20490(env, time_mem):
568570
# We haven't yet directly identified the leaks so test with a memory growth
569571
# threshold.
570572
pause_time, acceptable_memory_leakage = time_mem
573+
if env["MPLBACKEND"] == "wx":
574+
pytest.skip("wx backend is deprecated; tests failed on appveyor")
575+
if env["MPLBACKEND"] == "wxagg" and sys.platform == "win32":
576+
pytest.skip("tests failed on appveyor")
577+
571578
if env["MPLBACKEND"] == "macosx" or (
572579
env["MPLBACKEND"] == "tkagg" and sys.platform == 'darwin'
573580
):

lib/matplotlib/tests/test_font_manager.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ def test_otf():
7373
assert res == is_opentype_cff_font(f.fname)
7474

7575

76-
@pytest.mark.skipif(not has_fclist, reason='no fontconfig installed')
76+
@pytest.mark.skipif(sys.platform == "win32" or not has_fclist,
77+
reason='no fontconfig installed')
7778
def test_get_fontconfig_fonts():
7879
assert len(_get_fontconfig_fonts()) > 1
7980

lib/matplotlib/tests/test_getattr.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,20 @@
44
import matplotlib
55
import pytest
66

7-
# Get the names of all matplotlib submodules, except for the unit tests.
8-
module_names = [m.name for m in walk_packages(path=matplotlib.__path__,
9-
prefix=f'{matplotlib.__name__}.')
10-
if not m.name.startswith(__package__)]
7+
# Get the names of all matplotlib submodules,
8+
# except for the unit tests and private modules.
9+
module_names = [
10+
m.name
11+
for m in walk_packages(
12+
path=matplotlib.__path__, prefix=f"{matplotlib.__name__}."
13+
)
14+
if not m.name.startswith(__package__)
15+
and not any(x.startswith("_") for x in m.name.split("."))
16+
]
1117

1218

13-
@pytest.mark.parametrize('module_name', module_names)
14-
@pytest.mark.filterwarnings('ignore::DeprecationWarning')
19+
@pytest.mark.parametrize("module_name", module_names)
20+
@pytest.mark.filterwarnings("ignore::DeprecationWarning")
1521
def test_getattr(module_name):
1622
"""
1723
Test that __getattr__ methods raise AttributeError for unknown keys.
@@ -21,8 +27,8 @@ def test_getattr(module_name):
2127
module = import_module(module_name)
2228
except (ImportError, RuntimeError) as e:
2329
# Skip modules that cannot be imported due to missing dependencies
24-
pytest.skip(f'Cannot import {module_name} due to {e}')
30+
pytest.skip(f"Cannot import {module_name} due to {e}")
2531

26-
key = 'THIS_SYMBOL_SHOULD_NOT_EXIST'
32+
key = "THIS_SYMBOL_SHOULD_NOT_EXIST"
2733
if hasattr(module, key):
2834
delattr(module, key)

0 commit comments

Comments
 (0)
0