8000 Update build environment and improve test by oscargus · Pull Request #23207 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Update build environment and improve test #23207

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 17, 2022

Conversation

oscargus
Copy link
Member
@oscargus oscargus commented Jun 5, 2022

PR Summary

Enable the extra dependencies for ubuntu 3.10.

Disable blitting tests for GTK4-cairo.

A minor addition to the get_font_names test to see which font actually differs.

(The things discussed below are from temporary versions that included more OS and python version tests.)

PR Checklist

Tests and Styling

  • Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • New features are documented, with examples if plot related.
  • New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

@oscargus oscargus force-pushed the updatebuilds branch 8 times, most recently from e904c8c to 6ee3bfd Compare June 5, 2022 18:13
@oscargus
Copy link
Member Author
oscargus commented Jun 5, 2022

Python 3.11 fails because of kiwisolver, which is fixed in nucleic/kiwi#142

MacOS 12 works, but cannot build PyGObject.

There is a test issue with blitting in GTK4 (the test is marked flaky, but I think this is a proper failure). The error of relevance (I think) is: RuntimeError: copy_from_bbox only works when rendering to an ImageSurface. The full output is:

______________ test_blitting_events[{'MPLBACKEND': 'gtk4cairo'}] _______________
[gw1] linux -- Python 3.10.4 /opt/hostedtoolcache/Python/3.10.4/x64/bin/python
env = {'BACKEND_DEPS': 'cairo,gi', 'MPLBACKEND': 'gtk4cairo'}
@pytest.mark.parametrize("env", _blit_backends)
# subprocesses can struggle to get the display, so rerun a few times
@pytest.mark.flaky(reruns=4)
deftest_blitting_events(env):
>       proc = _run_helper(
            _test_number_of_draws_script, timeout=_test_timeout, extra_env=env)
lib/matplotlib/tests/test_backends_interactive.py:528: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
lib/matplotlib/testing/__init__.py:69: in subprocess_run_helper
    proc = subprocess.run(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
input = None, capture_output = False, timeout = 60, check = True
popenargs = (['/opt/hostedtoolcache/Python/3.10.4/x64/bin/python', '-c', 'from matplotlib.tests.test_backends_interactive import _test_number_of_draws_script; _test_number_of_draws_script()'],)
kwargs = {'env': {'ACCEPT_EULA': 'Y', 'AGENT_TOOLSDIRECTORY': '/opt/hostedtoolcache', 'ANDROID_HOME': '/usr/local/lib/android/s...DROID_NDK_HOME': '/usr/local/lib/android/sdk/ndk-bundle', ...}, 'stderr': -1, 'stdout': -1, 'universal_newlines': True}
process = <Popen: returncode: 1 args: ['/opt/hostedtoolcache/Python/3.10.4/x64/bin/pyt...>
stdout = ''
stderr = 'Gdk-Message: 18:26:33.964: Failed to get file transfer portal: Failed to execute child process “dbus-launch” (No such...n copy_from_bbox\n    raise RuntimeError(\nRuntimeError: copy_from_bbox only works when rendering to an ImageSurface\n'
retcode = 1
defrun(*popenargs,
input=None, capture_output=False, timeout=None, check=False, **kwargs):
"""Run command with arguments and return a CompletedProcess instance.
    The returned instance will have attributes args, returncode, stdout and
    stderr. By default, stdout and stderr are not captured, and those attributes
    will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them.
    If check is True and the exit code was non-zero, it raises a
    CalledProcessError. The CalledProcessError object will have the return code
    in the returncode attribute, and output & stderr attributes if those streams
    were captured.
    If timeout is given, and the process takes too long, a TimeoutExpired
    exception will be raised.
    There is an optional argument "input", allowing you to
    pass bytes or a string to the subprocess's stdin.  If you use this argument
    you may not also use the Popen constructor's "stdin" argument, as
    it will be used internally.
    By default, all communication is in bytes, and therefore any "input" should
    be bytes, and the stdout and stderr will be bytes. If in text mode, any
    "input" should be a string, and stdout and stderr will be strings decoded
    according to locale encoding, or by "encoding" if set. Text mode is
    triggered by setting any of text, encoding, errors or universal_newlines.
    The other arguments are the same as for the Popen constructor.
    """
ifinputisnotNone:
if kwargs.get('stdin') isnotNone:
raiseValueError('stdin and input arguments may not both be used.')
            kwargs['stdin'] = PIPE
if capture_output:
if kwargs.get('stdout') isnotNoneor kwargs.get('stderr') isnotNone:
raiseValueError('stdout and stderr arguments may not be used '
'with capture_output.')
            kwargs['stdout'] = PIPE
            kwargs['stderr'] = PIPE
with Popen(*popenargs, **kwargs) as process:
try:
                stdout, stderr = process.communicate(input, timeout=timeout)
except TimeoutExpired as exc:
                process.kill()
if _mswindows:
# Windows accumulates the output in a single blocking
# read() call run on child threads, with the timeout
# being done in a join() on those threads.  communicate()
# _after_ kill() is required to collect that and add it
# to the exception.
                    exc.stdout, exc.stderr = process.communicate()
else:
# POSIX _communicate already populated the output so
# far into the TimeoutExpired exception.
                    process.wait()
raise
except:  # Including KeyboardInterrupt, communicate handled that.
                process.kill()
# We don't call process.wait() as .__exit__ does that for us.
raise
            retcode = process.poll()
if check and retcode:
>               raise CalledProcessError(retcode, process.args,
                                         output=stdout, stderr=stderr)
E               subprocess.CalledProcessError: Command '['/opt/hostedtoolcache/Python/3.10.4/x64/bin/python', '-c', 'from matplotlib.tests.test_backends_interactive import _test_number_of_draws_script; _test_number_of_draws_script()']' returned non-zero exit status 1.
/opt/hostedtoolcache/Python/3.10.4/x64/lib/python3.10/subprocess.py:524: CalledProcessError

@oscargus
Copy link
Member Author
oscargus commented Jun 5, 2022

And it seems like all the extra requirements now have wheels in 3.10, so if nothing else that can be kept.

@oscargus
Copy link
Member Author
oscargus commented Jun 5, 2022

pypy is clearly not supported... At least not for testing.

@oscargus
Copy link
Member Author
oscargus commented Jun 5, 2022

pypy took 30 minutes to install and 90 minutes to run the tests. A bunch of errors, most related to contourpy and pickling. So I will remove that if nothing else.

@oscargus oscargus force-pushed the updatebuilds branch 4 times, most recently from 525b655 to d0838c1 Compare June 5, 2022 22:24
@oscargus
Copy link
Member Author
oscargus commented Jun 5, 2022

Seems like gtk4cairo doesn't support blitting either (same error message as gtk3cairo), so that is disabled now.

@oscargus
Copy link
Member Author
oscargus commented Jun 5, 2022

Pinning 3.11 to beta 2 as it only is beta 3 that has the kiwisolver problem (if I understand correctly).

@oscargus oscargus force-pushed the updatebuilds branch 6 times, most recently from 3ba0bdc to 5a0c6bb Compare June 9, 2022 19:56
@oscargus oscargus changed the title Update build environment Update build environment and improve test Jun 9, 2022
@oscargus oscargus marked this pull request as ready for review June 9, 2022 19:59
8F28
@tacaswell tacaswell added this to the v3.6.0 milestone Jun 17, 2022
@tacaswell tacaswell merged commit dabae3a into matplotlib:main Jun 17, 2022
@oscargus oscargus deleted the updatebuilds branch June 17, 2022 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0