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
fix: compatibility with matplotlib 3.6 #366
Conversation
8023430
to
bf65ea2
Compare
Codecov ReportBase: 100.00% // Head: 100.00% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## master #366 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 23 23
Lines 2019 2023 +4
Branches 331 331
=========================================
+ Hits 2019 2023 +4
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
d43b0d7
to
043ef15
Compare
matplotlib
3.6 (overview) deprecatesset_tight_layout
and slightly changes figure layout, requiring updates to references. The newlayout_engine
module inmatplotlib
is however not available in earlier versions, andmatplotlib
3.6 requires Python 3.8.We need to check the version of
matplotib
to correctly handle versions <3.6 and >=3.6. Using.__version__
was confirmed as a safe approach to use formatplotlib
. See also https://discuss.python.org/t/dynamic-versions-in-editable-installations/15220/56. When not using.__version__
, the alternative approach to use should beimportlib.metadata.version
(or theimportlib-metadata
port).The coverage is now evaluated with Python 3.8 (previously Python 3.7 was used) to focus on the behavior with the latest
matplotlib
version.Since
pyhf
0.7 brought another API change (scikit-hep/pyhf#2027) compared to RC4, pin to that RC temporarily for CI to work (will be relaxed again right afterwards via #367).The RTD theme for Sphinx causes CI to fail in the latest version due to readthedocs/sphinx_rtd_theme#1343, so that version is also excluded explicitly to fix this.