<p dir="auto">(Original issue below the line)</p>
<p dir="auto">As suggested below, it makes sense to make <code class="notranslate">texcache</code> private, which need to go through a deprecation cycle. See <a href="https://matplotlib.org/stable/devel/contributing.html#api-changes" rel="nofollow">https://matplotlib.org/stable/devel/contributing.html#api-changes</a> for a more detailed description of what is required in terms of deprecating something. Also, see the helper function <code class="notranslate">deprecate_privatize_attribute</code> and how it is used in the code base.</p>
<p dir="auto">Marking as good first issue since there is a minor, well-defined, change. But it may require a bit of reading up to get it right.</p>
<hr>
<h3 dir="auto">Documentation Link</h3>
<p dir="auto"><a href="https://matplotlib.org/stable/api/texmanager_api.html" rel="nofollow">https://matplotlib.org/stable/api/texmanager_api.html</a></p>
<h3 dir="auto">Problem</h3>
<p dir="auto">texcache = '/home/elliott/.cache/matplotlib/tex.cache'</p>
<h3 dir="auto">Suggested improvement</h3>
<p dir="auto">Not a big deal, but maybe one can at least add a doc-string stating that is points to <code class="notranslate">$HOME/.cache/matplotlib/tex.cache</code> or however it is actually determined.</p>
<p dir="auto">Looks like matplotlib is completely not ready to use pytest which is very useful specially after installing some pytest extensions which passes code over many scanners and sanity checks allowing automatically find places in the code which could be fixed/improved.</p>
<p dir="auto">How to reproduce that:</p>
<ul dir="auto">
<li>"python setuup.py build"</li>
<li>"python setuup.py install --root  &lt;/install/prefix&gt;"</li>
<li>execute "pytest" with PYTHONPATH pointing to python sitearchg and sitelib inside &lt;/install/prefix&gt;</li>
</ul>
<div class="highlight highlight-text-shell-session notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="+ PATH=/home/tkloczko/rpmbuild/BUILDROOT/python-matplotlib-3.4.2-2.fc35.x86_64/usr/bin:/usr/bin:/usr/sbin:/usr/local/sbin
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-matplotlib-3.4.2-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-matplotlib-3.4.2-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ PYTHONDONTWRITEBYTECODE=1
+ xvfb-run -a -s '-screen 0 640x480x24' /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /home/tkloczko/rpmbuild/BUILD/matplotlib-3.4.2, configfile: pytest.ini, testpaths: lib
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, xdist-2.2.1, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, Faker-8.4.0, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0
collected 0 items / 1 error

================================================================================== ERRORS ==================================================================================
______________________________________________________________________ ERROR collecting test session _______________________________________________________________________
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
&lt;frozen importlib._bootstrap&gt;:1014: in _gcd_import
    ???
&lt;frozen importlib._bootstrap&gt;:991: in _find_and_load
    ???
&lt;frozen importlib._bootstrap&gt;:961: in _find_and_load_unlocked
    ???
&lt;frozen importlib._bootstrap&gt;:219: in _call_with_frames_removed
    ???
&lt;frozen importlib._bootstrap&gt;:1014: in _gcd_import
    ???
&lt;frozen importlib._bootstrap&gt;:991: in _find_and_load
    ???
&lt;frozen importlib._bootstrap&gt;:961: in _find_and_load_unlocked
    ???
&lt;frozen importlib._bootstrap&gt;:219: in _call_with_frames_removed
    ???
&lt;frozen importlib._bootstrap&gt;:1014: in _gcd_import
    ???
&lt;frozen importlib._bootstrap&gt;:991: in _find_and_load
    ???
&lt;frozen importlib._bootstrap&gt;:975: in _find_and_load_unlocked
    ???
&lt;frozen importlib._bootstrap&gt;:671: in _load_unlocked
    ???
&lt;frozen importlib._bootstrap_external&gt;:783: in exec_module
    ???
&lt;frozen importlib._bootstrap&gt;:219: in _call_with_frames_removed
    ???
lib/matplotlib/__init__.py:107: in &lt;module&gt;
    from . import _api, cbook, docstring, rcsetup
lib/matplotlib/cbook/__init__.py:31: in &lt;module&gt;
    from matplotlib import _api, _c_internal_utils
E   ImportError: cannot import name '_c_internal_utils' from partially initialized module 'matplotlib' (most likely due to a circular import) (/home/tkloczko/rpmbuild/BUILD/matplotlib-3.4.2/lib/matplotlib/__init__.py)
========================================================================= short test summary info ==========================================================================
ERROR  - ImportError: cannot import name '_c_internal_utils' from partially initialized module 'matplotlib' (most likely due to a circular import) (/home/tkloczko/rpmbui...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================= 1 error in 0.46s ============================================================================="><pre class="notranslate"><span class="pl-c1">+ PATH=/home/tkloczko/rpmbuild/BUILDROOT/python-matplotlib-3.4.2-2.fc35.x86_64/usr/bin:/usr/bin:/usr/sbin:/usr/local/sbin</span>
<span class="pl-c1">+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-matplotlib-3.4.2-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-matplotlib-3.4.2-2.fc35.x86_64/usr/lib/python3.8/site-packages</span>
<span class="pl-c1">+ PYTHONDONTWRITEBYTECODE=1</span>
<span class="pl-c1">+ xvfb-run -a -s '-screen 0 640x480x24' /usr/bin/pytest -ra</span>
<span class="pl-c1">=========================================================================== test session starts ============================================================================</span>
<span class="pl-c1">platform linux -- Python 3.8.9, pytest-6.2.4, py-1.10.0, pluggy-0.13.1</span>
<span class="pl-c1">rootdir: /home/tkloczko/rpmbuild/BUILD/matplotlib-3.4.2, configfile: pytest.ini, testpaths: lib</span>
<span class="pl-c1">plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, xdist-2.2.1, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, Faker-8.4.0, cov-2.12.1, pyfakefs-4.5.0, cases-3.6.1, flaky-3.7.0, hypothesis-6.14.0</span>
<span class="pl-c1">collected 0 items / 1 error</span>

<span class="pl-c1">================================================================================== ERRORS ==================================================================================</span>
<span class="pl-c1">______________________________________________________________________ ERROR collecting test session _______________________________________________________________________</span>
<span class="pl-c1">/usr/lib64/python3.8/importlib/__init__.py:127: in import_module</span>
<span class="pl-c1">    return _bootstrap._gcd_import(name[level:], package, level)</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:1014: in _gcd_import</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:991: in _find_and_load</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:961: in _find_and_load_unlocked</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:219: in _call_with_frames_removed</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:1014: in _gcd_import</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:991: in _find_and_load</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:961: in _find_and_load_unlocked</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:219: in _call_with_frames_removed</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:1014: in _gcd_import</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:991: in _find_and_load</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:975: in _find_and_load_unlocked</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:671: in _load_unlocked</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap_external&gt;:783: in exec_module</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">&lt;frozen importlib._bootstrap&gt;:219: in _call_with_frames_removed</span>
<span class="pl-c1">    ???</span>
<span class="pl-c1">lib/matplotlib/__init__.py:107: in &lt;module&gt;</span>
<span class="pl-c1">    from . import _api, cbook, docstring, rcsetup</span>
<span class="pl-c1">lib/matplotlib/cbook/__init__.py:31: in &lt;module&gt;</span>
<span class="pl-c1">    from matplotlib import _api, _c_internal_utils</span>
<span class="pl-c1">E   ImportError: cannot import name '_c_internal_utils' from partially initialized module 'matplotlib' (most likely due to a circular import) (/home/tkloczko/rpmbuild/BUILD/matplotlib-3.4.2/lib/matplotlib/__init__.py)</span>
<span class="pl-c1">========================================================================= short test summary info ==========================================================================</span>
<span class="pl-c1">ERROR  - ImportError: cannot import name '_c_internal_utils' from partially initialized module 'matplotlib' (most likely due to a circular import) (/home/tkloczko/rpmbui...</span>
<span class="pl-c1">!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!</span>
<span class="pl-c1">============================================================================= 1 error in 0.46s =============================================================================</span></pre></div>