File tree Expand file tree Collapse file tree 2 files changed +11
-20
lines changed Expand file tree Collapse file tree 2 files changed +11
-20
lines changed Original file line number Diff line number Diff line change @@ -41,31 +41,15 @@ def __init__(self, filename: str) -> None:
41
41
if "_" in _version :
42
42
try :
43
43
parse_wheel_filename (filename )
44
- except InvalidVersion as e :
45
- deprecated (
46
- reason = (
47
- f"Wheel filename version part { _version !r} is not correctly "
48
- "normalised, and contained an underscore character in the "
49
- "version part. Future versions of pip will fail to recognise "
50
- f"this wheel and report the error: { e .args [0 ]} ."
51
- ),
52
- replacement = (
53
- "rename the wheel to use a correctly normalised "
54
- "version part (this may require updating the version "
55
- "in the project metadata)"
56
- ),
57
- gone_in = "25.1" ,
58
- issue = 12938 ,
59
- )
60
44
except PackagingInvalidWheelName as e :
61
45
deprecated (
62
46
reason = (
63
- f"The wheel filename { filename !r} is not correctly normalised. "
64
- "Future versions of pip will fail to recognise this wheel. "
65
- f"and report the error: { e .args [0 ]} . "
47
+ f"Wheel filename { filename !r} is not correctly normalised. "
48
+ "Future versions of pip will raise the following error: \n "
49
+ f"{ e .args [0 ]} \n \n "
66
50
),
67
51
replacement = (
68
- "rename the wheel to use a correctly normalised "
52
+ "to rename the wheel to use a correctly normalised "
69
53
"name (this may require updating the version in "
70
54
"the project metadata)"
71
55
),
Original file line number Diff line number Diff line change @@ -201,3 +201,10 @@ def test_version_underscore_conversion(self) -> None:
201
201
with pytest .warns (deprecation .PipDeprecationWarning ):
202
202
w = Wheel ("simple-0.1_1-py2-none-any.whl" )
203
203
assert w .version == "0.1-1"
204
+
205
+ def test_invalid_wheel_warning (self ) -> None :
206
+ """
207
+ Test that wheel with invalid name produces warning
208
+ """
209
+ with pytest .warns (deprecation .PipDeprecationWarning ):
210
+ Wheel ("six-1.16.0_build1-py3-none-any.whl" )
You can’t perform that action at this time.
0 commit comments