Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
Classes | Functions | Variables
pip._internal.req.constructors Namespace Reference

Classes

class  RequirementParts
 

Functions

Tuple[str, Optional[str]] _strip_extras (str path)
 
Set[str] convert_extras (Optional[str] extras)
 
Requirement _set_requirement_extras (Requirement req, Set[str] new_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)
 
InstallRequirement install_req_drop_extras (InstallRequirement ireq)
 
InstallRequirement install_req_extend_extras (InstallRequirement ireq, Collection[str] extras)
 

Variables

 logger = logging.getLogger(__name__)
 
 operators = Specifier._operators.keys()
 

Detailed Description

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.

Function Documentation

◆ _get_url_from_path()

Optional[str] pip._internal.req.constructors._get_url_from_path ( str  path,
str  name 
)
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.

◆ _looks_like_path()

bool pip._internal.req.constructors._looks_like_path ( str  name)
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).

◆ _set_requirement_extras()

Requirement pip._internal.req.constructors._set_requirement_extras ( Requirement  req,
Set[str]  new_extras 
)
protected
Returns a new requirement based on the given one, with the supplied extras. If the
given requirement already has extras those are replaced (or dropped if no new extras
are given).

◆ check_first_requirement_in_file()

None pip._internal.req.constructors.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.

◆ deduce_helpful_msg()

str pip._internal.req.constructors.deduce_helpful_msg ( str  req)
Returns helpful msg in case requirements file does not exist,
or cannot be parsed.

:params req: Requirements file path

◆ install_req_drop_extras()

InstallRequirement pip._internal.req.constructors.install_req_drop_extras ( InstallRequirement  ireq)
Creates a new InstallationRequirement using the given template but without
any extras. Sets the original requirement as the new one's parent
(comes_from).

◆ install_req_extend_extras()

InstallRequirement pip._internal.req.constructors.install_req_extend_extras ( InstallRequirement  ireq,
Collection[str]  extras 
)
Returns a copy of an installation requirement with some additional extras.
Makes a shallow copy of the ireq object.

◆ install_req_from_line()

InstallRequirement pip._internal.req.constructors.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.

◆ parse_editable()

Tuple[Optional[str], str, Set[str]] pip._internal.req.constructors.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]