26
26
remove_readonly_exc ,
27
27
)
28
28
from setuptools .dist import Distribution
29
+ from setuptools .warnings import SetuptoolsDeprecationWarning
29
30
30
31
from distutils .core import run_setup
31
32
123
124
)
124
125
"""
125
126
),
126
- "setup.cfg" : "[bdist_wheel]\n universal=1" ,
127
127
"headersdist.py" : "" ,
128
128
"header.h" : "" ,
129
129
},
@@ -300,8 +300,8 @@ def license_paths(self):
300
300
301
301
def test_licenses_default (dummy_dist , monkeypatch , tmp_path ):
302
302
monkeypatch .chdir (dummy_dist )
303
- bdist_wheel_cmd (bdist_dir = str (tmp_path ), universal = True ).run ()
304
- with ZipFile ("dist/dummy_dist-1.0-py2. py3-none-any.whl" ) as wf :
303
+ bdist_wheel_cmd (bdist_dir = str (tmp_path )).run ()
304
+ with ZipFile ("dist/dummy_dist-1.0-py3-none-any.whl" ) as wf :
305
305
license_files = {
306
306
"dummy_dist-1.0.dist-info/" + fname for fname in DEFAULT_LICENSE_FILES
307
307
}
@@ -314,9 +314,9 @@ def test_licenses_deprecated(dummy_dist, monkeypatch, tmp_path):
314
314
)
315
315
monkeypatch .chdir (dummy_dist )
316
316
317
- bdist_wheel_cmd (bdist_dir = str (tmp_path ), universal = True ).run ()
317
+ bdist_wheel_cmd (bdist_dir = str (tmp_path )).run ()
318
318
319
- with ZipFile ("dist/dummy_dist-1.0-py2. py3-none-any.whl" ) as wf :
319
+ with ZipFile ("dist/dummy_dist-1.0-py3-none-any.whl" ) as wf :
320
320
license_files = {"dummy_dist-1.0.dist-info/DUMMYFILE" }
321
321
assert set (wf .namelist ()) == DEFAULT_FILES | license_files
322
322
@@ -337,8 +337,8 @@ def test_licenses_deprecated(dummy_dist, monkeypatch, tmp_path):
337
337
def test_licenses_override (dummy_dist , monkeypatch , tmp_path , config_file , config ):
338
338
dummy_dist .joinpath (config_file ).write_text (config , encoding = "utf-8" )
339
339
monkeypatch .chdir (dummy_dist )
340
- bdist_wheel_cmd (bdist_dir = str (tmp_path ), universal = True ).run ()
341
- with ZipFile ("dist/dummy_dist-1.0-py2. py3-none-any.whl" ) as wf :
340
+ bdist_wheel_cmd (bdist_dir = str (tmp_path )).run ()
341
+ with ZipFile ("dist/dummy_dist-1.0-py3-none-any.whl" ) as wf :
342
342
license_files = {
343
343
"dummy_dist-1.0.dist-info/" + fname for fname in {"DUMMYFILE" , "LICENSE" }
344
344
}
@@ -350,20 +350,29 @@ def test_licenses_disabled(dummy_dist, monkeypatch, tmp_path):
350
350
"[metadata]\n license_files=\n " , encoding = "utf-8"
351
351
)
352
352
monkeypatch .chdir (dummy_dist )
353
- bdist_wheel_cmd (bdist_dir = str (tmp_path ), universal = True ).run ()
354
- with ZipFile ("dist/dummy_dist-1.0-py2. py3-none-any.whl" ) as wf :
353
+ bdist_wheel_cmd (bdist_dir = str (tmp_path )).run ()
354
+ with ZipFile ("dist/dummy_dist-1.0-py3-none-any.whl" ) as wf :
355
355
assert set (wf .namelist ()) == DEFAULT_FILES
356
356
357
357
358
358
def test_build_number (dummy_dist , monkeypatch , tmp_path ):
359
359
monkeypatch .chdir (dummy_dist )
360
- bdist_wheel_cmd (bdist_dir = str (tmp_path ), build_number = "2" , universal = True ).run ()
361
- with ZipFile ("dist/dummy_dist-1.0-2-py2. py3-none-any.whl" ) as wf :
360
+ bdist_wheel_cmd (bdist_dir = str (tmp_path ), build_number = "2" ).run ()
361
+ with ZipFile ("dist/dummy_dist-1.0-2-py3-none-any.whl" ) as wf :
362
362
filenames = set (wf .namelist ())
363
363
assert "dummy_dist-1.0.dist-info/RECORD" in filenames
364
364
assert "dummy_dist-1.0.dist-info/METADATA" in filenames
365
365
366
366
367
+ def test_universal_deprecated (dummy_dist , monkeypatch , tmp_path ):
368
+ monkeypatch .chdir (dummy_dist )
369
+ with pytest .warns (SetuptoolsDeprecationWarning , match = ".*universal is deprecated" ):
370
+ bdist_wheel_cmd (bdist_dir = str (tmp_path ), universal = True ).run ()
371
+
372
+ # For now we still respect the option
373
+ assert os .path .exists ("dist/dummy_dist-1.0-py2.py3-none-any.whl" )
374
+
375
+
367
376
EXTENSION_EXAMPLE = """\
368
377
#include <Python.h>
369
378
@@ -431,8 +440,8 @@ def test_build_from_readonly_tree(dummy_dist, monkeypatch, tmp_path):
431
440
)
432
441
def test_compression (dummy_dist , monkeypatch , tmp_path , option , compress_type ):
433
442
monkeypatch .chdir (dummy_dist )
434
- bdist_wheel_cmd (bdist_dir = str (tmp_path ), universal = True , compression = option ).run ()
435
- with ZipFile ("dist/dummy_dist-1.0-py2. py3-none-any.whl" ) as wf :
443
+ bdist_wheel_cmd (bdist_dir = str (tmp_path ), compression = option ).run ()
444
+ with ZipFile ("dist/dummy_dist-1.0-py3-none-any.whl" ) as wf :
436
445
filenames = set (wf .namelist ())
437
446
assert "dummy_dist-1.0.dist-info/RECORD" in filenames
438
447
assert "dummy_dist-1.0.dist-info/METADATA" in filenames
@@ -451,8 +460,8 @@ def test_wheelfile_line_endings(wheel_paths):
451
460
def test_unix_epoch_timestamps (dummy_dist , monkeypatch , tmp_path ):
452
461
monkeypatch .setenv ("SOURCE_DATE_EPOCH" , "0" )
453
462
monkeypatch .chdir (dummy_dist )
454
- bdist_wheel_cmd (bdist_dir = str (tmp_path ), build_number = "2a" , universal = True ).run ()
455
- with ZipFile ("dist/dummy_dist-1.0-2a-py2. py3-none-any.whl" ) as wf :
463
+ bdist_wheel_cmd (bdist_dir = str (tmp_path ), build_number = "2a" ).run ()
464
+ with ZipFile ("dist/dummy_dist-1.0-2a-py3-none-any.whl" ) as wf :
456
465
for zinfo in wf .filelist :
457
466
assert zinfo .date_time >= (1980 , 1 , 1 , 0 , 0 , 0 ) # min epoch is used
458
467
0 commit comments