MCPcopy Index your code
hub / github.com/pymupdf/PyMuPDF / install_dir

Function install_dir

pipcl.py:3200–3223  ·  view source on GitHub ↗

Returns install directory used by `install()`. This will be `sysconfig.get_path('platlib')`, modified by `root` if not None.

(root=None)

Source from the content-addressed store, hash-verified

3198
3199
3200def install_dir(root=None):
3201 '''
3202 Returns install directory used by `install()`.
3203
3204 This will be `sysconfig.get_path('platlib')`, modified by `root` if not
3205 None.
3206 '''
3207 # todo: for pure-python we should use sysconfig.get_path('purelib') ?
3208 root2 = sysconfig.get_path('platlib')
3209 if root:
3210 if windows():
3211 # If we are in a venv, `sysconfig.get_path('platlib')`
3212 # can be absolute, e.g.
3213 # `C:\\...\\venv-pypackage-3.11.1-64\\Lib\\site-packages`, so it's
3214 # not clear how to append it to `root`. So we just use `root`.
3215 return root
3216 else:
3217 # E.g. if `root` is `install' and `sysconfig.get_path('platlib')`
3218 # is `/usr/local/lib/python3.9/site-packages`, we set `root2` to
3219 # `install/usr/local/lib/python3.9/site-packages`.
3220 #
3221 return os.path.join( root, root2.lstrip( os.sep))
3222 else:
3223 return root2
3224
3225
3226class _Record:

Callers 1

installMethod · 0.85

Calls 1

windowsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…