@@ -155,25 +155,50 @@ def test_install_fails_if_extra_at_end(
155
155
assert "Extras after version" in result .stderr
156
156
157
157
158
- def test_install_special_extra (script : PipTestEnvironment ) -> None :
158
+ @pytest .mark .parametrize (
159
+ "specified_extra, requested_extra" ,
160
+ [
161
+ ("Hop_hOp-hoP" , "Hop_hOp-hoP" ),
162
+ pytest .param (
163
+ "Hop_hOp-hoP" ,
164
+ "hop-hop-hop" ,
165
+ marks = pytest .mark .xfail (
166
+ reason = (
167
+ "matching a normalized extra request against an"
168
+ "unnormalized extra in metadata requires PEP 685 support "
169
+ "in packaging (see pypa/pip#11445)."
170
+ ),
171
+ ),
172
+ ),
173
+ ("hop-hop-hop" , "Hop_hOp-hoP" ),
174
+ ],
175
+ )
176
+ def test_install_special_extra (
177
+ script : PipTestEnvironment ,
178
+ specified_extra : str ,
179
+ requested_extra : str ,
180
+ ) -> None :
159
181
# Check that uppercase letters and '-' are dealt with
160
182
# make a dummy project
161
183
pkga_path = script .scratch_path / "pkga"
162
184
pkga_path .mkdir ()
163
185
pkga_path .joinpath ("setup.py" ).write_text (
164
186
textwrap .dedent (
165
- """
187
+ f """
166
188
from setuptools import setup
167
189
setup(name='pkga',
168
190
version='0.1',
169
- extras_require={'Hop_hOp-hoP ': ['missing_pkg']},
191
+ extras_require={{' { specified_extra } ': ['missing_pkg']} },
170
192
)
171
193
"""
172
194
)
173
195
)
174
196
175
197
result = script .pip (
176
- "install" , "--no-index" , f"{ pkga_path } [Hop_hOp-hoP]" , expect_error = True
198
+ "install" ,
199
+ "--no-index" ,
200
+ f"{ pkga_path } [{ requested_extra } ]" ,
201
+ expect_error = True ,
177
202
)
178
203
assert (
179
204
"Could not find a version that satisfies the requirement missing_pkg"
0 commit comments