@@ -502,7 +502,7 @@ def test_sdist_with_latin1_encoded_filename(self):
502
502
"setup.cfg - long_description and version" : """
503
503
[metadata]
504
504
name = testing
505
- version = file: VERSION.txt
505
+ version = file: src/ VERSION.txt
506
506
license_files = DOWHATYOUWANT
507
507
long_description = file: README.rst, USAGE.rst
508
508
""" ,
@@ -513,15 +513,25 @@ def test_sdist_with_latin1_encoded_filename(self):
513
513
license = {file = "DOWHATYOUWANT"}
514
514
dynamic = ["version"]
515
515
[tool.setuptools.dynamic]
516
- version = {file = ["VERSION.txt"]}
516
+ version = {file = ["src/VERSION.txt"]}
517
+ """ ,
518
+ "pyproject.toml - directive with str instead of list" : """
519
+ [project]
520
+ name = "testing"
521
+ readme = "USAGE.rst"
522
+ license = {file = "DOWHATYOUWANT"}
523
+ dynamic = ["version"]
524
+ [tool.setuptools.dynamic]
525
+ version = {file = "src/VERSION.txt"}
517
526
"""
518
527
}
519
528
520
529
@pytest .mark .parametrize ("config" , _EXAMPLE_DIRECTIVES .keys ())
521
530
def test_add_files_referenced_by_config_directives (self , tmp_path , config ):
522
531
config_file , _ , _ = config .partition (" - " )
523
532
config_text = self ._EXAMPLE_DIRECTIVES [config ]
524
- (tmp_path / 'VERSION.txt' ).write_text ("0.42" , encoding = "utf-8" )
533
+ (tmp_path / 'src' ).mkdir ()
534
+ (tmp_path / 'src/VERSION.txt' ).write_text ("0.42" , encoding = "utf-8" )
525
535
(tmp_path / 'README.rst' ).write_text ("hello world!" , encoding = "utf-8" )
526
536
(tmp_path / 'USAGE.rst' ).write_text ("hello world!" , encoding = "utf-8" )
527
537
(tmp_path / 'DOWHATYOUWANT' ).write_text ("hello world!" , encoding = "utf-8" )
@@ -536,9 +546,14 @@ def test_add_files_referenced_by_config_directives(self, tmp_path, config):
536
546
with quiet ():
537
547
cmd .run ()
538
548
539
- assert 'VERSION.txt' in cmd .filelist .files
549
+ assert (
550
+ 'src/VERSION.txt' in cmd .filelist .files
551
+ or 'src\\ VERSION.txt' in cmd .filelist .files
552
+ )
540
553
assert 'USAGE.rst' in cmd .filelist .files
541
554
assert 'DOWHATYOUWANT' in cmd .filelist .files
555
+ assert '/' not in cmd .filelist .files
556
+ assert '\\ ' not in cmd .filelist .files
542
557
543
558
def test_pyproject_toml_in_sdist (self , tmpdir ):
544
559
"""
0 commit comments