Lines Matching refs:prefix
63 # If None, 'prefix' and 'exec_prefix' may be updated in config
80 # (prefix), containing the common .py and .pyc files, and the platform
82 # modules. Note that prefix and exec_prefix can be the same directory,
85 # This script carries out separate searches for prefix and exec_prefix.
87 # file or directory is found. If no prefix or exec_prefix is found, a
112 # performed for prefix and for exec_prefix, but with different landmarks.
116 # property to override the executable dir used later for prefix searches.
133 # prefix is then found by searching up for a file that should only
134 # exist in the source tree, and the stdlib dir is set to prefix/Lib.
138 # is assumed to point to prefix and exec_prefix. $PYTHONHOME can be a
139 # single directory, which is used for both, or the prefix and exec_prefix
142 # Step 5. Try to find prefix and exec_prefix relative to executable_dir,
144 # step to succeed. Note that if prefix and exec_prefix are different,
146 # subdirectory of prefix, both will be found.
154 # Well, almost. Once we have determined prefix and exec_prefix, the
156 # relative path on PYTHONPATH is prefixed with prefix. Then the directory
159 # in a build directory, both prefix and exec_prefix are reset to the
160 # corresponding preprocessor variables (so sys.prefix will reflect the
163 # known use of sys.prefix and sys.exec_prefix is for the ILU installation
208 def search_up(prefix, *landmarks, test=isfile):
209 while prefix:
210 if any(test(joinpath(prefix, f)) for f in landmarks):
211 return prefix
212 prefix = dirname(prefix)
223 prefix = config.get('prefix')
305 # use the argv0 path for prefix calculation
430 # This is the directory used to find prefix/exec_prefix if necessary.
485 # Detect a build marker and use it to infer prefix, exec_prefix,
512 # Always use the build prefix for stdlib
517 # Only use the build prefix for prefix if it hasn't already been set
518 if not prefix:
519 prefix = build_stdlib_prefix
520 # Do not warn, because 'prefix' never equals 'build_prefix' on POSIX
521 #elif not venv_prefix and prefix != build_prefix:
522 # warn('Detected development environment but prefix is already set')
532 # CALCULATE prefix AND exec_prefix
536 # As documented, calling Py_SetPath will force both prefix
538 prefix = exec_prefix = ''
541 # Read prefix and exec_prefix from explicitly set home
544 # split into prefix:exec_prefix
545 prefix, had_delim, exec_prefix = home.partition(DELIM)
547 exec_prefix = prefix
552 # First try to detect prefix by looking alongside our runtime library, if known
553 if library and not prefix:
559 prefix = library_dir
561 prefix = search_up(library_dir, ZIP_LANDMARK)
562 if STDLIB_SUBDIR and STDLIB_LANDMARKS and not prefix:
564 prefix = library_dir
565 stdlib_dir = joinpath(prefix, STDLIB_SUBDIR)
568 # Detect prefix by looking for zip file
569 if ZIP_LANDMARK and executable_dir and not prefix:
573 prefix = executable_dir
575 prefix = search_up(executable_dir, ZIP_LANDMARK)
576 if prefix:
577 stdlib_dir = joinpath(prefix, STDLIB_SUBDIR)
582 # Detect prefix by searching from our executable location for the stdlib_dir
583 if STDLIB_SUBDIR and STDLIB_LANDMARKS and executable_dir and not prefix:
584 prefix = search_up(executable_dir, *STDLIB_LANDMARKS)
585 if prefix and not stdlib_dir:
586 stdlib_dir = joinpath(prefix, STDLIB_SUBDIR)
588 if PREFIX and not prefix:
589 prefix = PREFIX
590 if not any(isfile(joinpath(prefix, f)) for f in STDLIB_LANDMARKS):
591 warn('Could not find platform independent libraries <prefix>')
593 if not prefix:
594 prefix = abspath('')
595 warn('Could not find platform independent libraries <prefix>')
603 # (that is, prefix) rather than the executable (that is, executable_dir)
604 exec_prefix = prefix
625 # Fallback: assume exec_prefix == prefix
627 exec_prefix = prefix
630 if not prefix or not exec_prefix:
631 warn('Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]')
634 # For a venv, update the main prefix/exec_prefix but leave the base ones unchanged
635 # XXX: We currently do not update prefix here, but it happens in site.py
637 # base_prefix = prefix
639 # prefix = exec_prefix = venv_prefix
664 # QUIRK: Windows uses the library directory rather than the prefix
671 # QUIRK: POSIX uses the default prefix when in the build directory
674 pythonpath.append(joinpath(prefix, ZIP_LANDMARK))
709 pythonpath.append(joinpath(prefix, p))
712 if not stdlib_dir and prefix:
713 stdlib_dir = joinpath(prefix, STDLIB_SUBDIR)
740 # POSIX prefix/exec_prefix QUIRKS
743 # QUIRK: Non-Windows replaces prefix/exec_prefix with defaults when running
746 prefix = config.get('prefix') or PREFIX
747 exec_prefix = config.get('exec_prefix') or EXEC_PREFIX or prefix
781 config['prefix'] = prefix
783 config['base_prefix'] = base_prefix or prefix