Skip to content

Commit a73c35b

Browse files
committed
Upgrade pip to 24.2
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
1 parent e870e2a commit a73c35b

File tree

597 files changed

+86106
-68963
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

597 files changed

+86106
-68963
lines changed

src/fetchcode/vcs/git.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ def fetch_via_git(url):
3030
domain = parsed_url.netloc
3131
temp = tempfile.mkdtemp()
3232
os.rmdir(temp)
33+
print(url)
34+
print(scheme)
35+
print(Git.schemes)
3336
if scheme not in Git.schemes:
3437
raise Exception("Not a Git based scheme.")
3538

src/fetchcode/vcs/pip.ABOUT

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ copyright: Copyright (c) The Python Software Foundation and the pip authors
44
(see pip-AUTHORS.txt file for a list of pip authors)
55
description: A tool for installing and managing Python packages.
66
notes: this is a copy of pip vendored for stability.
7-
download_url: https://files.pythonhosted.org/packages/08/25/f204a6138dade2f6757b4ae99bc3994aac28a5602c97ddb2a35e0e22fbc4/pip-20.1.1.tar.gz
7+
download_url: https://files.pythonhosted.org/packages/4d/87/fb90046e096a03aeab235e139436b3fe804cdd447ed2093b0d70eba3f7f8/pip-24.2.tar.gz
88
homepage_url: https://pip.pypa.io
99
license_expression: mit AND lgpl-2.1-plus AND python AND mit AND bsd-new AND (bsd-new OR apache-2.0)
1010
AND apache-2.0 AND isc
1111
name: pip
12-
package_url: pkg:pypi/pip@20.1.1
12+
package_url: pkg:pypi/pip@24.2
1313
primary_language: Python
1414
redistribute: yes
1515
track_changes: yes
1616
type: pypi
17-
version: 20.1.1
17+
version: 24.2

src/fetchcode/vcs/pip/__init__.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
1-
from fetchcode.vcs.pip._internal.utils.typing import MYPY_CHECK_RUNNING
1+
from typing import List, Optional
22

3-
if MYPY_CHECK_RUNNING:
4-
from typing import List, Optional
3+
__version__ = "24.2"
54

65

7-
__version__ = "20.1.1"
8-
9-
10-
def main(args=None):
11-
# type: (Optional[List[str]]) -> int
6+
def main(args: Optional[List[str]] = None) -> int:
127
"""This is an internal API only meant for use by pip's own console scripts.
138
149
For additional details, see https://github.com/pypa/pip/issues/7498.
1510
"""
16-
from fetchcode.vcs.pip._internal.utils.entrypoints import _wrapper
11+
from pip._internal.utils.entrypoints import _wrapper
1712

1813
return _wrapper(args)

src/fetchcode/vcs/pip/__main__.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
1-
from __future__ import absolute_import
2-
31
import os
42
import sys
53

64
# Remove '' and current working directory from the first entry
75
# of sys.path, if present to avoid using current directory
86
# in pip commands check, freeze, install, list and show,
97
# when invoked as python -m pip <command>
10-
if sys.path[0] in ('', os.getcwd()):
8+
if sys.path[0] in ("", os.getcwd()):
119
sys.path.pop(0)
1210

1311
# If we are running from a wheel, add the wheel to sys.path
1412
# This allows the usage python pip-*.whl/pip install pip-*.whl
15-
if __package__ == '':
13+
if __package__ == "":
1614
# __file__ is pip-*.whl/pip/__main__.py
1715
# first dirname call strips of '/__main__.py', second strips off '/pip'
1816
# Resulting path is the name of the wheel itself
1917
# Add that to sys.path so we can import pip
2018
path = os.path.dirname(os.path.dirname(__file__))
2119
sys.path.insert(0, path)
2220

23-
from fetchcode.vcs.pip._internal.cli.main import main as _main # isort:skip # noqa
21+
if __name__ == "__main__":
22+
from pip._internal.cli.main import main as _main
2423

25-
if __name__ == '__main__':
2624
sys.exit(_main())
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
"""Execute exactly this copy of pip, within a different environment.
2+
3+
This file is named as it is, to ensure that this module can't be imported via
4+
an import statement.
5+
"""
6+
7+
# /!\ This version compatibility check section must be Python 2 compatible. /!\
8+
9+
import sys
10+
11+
# Copied from pyproject.toml
12+
PYTHON_REQUIRES = (3, 8)
13+
14+
15+
def version_str(version): # type: ignore
16+
return ".".join(str(v) for v in version)
17+
18+
19+
if sys.version_info[:2] < PYTHON_REQUIRES:
20+
raise SystemExit(
21+
"This version of pip does not support python {} (requires >={}).".format(
22+
version_str(sys.version_info[:2]), version_str(PYTHON_REQUIRES)
23+
)
24+
)
25+
26+
# From here on, we can use Python 3 features, but the syntax must remain
27+
# Python 2 compatible.
28+
29+
import runpy # noqa: E402
30+
from importlib.machinery import PathFinder # noqa: E402
31+
from os.path import dirname # noqa: E402
32+
33+
PIP_SOURCES_ROOT = dirname(dirname(__file__))
34+
35+
36+
class PipImportRedirectingFinder:
37+
@classmethod
38+
def find_spec(self, fullname, path=None, target=None): # type: ignore
39+
if fullname != "pip":
40+
return None
41+
42+
spec = PathFinder.find_spec(fullname, [PIP_SOURCES_ROOT], target)
43+
assert spec, (PIP_SOURCES_ROOT, fullname)
44+
return spec
45+
46+
47+
sys.meta_path.insert(0, PipImportRedirectingFinder())
48+
49+
assert __name__ == "__main__", "Cannot run __pip-runner__.py as a non-main module"
50+
runpy.run_module("pip", run_name="__main__", alter_sys=True)
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
import fetchcode.vcs.pip._internal.utils.inject_securetransport # noqa
2-
from fetchcode.vcs.pip._internal.utils.typing import MYPY_CHECK_RUNNING
1+
from typing import List, Optional
32

4-
if MYPY_CHECK_RUNNING:
5-
from typing import Optional, List
3+
from pip._internal.utils import _log
64

5+
# init_logging() must be called before any call to logging.getLogger()
6+
# which happens at import of most modules.
7+
_log.init_logging()
78

8-
def main(args=None):
9-
# type: (Optional[List[str]]) -> int
9+
10+
def main(args: Optional[List[str]] = None) -> int:
1011
"""This is preserved for old console scripts that may still be referencing
1112
it.
1213
1314
For additional details, see https://github.com/pypa/pip/issues/7498.
1415
"""
15-
from fetchcode.vcs.pip._internal.utils.entrypoints import _wrapper
16+
from pip._internal.utils.entrypoints import _wrapper
1617

1718
return _wrapper(args)

0 commit comments

Comments
 (0)