forked from aboutcode-org/fetchcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump pip's src from 20.1.1 to 21.2.4
WARNING: fetchcode's vcs will not work on this commit. This is result of separating pip's code from changes made in scope of this repository. This should make it easier to track potentially replicated issues from pip when taking their vcs pkg. It also made cleaning up easier, due to some maintenance activities done in pip: - dropping Python 2 & 3.5 support pypa/pip#9189 - modernized code after above - partially done, tracked in: pypa/pip#8802 - added py3.9 support - updated vendored libraries (e.g. fixing CVE-2021-28363) multiple PRs pip._internal.vcs (and related code) changes: - Fetch resources that are missing locally: pypa/pip#8817 - Improve SVN version parser (Windows) pypa/pip#8665 - Always close stderr after subprocess completion: pypa/pip#9156 - Remove vcs export feature: pypa/pip#9713 - Remove support for git+ssh@ scheme in favour of git+ssh:// pypa/pip#9436 - Security fix in git tags parsing (CVE-2021-3572): pypa/pip#9827 - Reimplement Git version parsing: pypa/pip#10117 In next commits, most of pip's internals will be removed from fetchcode, leaving only vcs module with supporting code (like utils functions, tests (which will be added & submitted with this change)) This will allow for changes such as ability to add return codes (probably via futures) from long running downloads and other features. Switching to having own vcs module might also be a good call due to pip._internal.vcs close integration with pip's cli in vcs module (some pip code has been commented out in commit mentioned below) While generally copy-pasting code without history is bad idea, this commit follows precedence set in this repo by: 8046215 with exception that all changes to pip's code will be submitted as separate commits. It has been agreed with @pombredanne & @TG1999 that history from pip will be rebased on fetchcode by @pombredanne (thanks!). It will be done only for the files that are of concern for fetchcode to limit noise in git history. I'm leaving this commit without SoB intentionally, as this is not my work, but that of the many pip's authors: https://github.com/pypa/pip/blob/21.2.4/AUTHORS.txt License of pip: MIT (https://pypi.org/project/pip/)
- Loading branch information
1 parent
ab65b2e
commit f446856
Showing
312 changed files
with
58,271 additions
and
18,370 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,13 @@ | ||
from fetchcode.vcs.pip._internal.utils.typing import MYPY_CHECK_RUNNING | ||
from typing import List, Optional | ||
|
||
if MYPY_CHECK_RUNNING: | ||
from typing import List, Optional | ||
__version__ = "21.2.4" | ||
|
||
|
||
__version__ = "20.1.1" | ||
|
||
|
||
def main(args=None): | ||
# type: (Optional[List[str]]) -> int | ||
def main(args: Optional[List[str]] = None) -> int: | ||
"""This is an internal API only meant for use by pip's own console scripts. | ||
For additional details, see https://github.com/pypa/pip/issues/7498. | ||
""" | ||
from fetchcode.vcs.pip._internal.utils.entrypoints import _wrapper | ||
from pip._internal.utils.entrypoints import _wrapper | ||
|
||
return _wrapper(args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,31 @@ | ||
from __future__ import absolute_import | ||
|
||
import os | ||
import sys | ||
import warnings | ||
|
||
# Remove '' and current working directory from the first entry | ||
# of sys.path, if present to avoid using current directory | ||
# in pip commands check, freeze, install, list and show, | ||
# when invoked as python -m pip <command> | ||
if sys.path[0] in ('', os.getcwd()): | ||
if sys.path[0] in ("", os.getcwd()): | ||
sys.path.pop(0) | ||
|
||
# If we are running from a wheel, add the wheel to sys.path | ||
# This allows the usage python pip-*.whl/pip install pip-*.whl | ||
if __package__ == '': | ||
if __package__ == "": | ||
# __file__ is pip-*.whl/pip/__main__.py | ||
# first dirname call strips of '/__main__.py', second strips off '/pip' | ||
# Resulting path is the name of the wheel itself | ||
# Add that to sys.path so we can import pip | ||
path = os.path.dirname(os.path.dirname(__file__)) | ||
sys.path.insert(0, path) | ||
|
||
from fetchcode.vcs.pip._internal.cli.main import main as _main # isort:skip # noqa | ||
if __name__ == "__main__": | ||
# Work around the error reported in #9540, pending a proper fix. | ||
# Note: It is essential the warning filter is set *before* importing | ||
# pip, as the deprecation happens at import time, not runtime. | ||
warnings.filterwarnings( | ||
"ignore", category=DeprecationWarning, module=".*packaging\\.version" | ||
) | ||
from pip._internal.cli.main import main as _main | ||
|
||
if __name__ == '__main__': | ||
sys.exit(_main()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
import fetchcode.vcs.pip._internal.utils.inject_securetransport # noqa | ||
from fetchcode.vcs.pip._internal.utils.typing import MYPY_CHECK_RUNNING | ||
from typing import List, Optional | ||
|
||
if MYPY_CHECK_RUNNING: | ||
from typing import Optional, List | ||
import pip._internal.utils.inject_securetransport # noqa | ||
from pip._internal.utils import _log | ||
|
||
# init_logging() must be called before any call to logging.getLogger() | ||
# which happens at import of most modules. | ||
_log.init_logging() | ||
|
||
def main(args=None): | ||
# type: (Optional[List[str]]) -> int | ||
|
||
def main(args: (Optional[List[str]]) = None) -> int: | ||
"""This is preserved for old console scripts that may still be referencing | ||
it. | ||
For additional details, see https://github.com/pypa/pip/issues/7498. | ||
""" | ||
from fetchcode.vcs.pip._internal.utils.entrypoints import _wrapper | ||
from pip._internal.utils.entrypoints import _wrapper | ||
|
||
return _wrapper(args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.