MCPcopy Index your code
hub / github.com/RustPython/RustPython / addusersitepackages

Function addusersitepackages

Lib/site.py:370–383  ·  view source on GitHub ↗

Add a per user site-package to sys.path Each user has its own python directory with site-packages in the home directory.

(known_paths)

Source from the content-addressed store, hash-verified

368 return USER_SITE
369
370def addusersitepackages(known_paths):
371 """Add a per user site-package to sys.path
372
373 Each user has its own python directory with site-packages in the
374 home directory.
375 """
376 # get the per user site-package path
377 # this call will also make sure USER_BASE and USER_SITE are set
378 _trace("Processing user site-packages")
379 user_site = getusersitepackages()
380
381 if ENABLE_USER_SITE and os.path.isdir(user_site):
382 addsitedir(user_site, known_paths)
383 return known_paths
384
385def getsitepackages(prefixes=None):
386 """Returns a list containing all global site-packages directories.

Callers 1

mainFunction · 0.85

Calls 4

_traceFunction · 0.85
getusersitepackagesFunction · 0.85
addsitedirFunction · 0.85
isdirMethod · 0.45

Tested by

no test coverage detected