@@ -39,15 +39,14 @@ class build_py(orig.build_py):
3939
4040 distribution : Distribution # override distutils.dist.Distribution with setuptools.dist.Distribution
4141 editable_mode : bool = False
42- existing_egg_info_dir : str | None = None #: Private API, internal use only.
42+ existing_egg_info_dir : StrPath | None = None #: Private API, internal use only.
4343
4444 def finalize_options (self ):
4545 orig .build_py .finalize_options (self )
4646 self .package_data = self .distribution .package_data
4747 self .exclude_package_data = self .distribution .exclude_package_data or {}
4848 if 'data_files' in self .__dict__ :
4949 del self .__dict__ ['data_files' ]
50- self .__updated_files = []
5150
5251 def copy_file ( # type: ignore[override] # No overload, no bytes support
5352 self ,
@@ -89,12 +88,6 @@ def __getattr__(self, attr: str):
8988 return self .data_files
9089 return orig .build_py .__getattr__ (self , attr )
9190
92- def build_module (self , module , module_file , package ):
93- outfile , copied = orig .build_py .build_module (self , module , module_file , package )
94- if copied :
95- self .__updated_files .append (outfile )
96- return outfile , copied
97-
9891 def _get_data_files (self ):
9992 """Generate list of '(package,src_dir,build_dir,filenames)' tuples"""
10093 self .analyze_manifest ()
@@ -178,17 +171,17 @@ def build_package_data(self) -> None:
178171 _outf , _copied = self .copy_file (srcfile , target )
179172 make_writable (target )
180173
181- def analyze_manifest (self ):
182- self .manifest_files = mf = {}
174+ def analyze_manifest (self ) -> None :
175+ self .manifest_files : dict [ str , list [ str ]] = {}
183176 if not self .distribution .include_package_data :
184177 return
185- src_dirs = {}
178+ src_dirs : dict [ str , str ] = {}
186179 for package in self .packages or ():
187180 # Locate package source directory
188181 src_dirs [assert_relative (self .get_package_dir (package ))] = package
189182
190183 if (
191- getattr ( self , ' existing_egg_info_dir' , None )
184+ self . existing_egg_info_dir
192185 and Path (self .existing_egg_info_dir , "SOURCES.txt" ).exists ()
193186 ):
194187 egg_info_dir = self .existing_egg_info_dir
@@ -217,9 +210,11 @@ def analyze_manifest(self):
217210 importable = check .importable_subpackage (src_dirs [d ], f )
218211 if importable :
219212 check .warn (importable )
220- mf .setdefault (src_dirs [d ], []).append (path )
213+ self . manifest_files .setdefault (src_dirs [d ], []).append (path )
221214
222- def _filter_build_files (self , files : Iterable [str ], egg_info : str ) -> Iterator [str ]:
215+ def _filter_build_files (
216+ self , files : Iterable [str ], egg_info : StrPath
217+ ) -> Iterator [str ]:
223218 """
224219 ``build_meta`` may try to create egg_info outside of the project directory,
225220 and this can be problematic for certain plugins (reported in issue #3500).
0 commit comments