pip 25.2__py3-none-any.whl → 26.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. pip/__init__.py +1 -1
  2. pip/_internal/__init__.py +0 -0
  3. pip/_internal/build_env.py +265 -8
  4. pip/_internal/cache.py +1 -1
  5. pip/_internal/cli/base_command.py +11 -0
  6. pip/_internal/cli/cmdoptions.py +200 -71
  7. pip/_internal/cli/index_command.py +20 -0
  8. pip/_internal/cli/main.py +11 -6
  9. pip/_internal/cli/main_parser.py +3 -1
  10. pip/_internal/cli/parser.py +96 -36
  11. pip/_internal/cli/progress_bars.py +4 -2
  12. pip/_internal/cli/req_command.py +126 -30
  13. pip/_internal/commands/cache.py +24 -0
  14. pip/_internal/commands/completion.py +2 -1
  15. pip/_internal/commands/download.py +12 -11
  16. pip/_internal/commands/index.py +13 -6
  17. pip/_internal/commands/install.py +55 -43
  18. pip/_internal/commands/list.py +14 -16
  19. pip/_internal/commands/lock.py +19 -14
  20. pip/_internal/commands/wheel.py +13 -23
  21. pip/_internal/configuration.py +1 -2
  22. pip/_internal/distributions/sdist.py +13 -14
  23. pip/_internal/exceptions.py +96 -6
  24. pip/_internal/index/collector.py +2 -3
  25. pip/_internal/index/package_finder.py +87 -21
  26. pip/_internal/locations/__init__.py +1 -2
  27. pip/_internal/locations/_sysconfig.py +4 -1
  28. pip/_internal/metadata/__init__.py +7 -2
  29. pip/_internal/metadata/importlib/_dists.py +8 -2
  30. pip/_internal/models/link.py +18 -14
  31. pip/_internal/models/release_control.py +92 -0
  32. pip/_internal/models/selection_prefs.py +6 -3
  33. pip/_internal/models/wheel.py +5 -66
  34. pip/_internal/network/auth.py +6 -2
  35. pip/_internal/network/cache.py +6 -11
  36. pip/_internal/network/download.py +4 -5
  37. pip/_internal/network/lazy_wheel.py +5 -3
  38. pip/_internal/network/session.py +14 -10
  39. pip/_internal/operations/build/wheel.py +4 -4
  40. pip/_internal/operations/build/wheel_editable.py +4 -4
  41. pip/_internal/operations/install/wheel.py +1 -2
  42. pip/_internal/operations/prepare.py +9 -4
  43. pip/_internal/pyproject.py +2 -61
  44. pip/_internal/req/__init__.py +1 -3
  45. pip/_internal/req/constructors.py +45 -39
  46. pip/_internal/req/pep723.py +41 -0
  47. pip/_internal/req/req_file.py +10 -2
  48. pip/_internal/req/req_install.py +32 -141
  49. pip/_internal/resolution/resolvelib/candidates.py +20 -11
  50. pip/_internal/resolution/resolvelib/factory.py +43 -1
  51. pip/_internal/resolution/resolvelib/provider.py +9 -0
  52. pip/_internal/resolution/resolvelib/reporter.py +21 -8
  53. pip/_internal/resolution/resolvelib/requirements.py +7 -3
  54. pip/_internal/resolution/resolvelib/resolver.py +2 -6
  55. pip/_internal/self_outdated_check.py +17 -16
  56. pip/_internal/utils/datetime.py +18 -0
  57. pip/_internal/utils/filesystem.py +52 -1
  58. pip/_internal/utils/logging.py +34 -2
  59. pip/_internal/utils/misc.py +18 -12
  60. pip/_internal/utils/pylock.py +116 -0
  61. pip/_internal/utils/unpacking.py +26 -1
  62. pip/_internal/vcs/versioncontrol.py +3 -1
  63. pip/_internal/wheel_builder.py +23 -96
  64. pip/_vendor/README.rst +180 -0
  65. pip/_vendor/cachecontrol/LICENSE.txt +13 -0
  66. pip/_vendor/cachecontrol/__init__.py +6 -3
  67. pip/_vendor/cachecontrol/adapter.py +0 -1
  68. pip/_vendor/cachecontrol/controller.py +1 -1
  69. pip/_vendor/cachecontrol/filewrapper.py +3 -1
  70. pip/_vendor/certifi/LICENSE +20 -0
  71. pip/_vendor/certifi/__init__.py +1 -1
  72. pip/_vendor/certifi/cacert.pem +62 -372
  73. pip/_vendor/dependency_groups/LICENSE.txt +9 -0
  74. pip/_vendor/distlib/LICENSE.txt +284 -0
  75. pip/_vendor/distro/LICENSE +202 -0
  76. pip/_vendor/idna/LICENSE.md +31 -0
  77. pip/_vendor/idna/codec.py +1 -1
  78. pip/_vendor/idna/core.py +1 -1
  79. pip/_vendor/idna/idnadata.py +72 -6
  80. pip/_vendor/idna/package_data.py +1 -1
  81. pip/_vendor/idna/uts46data.py +891 -731
  82. pip/_vendor/msgpack/COPYING +14 -0
  83. pip/_vendor/msgpack/__init__.py +2 -2
  84. pip/_vendor/packaging/LICENSE +3 -0
  85. pip/_vendor/packaging/LICENSE.APACHE +177 -0
  86. pip/_vendor/packaging/LICENSE.BSD +23 -0
  87. pip/_vendor/packaging/__init__.py +1 -1
  88. pip/_vendor/packaging/_elffile.py +0 -1
  89. pip/_vendor/packaging/_manylinux.py +36 -36
  90. pip/_vendor/packaging/_musllinux.py +1 -1
  91. pip/_vendor/packaging/_parser.py +22 -10
  92. pip/_vendor/packaging/_structures.py +8 -0
  93. pip/_vendor/packaging/_tokenizer.py +23 -25
  94. pip/_vendor/packaging/licenses/__init__.py +13 -11
  95. pip/_vendor/packaging/licenses/_spdx.py +41 -1
  96. pip/_vendor/packaging/markers.py +64 -38
  97. pip/_vendor/packaging/metadata.py +143 -27
  98. pip/_vendor/packaging/pylock.py +635 -0
  99. pip/_vendor/packaging/requirements.py +5 -10
  100. pip/_vendor/packaging/specifiers.py +219 -170
  101. pip/_vendor/packaging/tags.py +15 -20
  102. pip/_vendor/packaging/utils.py +19 -24
  103. pip/_vendor/packaging/version.py +315 -105
  104. pip/_vendor/pkg_resources/LICENSE +17 -0
  105. pip/_vendor/platformdirs/LICENSE +21 -0
  106. pip/_vendor/platformdirs/api.py +1 -1
  107. pip/_vendor/platformdirs/macos.py +10 -8
  108. pip/_vendor/platformdirs/version.py +16 -3
  109. pip/_vendor/platformdirs/windows.py +7 -1
  110. pip/_vendor/pygments/LICENSE +25 -0
  111. pip/_vendor/pyproject_hooks/LICENSE +21 -0
  112. pip/_vendor/requests/LICENSE +175 -0
  113. pip/_vendor/requests/__version__.py +2 -2
  114. pip/_vendor/requests/adapters.py +17 -40
  115. pip/_vendor/requests/sessions.py +1 -1
  116. pip/_vendor/resolvelib/LICENSE +13 -0
  117. pip/_vendor/resolvelib/__init__.py +1 -1
  118. pip/_vendor/resolvelib/resolvers/abstract.py +3 -3
  119. pip/_vendor/resolvelib/resolvers/resolution.py +5 -0
  120. pip/_vendor/rich/LICENSE +19 -0
  121. pip/_vendor/rich/style.py +7 -11
  122. pip/_vendor/tomli/LICENSE +21 -0
  123. pip/_vendor/tomli/__init__.py +1 -1
  124. pip/_vendor/tomli/_parser.py +28 -21
  125. pip/_vendor/tomli/_re.py +8 -5
  126. pip/_vendor/tomli_w/LICENSE +21 -0
  127. pip/_vendor/truststore/LICENSE +21 -0
  128. pip/_vendor/truststore/__init__.py +1 -1
  129. pip/_vendor/truststore/_api.py +14 -6
  130. pip/_vendor/truststore/_openssl.py +3 -1
  131. pip/_vendor/urllib3/LICENSE.txt +21 -0
  132. pip/_vendor/vendor.txt +11 -11
  133. {pip-25.2.dist-info → pip-26.0.dist-info}/METADATA +10 -11
  134. {pip-25.2.dist-info → pip-26.0.dist-info}/RECORD +158 -139
  135. {pip-25.2.dist-info → pip-26.0.dist-info}/WHEEL +1 -2
  136. pip-26.0.dist-info/entry_points.txt +4 -0
  137. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/AUTHORS.txt +27 -0
  138. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/src/pip/_vendor/idna/LICENSE.md +1 -1
  139. pip/_internal/models/pylock.py +0 -188
  140. pip/_internal/operations/build/metadata_legacy.py +0 -73
  141. pip/_internal/operations/build/wheel_legacy.py +0 -119
  142. pip/_internal/operations/install/editable_legacy.py +0 -48
  143. pip/_internal/utils/setuptools_build.py +0 -149
  144. pip-25.2.dist-info/entry_points.txt +0 -3
  145. pip-25.2.dist-info/licenses/src/pip/_vendor/tomli/LICENSE-HEADER +0 -3
  146. pip-25.2.dist-info/top_level.txt +0 -1
  147. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/LICENSE.txt +0 -0
  148. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/src/pip/_vendor/cachecontrol/LICENSE.txt +0 -0
  149. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/src/pip/_vendor/certifi/LICENSE +0 -0
  150. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/src/pip/_vendor/dependency_groups/LICENSE.txt +0 -0
  151. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/src/pip/_vendor/distlib/LICENSE.txt +0 -0
  152. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/src/pip/_vendor/distro/LICENSE +0 -0
  153. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/src/pip/_vendor/msgpack/COPYING +0 -0
  154. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/src/pip/_vendor/packaging/LICENSE +0 -0
  155. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/src/pip/_vendor/packaging/LICENSE.APACHE +0 -0
  156. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/src/pip/_vendor/packaging/LICENSE.BSD +0 -0
  157. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/src/pip/_vendor/pkg_resources/LICENSE +0 -0
  158. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/src/pip/_vendor/platformdirs/LICENSE +0 -0
  159. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/src/pip/_vendor/pygments/LICENSE +0 -0
  160. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/src/pip/_vendor/pyproject_hooks/LICENSE +0 -0
  161. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/src/pip/_vendor/requests/LICENSE +0 -0
  162. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/src/pip/_vendor/resolvelib/LICENSE +0 -0
  163. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/src/pip/_vendor/rich/LICENSE +0 -0
  164. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/src/pip/_vendor/tomli/LICENSE +0 -0
  165. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/src/pip/_vendor/tomli_w/LICENSE +0 -0
  166. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/src/pip/_vendor/truststore/LICENSE +0 -0
  167. {pip-25.2.dist-info → pip-26.0.dist-info}/licenses/src/pip/_vendor/urllib3/LICENSE.txt +0 -0
@@ -1,6 +1,7 @@
1
1
  @Switch01
2
2
  A_Rog
3
3
  Aakanksha Agrawal
4
+ Aarni Koskela
4
5
  Abhinav Sagar
5
6
  ABHYUDAY PRATAP SINGH
6
7
  abs51295
@@ -24,6 +25,7 @@ albertg
24
25
  Alberto Sottile
25
26
  Aleks Bunin
26
27
  Ales Erjavec
28
+ Alessandro Molina
27
29
  Alethea Flowers
28
30
  Alex Gaynor
29
31
  Alex Grönholm
@@ -37,6 +39,7 @@ Alexandre Conrad
37
39
  Alexey Popravka
38
40
  Aleš Erjavec
39
41
  Alli
42
+ Aman
40
43
  Ami Fischman
41
44
  Ananya Maiti
42
45
  Anatoly Techtonik
@@ -56,6 +59,7 @@ Aniruddha Basak
56
59
  Anish Tambe
57
60
  Anrs Hu
58
61
  Anthony Sottile
62
+ Antoine Lambert
59
63
  Antoine Musso
60
64
  Anton Ovchinnikov
61
65
  Anton Patrushev
@@ -188,6 +192,7 @@ Dane Hillard
188
192
  daniel
189
193
  Daniel Collins
190
194
  Daniel Hahler
195
+ Daniel Hollas
191
196
  Daniel Holth
192
197
  Daniel Jost
193
198
  Daniel Katz
@@ -236,6 +241,7 @@ Dimitri Merejkowsky
236
241
  Dimitri Papadopoulos
237
242
  Dimitri Papadopoulos Orfanos
238
243
  Dirk Stolle
244
+ dkjsone
239
245
  Dmitry Gladkov
240
246
  Dmitry Volodin
241
247
  Domen Kožar
@@ -314,6 +320,7 @@ gousaiyang
314
320
  gpiks
315
321
  Greg Roodt
316
322
  Greg Ward
323
+ Guido Diepen
317
324
  Guilherme Espada
318
325
  Guillaume Seguin
319
326
  gutsytechster
@@ -323,8 +330,10 @@ gzpan123
323
330
  Hanjun Kim
324
331
  Hari Charan
325
332
  Harsh Vardhan
333
+ Harsha Sai
326
334
  harupy
327
335
  Harutaka Kawamura
336
+ Hasan-8326
328
337
  hauntsaninja
329
338
  Henrich Hartzer
330
339
  Henry Schreiner
@@ -347,6 +356,7 @@ Igor Sobreira
347
356
  Ikko Ashimine
348
357
  Ilan Schnell
349
358
  Illia Volochii
359
+ Ilya Abdolmanafi
350
360
  Ilya Baryshev
351
361
  Inada Naoki
352
362
  Ionel Cristian Mărieș
@@ -364,6 +374,7 @@ Jakub Kuczys
364
374
  Jakub Stasiak
365
375
  Jakub Vysoky
366
376
  Jakub Wilk
377
+ James
367
378
  James Cleveland
368
379
  James Curtin
369
380
  James Firth
@@ -420,12 +431,14 @@ Josh Hansen
420
431
  Josh Schneier
421
432
  Joshua
422
433
  JoshuaPerdue
434
+ Jost Migenda
423
435
  Juan Luis Cano Rodríguez
424
436
  Juanjo Bazán
425
437
  Judah Rand
426
438
  Julian Berman
427
439
  Julian Gethmann
428
440
  Julien Demoor
441
+ Julien Stephan
429
442
  July Tikhonov
430
443
  Jussi Kukkonen
431
444
  Justin van Heek
@@ -437,6 +450,7 @@ Kamal Bin Mustafa
437
450
  Karolina Surma
438
451
  kasium
439
452
  kaustav haldar
453
+ Kaz Nishimura
440
454
  keanemind
441
455
  Keith Maxwell
442
456
  Kelsey Hightower
@@ -482,6 +496,7 @@ luojiebin
482
496
  luz.paz
483
497
  László Kiss Kollár
484
498
  M00nL1ght
499
+ MajorTanya
485
500
  Malcolm Smith
486
501
  Marc Abramowitz
487
502
  Marc Tamlyn
@@ -498,6 +513,7 @@ Martin Pavlasek
498
513
  Masaki
499
514
  Masklinn
500
515
  Matej Stuchlik
516
+ Mateusz Sokół
501
517
  Mathew Jennings
502
518
  Mathieu Bridon
503
519
  Mathieu Kniewallner
@@ -525,6 +541,7 @@ mayeut
525
541
  mbaluna
526
542
  Md Sujauddin Sekh
527
543
  mdebi
544
+ Meet Vasita
528
545
  memoselyk
529
546
  meowmeowcat
530
547
  Michael
@@ -549,6 +566,7 @@ Monty Taylor
549
566
  morotti
550
567
  mrKazzila
551
568
  Muha Ajjan
569
+ MUTHUSRIHEMADHARSHINI S A
552
570
  Nadav Wexler
553
571
  Nahuel Ambrosini
554
572
  Nate Coraor
@@ -573,6 +591,7 @@ Nitesh Sharma
573
591
  Niyas Sait
574
592
  Noah
575
593
  Noah Gorny
594
+ Nothing-991
576
595
  Nowell Strite
577
596
  NtaleGrey
578
597
  nucccc
@@ -593,8 +612,10 @@ Omry Yadan
593
612
  onlinejudge95
594
613
  Oren Held
595
614
  Oscar Benjamin
615
+ oxygen dioxide
596
616
  Oz N Tiram
597
617
  Pachwenko
618
+ Paresh Joshi
598
619
  Patrick Dubroy
599
620
  Patrick Jenkins
600
621
  Patrick Lawson
@@ -714,6 +735,7 @@ Shivansh-007
714
735
  Shixian Sheng
715
736
  Shlomi Fish
716
737
  Shovan Maity
738
+ Shubham Nagure
717
739
  Simeon Visser
718
740
  Simon Cross
719
741
  Simon Pichugin
@@ -728,6 +750,7 @@ Stavros Korokithakis
728
750
  Stefan Scherfke
729
751
  Stefano Rivera
730
752
  Stephan Erb
753
+ Stephane Chazelas
731
754
  Stephen Payne
732
755
  Stephen Rosen
733
756
  stepshal
@@ -751,6 +774,7 @@ Sylvain
751
774
  Takayuki SHIMIZUKAWA
752
775
  Taneli Hukkinen
753
776
  tbeswick
777
+ Terrance
754
778
  Thiago
755
779
  Thijs Triemstra
756
780
  Thomas Fenzl
@@ -799,6 +823,7 @@ Vitaly Babiy
799
823
  Vladimir Fokow
800
824
  Vladimir Rutsky
801
825
  W. Trevor King
826
+ Weida Hong
802
827
  Wil Tan
803
828
  Wilfred Hughes
804
829
  William Edwards
@@ -816,6 +841,8 @@ Xianpeng Shen
816
841
  xoviat
817
842
  xtreak
818
843
  YAMAMOTO Takashi
844
+ Yash
845
+ Yashraj
819
846
  Yen Chi Hsuan
820
847
  Yeray Diaz Diaz
821
848
  Yoval P
@@ -1,6 +1,6 @@
1
1
  BSD 3-Clause License
2
2
 
3
- Copyright (c) 2013-2024, Kim Davies and contributors.
3
+ Copyright (c) 2013-2025, Kim Davies and contributors.
4
4
  All rights reserved.
5
5
 
6
6
  Redistribution and use in source and binary forms, with or without
@@ -1,188 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import dataclasses
4
- import re
5
- from collections.abc import Iterable
6
- from dataclasses import dataclass
7
- from pathlib import Path
8
- from typing import TYPE_CHECKING, Any
9
-
10
- from pip._vendor import tomli_w
11
-
12
- from pip._internal.models.direct_url import ArchiveInfo, DirInfo, VcsInfo
13
- from pip._internal.models.link import Link
14
- from pip._internal.req.req_install import InstallRequirement
15
- from pip._internal.utils.urls import url_to_path
16
-
17
- if TYPE_CHECKING:
18
- from typing_extensions import Self
19
-
20
- PYLOCK_FILE_NAME_RE = re.compile(r"^pylock\.([^.]+)\.toml$")
21
-
22
-
23
- def is_valid_pylock_file_name(path: Path) -> bool:
24
- return path.name == "pylock.toml" or bool(re.match(PYLOCK_FILE_NAME_RE, path.name))
25
-
26
-
27
- def _toml_dict_factory(data: list[tuple[str, Any]]) -> dict[str, Any]:
28
- return {key.replace("_", "-"): value for key, value in data if value is not None}
29
-
30
-
31
- @dataclass
32
- class PackageVcs:
33
- type: str
34
- url: str | None
35
- # (not supported) path: Optional[str]
36
- requested_revision: str | None
37
- commit_id: str
38
- subdirectory: str | None
39
-
40
-
41
- @dataclass
42
- class PackageDirectory:
43
- path: str
44
- editable: bool | None
45
- subdirectory: str | None
46
-
47
-
48
- @dataclass
49
- class PackageArchive:
50
- url: str | None
51
- # (not supported) path: Optional[str]
52
- # (not supported) size: Optional[int]
53
- # (not supported) upload_time: Optional[datetime]
54
- hashes: dict[str, str]
55
- subdirectory: str | None
56
-
57
-
58
- @dataclass
59
- class PackageSdist:
60
- name: str
61
- # (not supported) upload_time: Optional[datetime]
62
- url: str | None
63
- # (not supported) path: Optional[str]
64
- # (not supported) size: Optional[int]
65
- hashes: dict[str, str]
66
-
67
-
68
- @dataclass
69
- class PackageWheel:
70
- name: str
71
- # (not supported) upload_time: Optional[datetime]
72
- url: str | None
73
- # (not supported) path: Optional[str]
74
- # (not supported) size: Optional[int]
75
- hashes: dict[str, str]
76
-
77
-
78
- @dataclass
79
- class Package:
80
- name: str
81
- version: str | None = None
82
- # (not supported) marker: Optional[str]
83
- # (not supported) requires_python: Optional[str]
84
- # (not supported) dependencies
85
- vcs: PackageVcs | None = None
86
- directory: PackageDirectory | None = None
87
- archive: PackageArchive | None = None
88
- # (not supported) index: Optional[str]
89
- sdist: PackageSdist | None = None
90
- wheels: list[PackageWheel] | None = None
91
- # (not supported) attestation_identities: Optional[List[Dict[str, Any]]]
92
- # (not supported) tool: Optional[Dict[str, Any]]
93
-
94
- @classmethod
95
- def from_install_requirement(cls, ireq: InstallRequirement, base_dir: Path) -> Self:
96
- base_dir = base_dir.resolve()
97
- dist = ireq.get_dist()
98
- download_info = ireq.download_info
99
- assert download_info
100
- package = cls(name=dist.canonical_name)
101
- if ireq.is_direct:
102
- if isinstance(download_info.info, VcsInfo):
103
- package.vcs = PackageVcs(
104
- type=download_info.info.vcs,
105
- url=download_info.url,
106
- requested_revision=download_info.info.requested_revision,
107
- commit_id=download_info.info.commit_id,
108
- subdirectory=download_info.subdirectory,
109
- )
110
- elif isinstance(download_info.info, DirInfo):
111
- package.directory = PackageDirectory(
112
- path=(
113
- Path(url_to_path(download_info.url))
114
- .resolve()
115
- .relative_to(base_dir)
116
- .as_posix()
117
- ),
118
- editable=(
119
- download_info.info.editable
120
- if download_info.info.editable
121
- else None
122
- ),
123
- subdirectory=download_info.subdirectory,
124
- )
125
- elif isinstance(download_info.info, ArchiveInfo):
126
- if not download_info.info.hashes:
127
- raise NotImplementedError()
128
- package.archive = PackageArchive(
129
- url=download_info.url,
130
- hashes=download_info.info.hashes,
131
- subdirectory=download_info.subdirectory,
132
- )
133
- else:
134
- # should never happen
135
- raise NotImplementedError()
136
- else:
137
- package.version = str(dist.version)
138
- if isinstance(download_info.info, ArchiveInfo):
139
- if not download_info.info.hashes:
140
- raise NotImplementedError()
141
- link = Link(download_info.url)
142
- if link.is_wheel:
143
- package.wheels = [
144
- PackageWheel(
145
- name=link.filename,
146
- url=download_info.url,
147
- hashes=download_info.info.hashes,
148
- )
149
- ]
150
- else:
151
- package.sdist = PackageSdist(
152
- name=link.filename,
153
- url=download_info.url,
154
- hashes=download_info.info.hashes,
155
- )
156
- else:
157
- # should never happen
158
- raise NotImplementedError()
159
- return package
160
-
161
-
162
- @dataclass
163
- class Pylock:
164
- lock_version: str = "1.0"
165
- # (not supported) environments: Optional[List[str]]
166
- # (not supported) requires_python: Optional[str]
167
- # (not supported) extras: List[str] = []
168
- # (not supported) dependency_groups: List[str] = []
169
- created_by: str = "pip"
170
- packages: list[Package] = dataclasses.field(default_factory=list)
171
- # (not supported) tool: Optional[Dict[str, Any]]
172
-
173
- def as_toml(self) -> str:
174
- return tomli_w.dumps(dataclasses.asdict(self, dict_factory=_toml_dict_factory))
175
-
176
- @classmethod
177
- def from_install_requirements(
178
- cls, install_requirements: Iterable[InstallRequirement], base_dir: Path
179
- ) -> Self:
180
- return cls(
181
- packages=sorted(
182
- (
183
- Package.from_install_requirement(ireq, base_dir)
184
- for ireq in install_requirements
185
- ),
186
- key=lambda p: p.name,
187
- )
188
- )
@@ -1,73 +0,0 @@
1
- """Metadata generation logic for legacy source distributions."""
2
-
3
- import logging
4
- import os
5
-
6
- from pip._internal.build_env import BuildEnvironment
7
- from pip._internal.cli.spinners import open_spinner
8
- from pip._internal.exceptions import (
9
- InstallationError,
10
- InstallationSubprocessError,
11
- MetadataGenerationFailed,
12
- )
13
- from pip._internal.utils.setuptools_build import make_setuptools_egg_info_args
14
- from pip._internal.utils.subprocess import call_subprocess
15
- from pip._internal.utils.temp_dir import TempDirectory
16
-
17
- logger = logging.getLogger(__name__)
18
-
19
-
20
- def _find_egg_info(directory: str) -> str:
21
- """Find an .egg-info subdirectory in `directory`."""
22
- filenames = [f for f in os.listdir(directory) if f.endswith(".egg-info")]
23
-
24
- if not filenames:
25
- raise InstallationError(f"No .egg-info directory found in {directory}")
26
-
27
- if len(filenames) > 1:
28
- raise InstallationError(
29
- f"More than one .egg-info directory found in {directory}"
30
- )
31
-
32
- return os.path.join(directory, filenames[0])
33
-
34
-
35
- def generate_metadata(
36
- build_env: BuildEnvironment,
37
- setup_py_path: str,
38
- source_dir: str,
39
- isolated: bool,
40
- details: str,
41
- ) -> str:
42
- """Generate metadata using setup.py-based defacto mechanisms.
43
-
44
- Returns the generated metadata directory.
45
- """
46
- logger.debug(
47
- "Running setup.py (path:%s) egg_info for package %s",
48
- setup_py_path,
49
- details,
50
- )
51
-
52
- egg_info_dir = TempDirectory(kind="pip-egg-info", globally_managed=True).path
53
-
54
- args = make_setuptools_egg_info_args(
55
- setup_py_path,
56
- egg_info_dir=egg_info_dir,
57
- no_user_config=isolated,
58
- )
59
-
60
- with build_env:
61
- with open_spinner("Preparing metadata (setup.py)") as spinner:
62
- try:
63
- call_subprocess(
64
- args,
65
- cwd=source_dir,
66
- command_desc="python setup.py egg_info",
67
- spinner=spinner,
68
- )
69
- except InstallationSubprocessError as error:
70
- raise MetadataGenerationFailed(package_details=details) from error
71
-
72
- # Return the .egg-info directory.
73
- return _find_egg_info(egg_info_dir)
@@ -1,119 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import logging
4
- import os.path
5
-
6
- from pip._internal.cli.spinners import open_spinner
7
- from pip._internal.utils.deprecation import deprecated
8
- from pip._internal.utils.setuptools_build import make_setuptools_bdist_wheel_args
9
- from pip._internal.utils.subprocess import call_subprocess, format_command_args
10
-
11
- logger = logging.getLogger(__name__)
12
-
13
-
14
- def format_command_result(
15
- command_args: list[str],
16
- command_output: str,
17
- ) -> str:
18
- """Format command information for logging."""
19
- command_desc = format_command_args(command_args)
20
- text = f"Command arguments: {command_desc}\n"
21
-
22
- if not command_output:
23
- text += "Command output: None"
24
- elif logger.getEffectiveLevel() > logging.DEBUG:
25
- text += "Command output: [use --verbose to show]"
26
- else:
27
- if not command_output.endswith("\n"):
28
- command_output += "\n"
29
- text += f"Command output:\n{command_output}"
30
-
31
- return text
32
-
33
-
34
- def get_legacy_build_wheel_path(
35
- names: list[str],
36
- temp_dir: str,
37
- name: str,
38
- command_args: list[str],
39
- command_output: str,
40
- ) -> str | None:
41
- """Return the path to the wheel in the temporary build directory."""
42
- # Sort for determinism.
43
- names = sorted(names)
44
- if not names:
45
- msg = f"Legacy build of wheel for {name!r} created no files.\n"
46
- msg += format_command_result(command_args, command_output)
47
- logger.warning(msg)
48
- return None
49
-
50
- if len(names) > 1:
51
- msg = (
52
- f"Legacy build of wheel for {name!r} created more than one file.\n"
53
- f"Filenames (choosing first): {names}\n"
54
- )
55
- msg += format_command_result(command_args, command_output)
56
- logger.warning(msg)
57
-
58
- return os.path.join(temp_dir, names[0])
59
-
60
-
61
- def build_wheel_legacy(
62
- name: str,
63
- setup_py_path: str,
64
- source_dir: str,
65
- global_options: list[str],
66
- build_options: list[str],
67
- tempd: str,
68
- ) -> str | None:
69
- """Build one unpacked package using the "legacy" build process.
70
-
71
- Returns path to wheel if successfully built. Otherwise, returns None.
72
- """
73
- deprecated(
74
- reason=(
75
- f"Building {name!r} using the legacy setup.py bdist_wheel mechanism, "
76
- "which will be removed in a future version."
77
- ),
78
- replacement=(
79
- "to use the standardized build interface by "
80
- "setting the `--use-pep517` option, "
81
- "(possibly combined with `--no-build-isolation`), "
82
- f"or adding a `pyproject.toml` file to the source tree of {name!r}"
83
- ),
84
- gone_in="25.3",
85
- issue=6334,
86
- )
87
-
88
- wheel_args = make_setuptools_bdist_wheel_args(
89
- setup_py_path,
90
- global_options=global_options,
91
- build_options=build_options,
92
- destination_dir=tempd,
93
- )
94
-
95
- spin_message = f"Building wheel for {name} (setup.py)"
96
- with open_spinner(spin_message) as spinner:
97
- logger.debug("Destination directory: %s", tempd)
98
-
99
- try:
100
- output = call_subprocess(
101
- wheel_args,
102
- command_desc="python setup.py bdist_wheel",
103
- cwd=source_dir,
104
- spinner=spinner,
105
- )
106
- except Exception:
107
- spinner.finish("error")
108
- logger.error("Failed building wheel for %s", name)
109
- return None
110
-
111
- names = os.listdir(tempd)
112
- wheel_path = get_legacy_build_wheel_path(
113
- names=names,
114
- temp_dir=tempd,
115
- name=name,
116
- command_args=wheel_args,
117
- command_output=output,
118
- )
119
- return wheel_path
@@ -1,48 +0,0 @@
1
- """Legacy editable installation process, i.e. `setup.py develop`."""
2
-
3
- from __future__ import annotations
4
-
5
- import logging
6
- from collections.abc import Sequence
7
-
8
- from pip._internal.build_env import BuildEnvironment
9
- from pip._internal.utils.logging import indent_log
10
- from pip._internal.utils.setuptools_build import make_setuptools_develop_args
11
- from pip._internal.utils.subprocess import call_subprocess
12
-
13
- logger = logging.getLogger(__name__)
14
-
15
-
16
- def install_editable(
17
- *,
18
- global_options: Sequence[str],
19
- prefix: str | None,
20
- home: str | None,
21
- use_user_site: bool,
22
- name: str,
23
- setup_py_path: str,
24
- isolated: bool,
25
- build_env: BuildEnvironment,
26
- unpacked_source_directory: str,
27
- ) -> None:
28
- """Install a package in editable mode. Most arguments are pass-through
29
- to setuptools.
30
- """
31
- logger.info("Running setup.py develop for %s", name)
32
-
33
- args = make_setuptools_develop_args(
34
- setup_py_path,
35
- global_options=global_options,
36
- no_user_config=isolated,
37
- prefix=prefix,
38
- home=home,
39
- use_user_site=use_user_site,
40
- )
41
-
42
- with indent_log():
43
- with build_env:
44
- call_subprocess(
45
- args,
46
- command_desc="python setup.py develop",
47
- cwd=unpacked_source_directory,
48
- )