Let us walk on the 3-isogeny graph
|
Data Structures | |
class | RequirementParts |
Functions | |
Tuple[str, Optional[str]] | _strip_extras (str path) |
Set[str] | convert_extras (Optional[str] extras) |
Tuple[Optional[str], str, Set[str]] | parse_editable (str editable_req) |
None | check_first_requirement_in_file (str filename) |
str | deduce_helpful_msg (str req) |
RequirementParts | parse_req_from_editable (str editable_req) |
InstallRequirement | install_req_from_editable (str editable_req, Optional[Union[InstallRequirement, str]] comes_from=None, *Optional[bool] use_pep517=None, bool isolated=False, Optional[List[str]] global_options=None, Optional[Dict[str, List[str]]] hash_options=None, bool constraint=False, bool user_supplied=False, bool permit_editable_wheels=False, Optional[Dict[str, Union[str, List[str]]]] config_settings=None) |
bool | _looks_like_path (str name) |
Optional[str] | _get_url_from_path (str path, str name) |
RequirementParts | parse_req_from_line (str name, Optional[str] line_source) |
InstallRequirement | install_req_from_line (str name, Optional[Union[str, InstallRequirement]] comes_from=None, *Optional[bool] use_pep517=None, bool isolated=False, Optional[List[str]] global_options=None, Optional[Dict[str, List[str]]] hash_options=None, bool constraint=False, Optional[str] line_source=None, bool user_supplied=False, Optional[Dict[str, Union[str, List[str]]]] config_settings=None) |
InstallRequirement | install_req_from_req_string (str req_string, Optional[InstallRequirement] comes_from=None, bool isolated=False, Optional[bool] use_pep517=None, bool user_supplied=False) |
InstallRequirement | install_req_from_parsed_requirement (ParsedRequirement parsed_req, bool isolated=False, Optional[bool] use_pep517=None, bool user_supplied=False, Optional[Dict[str, Union[str, List[str]]]] config_settings=None) |
InstallRequirement | install_req_from_link_and_ireq (Link link, InstallRequirement ireq) |
Variables | |
logger = logging.getLogger(__name__) | |
operators = Specifier._operators.keys() | |
Backing implementation for InstallRequirement's various constructors The idea here is that these formed a major chunk of InstallRequirement's size so, moving them and support code dedicated to them outside of that class helps creates for better understandability for the rest of the code. These are meant to be used elsewhere within pip to create instances of InstallRequirement.
|
protected |
First, it checks whether a provided path is an installable directory. If it is, returns the path. If false, check if the path is an archive file (such as a .whl). The function checks if the path is a file. If false, if the path has an @, it will treat it as a PEP 440 URL requirement and return the path.
Definition at line 252 of file constructors.py.
References pip._internal.req.constructors._looks_like_path(), and i.
Referenced by pip._internal.req.constructors.parse_req_from_line().
|
protected |
Checks whether the string "looks like" a path on the filesystem. This does not check whether the target actually exists, only judge from the appearance. Returns true if any of the following conditions is true: * a path separator is found (either os.path.sep or os.path.altsep); * a dot is found (which represents the current directory).
Definition at line 233 of file constructors.py.
References i.
Referenced by pip._internal.req.constructors._get_url_from_path().
|
protected |
Definition at line 42 of file constructors.py.
References i.
Referenced by pip._internal.req.constructors.parse_editable(), and pip._internal.req.constructors.parse_req_from_line().
None check_first_requirement_in_file | ( | str | filename | ) |
Check if file is parsable as a requirements file. This is heavily based on ``pkg_resources.parse_requirements``, but simplified to just check the first meaningful line. :raises InvalidRequirement: If the first meaningful line cannot be parsed as an requirement.
Definition at line 115 of file constructors.py.
References i.
Referenced by pip._internal.req.constructors.deduce_helpful_msg().
Set[str] convert_extras | ( | Optional[str] | extras | ) |
Definition at line 54 of file constructors.py.
References i.
Referenced by pip._internal.req.constructors.parse_req_from_line().
str deduce_helpful_msg | ( | str | req | ) |
Returns helpful msg in case requirements file does not exist, or cannot be parsed. :params req: Requirements file path
Definition at line 143 of file constructors.py.
References pip._internal.req.constructors.check_first_requirement_in_file(), and i.
Referenced by pip._internal.req.constructors.parse_req_from_line().
InstallRequirement install_req_from_editable | ( | str | editable_req, |
Optional[Union[InstallRequirement, str]] | comes_from = None , |
||
*Optional[bool] | use_pep517 = None , |
||
bool | isolated = False , |
||
Optional[List[str]] | global_options = None , |
||
Optional[Dict[str, List[str]]] | hash_options = None , |
||
bool | constraint = False , |
||
bool | user_supplied = False , |
||
bool | permit_editable_wheels = False , |
||
Optional[Dict[str, Union[str, List[str]]]] | config_settings = None |
||
) |
Definition at line 201 of file constructors.py.
References i, and pip._internal.req.constructors.parse_req_from_editable().
InstallRequirement install_req_from_line | ( | str | name, |
Optional[Union[str, InstallRequirement]] | comes_from = None , |
||
*Optional[bool] | use_pep517 = None , |
||
bool | isolated = False , |
||
Optional[List[str]] | global_options = None , |
||
Optional[Dict[str, List[str]]] | hash_options = None , |
||
bool | constraint = False , |
||
Optional[str] | line_source = None , |
||
bool | user_supplied = False , |
||
Optional[Dict[str, Union[str, List[str]]]] | config_settings = None |
||
) |
Creates an InstallRequirement from a name, which might be a requirement, directory containing 'setup.py', filename, or URL. :param line_source: An optional string describing where the line is from, for logging purposes in case of an error.
Definition at line 376 of file constructors.py.
References i, and pip._internal.req.constructors.parse_req_from_line().
InstallRequirement install_req_from_link_and_ireq | ( | Link | link, |
InstallRequirement | ireq | ||
) |
Definition at line 491 of file constructors.py.
References i.
InstallRequirement install_req_from_parsed_requirement | ( | ParsedRequirement | parsed_req, |
bool | isolated = False , |
||
Optional[bool] | use_pep517 = None , |
||
bool | user_supplied = False , |
||
Optional[Dict[str, Union[str, List[str]]]] | config_settings = None |
||
) |
Definition at line 451 of file constructors.py.
References i.
InstallRequirement install_req_from_req_string | ( | str | req_string, |
Optional[InstallRequirement] | comes_from = None , |
||
bool | isolated = False , |
||
Optional[bool] | use_pep517 = None , |
||
bool | user_supplied = False |
||
) |
Definition at line 413 of file constructors.py.
References i.
Tuple[Optional[str], str, Set[str]] parse_editable | ( | str | editable_req | ) |
Parses an editable requirement into: - a requirement name - an URL - extras - editable options Accepted requirements: svn+http://blahblah@rev#egg=Foobar[baz]&subdirectory=version_subdir .[some_extra]
Definition at line 60 of file constructors.py.
References pip._internal.req.constructors._strip_extras(), and i.
Referenced by pip._internal.req.constructors.parse_req_from_editable().
RequirementParts parse_req_from_editable | ( | str | editable_req | ) |
Definition at line 182 of file constructors.py.
References pip._internal.req.constructors.parse_editable().
Referenced by pip._internal.req.constructors.install_req_from_editable().
RequirementParts parse_req_from_line | ( | str | name, |
Optional[str] | line_source | ||
) |
Definition at line 286 of file constructors.py.
References pip._internal.req.constructors._get_url_from_path(), pip._internal.req.constructors._strip_extras(), pip._internal.req.constructors.convert_extras(), pip._internal.req.constructors.deduce_helpful_msg(), and i.
Referenced by pip._internal.req.constructors.install_req_from_line().
logger = logging.getLogger(__name__) |
Definition at line 38 of file constructors.py.
operators = Specifier._operators.keys() |
Definition at line 39 of file constructors.py.