pythonfinder.models.path module¶
- class pythonfinder.models.path.SystemPath(*, global_search: bool = True, paths: Dict[str, Union[PythonFinder, PathEntry]] = None, executables_tracking: List[PathEntry] = None, python_executables_tracking: Dict[str, PathEntry] = None, path_order: List[str] = None, python_version_dict: Dict[Tuple, Any] = None, version_dict_tracking: Dict[Tuple, List[PathEntry]] = None, only_python: bool = False, pyenv_finder: Optional[PythonFinder] = None, asdf_finder: Optional[PythonFinder] = None, system: bool = False, ignore_unsupported: bool = False, finders_dict: Dict[str, PythonFinder] = None)[source]¶
Bases:
FinderBaseModel
- class Config[source]¶
Bases:
object
- allow_mutation = True¶
- arbitrary_types_allowed = True¶
- include_private_attributes = True¶
- keep_untouched = (<class 'cached_property.cached_property'>,)¶
- validate_assignment = True¶
- asdf_finder: Optional[PythonFinder]¶
- classmethod create(path=None, system=False, only_python=False, global_search=True, ignore_unsupported=True)[source]¶
Create a new
pythonfinder.models.SystemPath
instance.- Parameters
path (str | None) – Search path to prepend when searching, defaults to None
path – str, optional
system (bool) – Whether to use the running python by default instead of searching, defaults to False
only_python (bool) – Whether to search only for python executables, defaults to False
ignore_unsupported (bool) – Whether to ignore unsupported python versions, if False, an error is raised, defaults to True
- Return type
- Returns
A new
pythonfinder.models.SystemPath
instance.
- property executables¶
- executables_tracking: List[PathEntry]¶
- find_all(executable)[source]¶
Search the path for an executable. Return all copies.
- Parameters
executable (str) – Name of the executable
- Return type
- Returns
List[PathEntry]
- find_all_python_versions(major=None, minor=None, patch=None, pre=None, dev=None, arch=None, name=None)[source]¶
- find_python_version(major=None, minor=None, patch=None, pre=None, dev=None, arch=None, name=None, sort_by_path=False)[source]¶
- Return type
- property finders¶
- finders_dict: Dict[str, PythonFinder]¶
- global_search: bool¶
- ignore_unsupported: bool¶
- only_python: bool¶
- path_entries¶
- path_order: List[str]¶
- paths: Dict[str, Union[PythonFinder, PathEntry]]¶
- pyenv_finder: Optional[PythonFinder]¶
- python_executables¶
- python_executables_tracking: Dict[str, PathEntry]¶
- python_version_dict: Dict[Tuple, Any]¶
- system: bool¶
- version_dict¶
- version_dict_tracking: Dict[Tuple, List[PathEntry]]¶