59
59
EXAMPLES = {
60
60
"dummy-dist" : {
61
61
"setup.py" : SETUPPY_EXAMPLE ,
62
- "licenses " : {"DUMMYFILE" : "" },
62
+ "licenses_dir " : {"DUMMYFILE" : "" },
63
63
** dict .fromkeys (DEFAULT_LICENSE_FILES | OTHER_IGNORED_FILES , "" ),
64
64
},
65
65
"simple-dist" : {
@@ -324,26 +324,26 @@ def test_licenses_default(dummy_dist, monkeypatch, tmp_path):
324
324
325
325
def test_licenses_deprecated (dummy_dist , monkeypatch , tmp_path ):
326
326
dummy_dist .joinpath ("setup.cfg" ).write_text (
327
- "[metadata]\n license_file=licenses /DUMMYFILE" , encoding = "utf-8"
327
+ "[metadata]\n license_file=licenses_dir /DUMMYFILE" , encoding = "utf-8"
328
328
)
329
329
monkeypatch .chdir (dummy_dist )
330
330
331
331
bdist_wheel_cmd (bdist_dir = str (tmp_path )).run ()
332
332
333
333
with ZipFile ("dist/dummy_dist-1.0-py3-none-any.whl" ) as wf :
334
- license_files = {"dummy_dist-1.0.dist-info/licenses/licenses /DUMMYFILE" }
334
+ license_files = {"dummy_dist-1.0.dist-info/licenses/licenses_dir /DUMMYFILE" }
335
335
assert set (wf .namelist ()) == DEFAULT_FILES | license_files
336
336
337
337
338
338
@pytest .mark .parametrize (
339
339
("config_file" , "config" ),
340
340
[
341
- ("setup.cfg" , "[metadata]\n license_files=licenses /*\n LICENSE" ),
342
- ("setup.cfg" , "[metadata]\n license_files=licenses /*, LICENSE" ),
341
+ ("setup.cfg" , "[metadata]\n license_files=licenses_dir /*\n LICENSE" ),
342
+ ("setup.cfg" , "[metadata]\n license_files=licenses_dir /*, LICENSE" ),
343
343
(
344
344
"setup.py" ,
345
345
SETUPPY_EXAMPLE .replace (
346
- ")" , " license_files=['licenses /DUMMYFILE', 'LICENSE'])"
346
+ ")" , " license_files=['licenses_dir /DUMMYFILE', 'LICENSE'])"
347
347
),
348
348
),
349
349
],
@@ -355,11 +355,11 @@ def test_licenses_override(dummy_dist, monkeypatch, tmp_path, config_file, confi
355
355
with ZipFile ("dist/dummy_dist-1.0-py3-none-any.whl" ) as wf :
356
356
license_files = {
357
357
"dummy_dist-1.0.dist-info/licenses/" + fname
358
- for fname in {"licenses /DUMMYFILE" , "LICENSE" }
358
+ for fname in {"licenses_dir /DUMMYFILE" , "LICENSE" }
359
359
}
360
360
assert set (wf .namelist ()) == DEFAULT_FILES | license_files
361
361
metadata = wf .read ("dummy_dist-1.0.dist-info/METADATA" ).decode ("utf8" )
362
- assert "License-File: licenses /DUMMYFILE" in metadata
362
+ assert "License-File: licenses_dir /DUMMYFILE" in metadata
363
363
assert "License-File: LICENSE" in metadata
364
364
365
365
0 commit comments