Mercurial > repos > guerler > hhblits
comparison lib/python3.8/site-packages/pip/_internal/models/selection_prefs.py @ 1:64071f2a4cf0 draft default tip
Deleted selected files
author | guerler |
---|---|
date | Mon, 27 Jul 2020 03:55:49 -0400 |
parents | 9e54283cc701 |
children |
comparison
equal
deleted
inserted
replaced
0:9e54283cc701 | 1:64071f2a4cf0 |
---|---|
1 from pip._internal.utils.typing import MYPY_CHECK_RUNNING | |
2 | |
3 if MYPY_CHECK_RUNNING: | |
4 from typing import Optional | |
5 from pip._internal.models.format_control import FormatControl | |
6 | |
7 | |
8 class SelectionPreferences(object): | |
9 | |
10 """ | |
11 Encapsulates the candidate selection preferences for downloading | |
12 and installing files. | |
13 """ | |
14 | |
15 # Don't include an allow_yanked default value to make sure each call | |
16 # site considers whether yanked releases are allowed. This also causes | |
17 # that decision to be made explicit in the calling code, which helps | |
18 # people when reading the code. | |
19 def __init__( | |
20 self, | |
21 allow_yanked, # type: bool | |
22 allow_all_prereleases=False, # type: bool | |
23 format_control=None, # type: Optional[FormatControl] | |
24 prefer_binary=False, # type: bool | |
25 ignore_requires_python=None, # type: Optional[bool] | |
26 ): | |
27 # type: (...) -> None | |
28 """Create a SelectionPreferences object. | |
29 | |
30 :param allow_yanked: Whether files marked as yanked (in the sense | |
31 of PEP 592) are permitted to be candidates for install. | |
32 :param format_control: A FormatControl object or None. Used to control | |
33 the selection of source packages / binary packages when consulting | |
34 the index and links. | |
35 :param prefer_binary: Whether to prefer an old, but valid, binary | |
36 dist over a new source dist. | |
37 :param ignore_requires_python: Whether to ignore incompatible | |
38 "Requires-Python" values in links. Defaults to False. | |
39 """ | |
40 if ignore_requires_python is None: | |
41 ignore_requires_python = False | |
42 | |
43 self.allow_yanked = allow_yanked | |
44 self.allow_all_prereleases = allow_all_prereleases | |
45 self.format_control = format_control | |
46 self.prefer_binary = prefer_binary | |
47 self.ignore_requires_python = ignore_requires_python |