MCPcopy Create free account
hub / github.com/celer-pkg/celer / SitePackagesDir

Method SitePackagesDir

buildtools/setup_python.go:379–391  ·  view source on GitHub ↗

SitePackagesDir returns the relative path from prefix to site-packages. e.g. "lib/python3.10/site-packages" on Linux, "Lib/site-packages" on Windows.

()

Source from the content-addressed store, hash-verified

377// SitePackagesDir returns the relative path from prefix to site-packages.
378// e.g. "lib/python3.10/site-packages" on Linux, "Lib/site-packages" on Windows.
379func (p pythonTool) SitePackagesDir() string {
380 if runtime.GOOS == "windows" {
381 return filepath.Join("Lib", "site-packages")
382 }
383
384 minorVersion := p.version
385 if strings.Count(p.version, ".") > 1 {
386 parts := strings.Split(p.version, ".")
387 minorVersion = parts[0] + "." + parts[1]
388 }
389
390 return filepath.Join("lib", "python"+minorVersion, "site-packages")
391}
392
393// RegisterExprVars registers all Python-related expression variables.
394func (p pythonTool) RegisterExprVars(exprVars *context.ExprVars) {

Callers 1

setupPythonEnvsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected