@@ -914,24 +914,38 @@ def test_update_targeted_impossible(
914914 "pip: ERROR: No matching distribution found for urllib3<1.27,>=1.21.1" ,
915915 ]
916916 else :
917- expected_lines = [
918- "pip: ERROR: Cannot install requests==2.26.0 because these package versions have "
919- "conflicting dependencies." ,
920- "pip: ERROR: ResolutionImpossible: for help visit "
921- "https://pip.pypa.io/en/latest/topics/dependency-resolution/"
922- "#dealing-with-dependency-conflicts" ,
923- "pip: " ,
924- "pip: The conflict is caused by:" ,
925- "pip: requests 2.26.0 depends on urllib3<1.27 and >=1.21.1" ,
926- "pip: The user requested (constraint) urllib3<1.16" ,
927- "pip: " ,
928- "pip: To fix this you could try to:" ,
929- "pip: 1. loosen the range of package versions you've specified" ,
930- "pip: 2. remove package versions to allow {pip_to} attempt to solve the dependency "
931- "conflict" .format (
932- pip_to = "pip" if pip_version .version < PipVersion .v24_1 .version else "pip to"
933- ),
934- ]
917+ expected_lines = (
918+ [
919+ "pip: ERROR: Cannot install requests==2.26.0 because these package versions have "
920+ "conflicting dependencies." ,
921+ "pip: ERROR: ResolutionImpossible: for help visit "
922+ "https://pip.pypa.io/en/latest/topics/dependency-resolution/"
923+ "#dealing-with-dependency-conflicts" ,
924+ "pip: " ,
925+ "pip: The conflict is caused by:" ,
926+ "pip: requests 2.26.0 depends on urllib3<1.27 and >=1.21.1" ,
927+ "pip: The user requested (constraint) urllib3<1.16" ,
928+ "pip: " ,
929+ ]
930+ + (
931+ [
932+ "pip: Additionally, some packages in these conflicts have no matching "
933+ "distributions available for your environment:" ,
934+ "pip: urllib3" ,
935+ "pip: " ,
936+ ]
937+ if pip_version >= PipVersion .v25_3
938+ else []
939+ )
940+ + [
941+ "pip: To fix this you could try to:" ,
942+ "pip: 1. loosen the range of package versions you've specified" ,
943+ "pip: 2. remove package versions to allow {pip_to} attempt to solve the "
944+ "dependency conflict" .format (
945+ pip_to = "pip" if pip_version .version < PipVersion .v24_1 .version else "pip to"
946+ ),
947+ ]
948+ )
935949 assert expected_lines == error_lines [12 :], "\n " .join (
936950 difflib .unified_diff (expected_lines , error_lines [12 :])
937951 )
@@ -1013,25 +1027,39 @@ def test_update_add_impossible(
10131027 "pip: ERROR: No matching distribution found for certifi<2017.4.17" ,
10141028 ]
10151029 else :
1016- expected_lines = [
1017- "pip: ERROR: Cannot install conflicting-certifi-requirement==1.2.3 and "
1018- "requests==2.26.0 because these package versions have conflicting dependencies." ,
1019- "pip: ERROR: ResolutionImpossible: for help visit "
1020- "https://pip.pypa.io/en/latest/topics/dependency-resolution/"
1021- "#dealing-with-dependency-conflicts" ,
1022- "pip: " ,
1023- "pip: The conflict is caused by:" ,
1024- "pip: requests 2.26.0 depends on certifi>=2017.4.17" ,
1025- "pip: conflicting-certifi-requirement 1.2.3 depends on certifi<2017.4.17" ,
1026- "pip: The user requested (constraint) certifi==2021.5.30" ,
1027- "pip: " ,
1028- "pip: To fix this you could try to:" ,
1029- "pip: 1. loosen the range of package versions you've specified" ,
1030- "pip: 2. remove package versions to allow {pip_to} attempt to solve the dependency "
1031- "conflict" .format (
1032- pip_to = "pip" if pip_version .version < PipVersion .v24_1 .version else "pip to"
1033- ),
1034- ]
1030+ expected_lines = (
1031+ [
1032+ "pip: ERROR: Cannot install conflicting-certifi-requirement==1.2.3 and "
1033+ "requests==2.26.0 because these package versions have conflicting dependencies." ,
1034+ "pip: ERROR: ResolutionImpossible: for help visit "
1035+ "https://pip.pypa.io/en/latest/topics/dependency-resolution/"
1036+ "#dealing-with-dependency-conflicts" ,
1037+ "pip: " ,
1038+ "pip: The conflict is caused by:" ,
1039+ "pip: requests 2.26.0 depends on certifi>=2017.4.17" ,
1040+ "pip: conflicting-certifi-requirement 1.2.3 depends on certifi<2017.4.17" ,
1041+ "pip: The user requested (constraint) certifi==2021.5.30" ,
1042+ "pip: " ,
1043+ ]
1044+ + (
1045+ [
1046+ "pip: Additionally, some packages in these conflicts have no matching "
1047+ "distributions available for your environment:" ,
1048+ "pip: certifi" ,
1049+ "pip: " ,
1050+ ]
1051+ if pip_version >= PipVersion .v25_3
1052+ else []
1053+ )
1054+ + [
1055+ "pip: To fix this you could try to:" ,
1056+ "pip: 1. loosen the range of package versions you've specified" ,
1057+ "pip: 2. remove package versions to allow {pip_to} attempt to solve the "
1058+ "dependency conflict" .format (
1059+ pip_to = "pip" if pip_version .version < PipVersion .v24_1 .version else "pip to"
1060+ ),
1061+ ]
1062+ )
10351063 assert expected_lines == error_lines [13 :], "\n " .join (
10361064 difflib .unified_diff (expected_lines , error_lines [12 :])
10371065 )
0 commit comments