Skip to content
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

enforce agg backend during testing (windows) #322

Merged
merged 4 commits into from
Mar 31, 2021

Conversation

marscher
Copy link
Contributor

@marscher marscher commented Mar 31, 2021

Changes

As the TK backend of matplotlib sometimes shows strange behavior on Windows, we want to use a different backend (Agg).

The exception thrown by the faulty tk initialization looks like this (for the archives);

     fig, ax = plt.subplots()
c:\hostedtoolcache\windows\python\3.9.2\x64\lib\site-packages\matplotlib\_api\deprecation.py:471: in wrapper
    return func(*args, **kwargs)
c:\hostedtoolcache\windows\python\3.9.2\x64\lib\site-packages\matplotlib\pyplot.py:1410: in subplots
    fig = figure(**fig_kw)
c:\hostedtoolcache\windows\python\3.9.2\x64\lib\site-packages\matplotlib\pyplot.py:768: in figure
    manager = new_figure_manager(
c:\hostedtoolcache\windows\python\3.9.2\x64\lib\site-packages\matplotlib\pyplot.py:316: in new_figure_manager
    return _backend_mod.new_figure_manager(*args, **kwargs)
c:\hostedtoolcache\windows\python\3.9.2\x64\lib\site-packages\matplotlib\backend_bases.py:3545: in new_figure_manager
    return cls.new_figure_manager_given_figure(num, fig)
c:\hostedtoolcache\windows\python\3.9.2\x64\lib\site-packages\matplotlib\backends\_backend_tk.py:870: in new_figure_manager_given_figure
    window = tk.Tk(className="matplotlib")
c:\hostedtoolcache\windows\python\3.9.2\x64\lib\tkinter\__init__.py:2270: in __init__
    self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
E   _tkinter.TclError: Can't find a usable init.tcl in the following directories: 
E       {c:\hostedtoolcache\windows\python\3.9.2\x64\tcl\tcl8.6}
E   
E   c:/hostedtoolcache/windows/python/3.9.2/x64/tcl/tcl8.6/init.tcl: couldn't read file "c:/hostedtoolcache/windows/python/3.9.2/x64/tcl/tcl8.6/init.tcl": No error
E   couldn't read file "c:/hostedtoolcache/windows/python/3.9.2/x64/tcl/tcl8.6/init.tcl": No error
E       while executing
E   "source c:/hostedtoolcache/windows/python/3.9.2/x64/tcl/tcl8.6/init.tcl"
E       ("uplevel" body line 1)
E       invoked from within
E   "uplevel #0 [list source $tclfile]"
E   
E   
E   This probably means that Tcl wasn't installed properly.

Related Issues

Closes #321

@CagtayFabry
Copy link
Member

maybe we could circumvent this by using https://stackoverflow.com/a/60127793 ?

@codecov
Copy link

codecov bot commented Mar 31, 2021

Codecov Report

Merging #322 (10eb512) into master (1c7bf79) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #322   +/-   ##
=======================================
  Coverage   96.86%   96.86%           
=======================================
  Files          82       82           
  Lines        4727     4727           
=======================================
  Hits         4579     4579           
  Misses        148      148           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1c7bf79...10eb512. Read the comment docs.

@CagtayFabry
Copy link
Member

my review will consist of a few reruns of the tests here 😁 😉

@CagtayFabry CagtayFabry added CI tests pytest (and other tests) related labels Mar 31, 2021
Copy link
Member

@CagtayFabry CagtayFabry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good 🚀

@CagtayFabry CagtayFabry merged commit 3d822c2 into BAMWelDX:master Mar 31, 2021
@marscher marscher deleted the mpl_backend_testing branch March 31, 2021 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI no-changelog-entry-needed tests pytest (and other tests) related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pytest windows voes
2 participants