File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -198,6 +198,27 @@ def test_extension_sources_in_sdist(self):
198198 self .assert_package_data_in_manifest (cmd )
199199 self .assert_extension_sources_in_manifest (cmd )
200200
201+ def test_missing_extension_sources (self ):
202+ """
203+ Similar to test_extension_sources_in_sdist but the referenced files don't exist.
204+ Missing files should not be included in distribution (with no error raised).
205+ """
206+ os .remove (os .path .join ("sdist_test" , "f.h" ))
207+ setup_attrs = {** SETUP_ATTRS , 'ext_modules' : [EXTENSION ]}
208+
209+ dist = Distribution (setup_attrs )
210+ dist .script_name = 'setup.py'
211+ cmd = sdist (dist )
212+ cmd .ensure_finalized ()
213+
214+ with quiet ():
215+ cmd .run ()
216+
217+ self .assert_package_data_in_manifest (cmd )
218+ manifest = cmd .filelist .files
219+ assert os .path .join ('sdist_test' , 'f.c' ) in manifest
220+ assert os .path .join ('sdist_test' , 'f.h' ) not in manifest
221+
201222 def test_custom_build_py (self ):
202223 """
203224 Ensure projects defining custom build_py don't break
You can’t perform that action at this time.
0 commit comments