6565
6666from SCons .Script import Copy , Action , FindInstalledFiles , GetOption , AddOption
6767
68- from distutils import sysconfig
69- from collections import defaultdict
70-
7168from .util import safe_name , to_filename , generate_requirements
7269
7370import codecs
74- import distutils .ccompiler , distutils .sysconfig , distutils .unixccompiler
7571import os .path
7672import SCons .Node .FS
7773
@@ -82,7 +78,7 @@ def get_binary_tag():
8278 """
8379 from packaging import tags
8480
85- return str (next (tag for tag in tags .sys_tags () if not "manylinux" in tag .platform ))
81+ return str (next (tag for tag in tags .sys_tags () if "manylinux" not in tag .platform ))
8682
8783
8884def get_universal_tag ():
@@ -187,7 +183,6 @@ def egg_info_builder(target, source, env):
187183 """
188184 Minimum egg_info. To be used only by pip to get dependencies.
189185 """
190- metadata = env ["PACKAGE_METADATA" ]
191186 for dnode in env .arg2nodes (target ):
192187 if dnode .name == "PKG-INFO" :
193188 with open (dnode .get_path (), "w" ) as f :
@@ -249,7 +244,7 @@ def metadata_source(env):
249244 # Maybe the two should be unified.
250245 if "license" in metadata :
251246 if not _is_string (metadata ["license" ]):
252- if not ( "text" in metadata ["license" ]) :
247+ if "text" not in metadata ["license" ]:
253248 source .append (metadata ["license" ]["file" ])
254249 if "readme" in metadata :
255250 if _is_string (metadata ["readme" ]):
@@ -386,7 +381,6 @@ def add_editable(target, source, env):
386381 archive = zipfile .ZipFile (
387382 target [0 ].get_path (), "a" , compression = zipfile .ZIP_DEFLATED
388383 )
389- lines = []
390384 for f , data in project .files ():
391385 archive .writestr (zipfile .ZipInfo (f , time .gmtime (SOURCE_EPOCH_ZIP )[:6 ]), data )
392386 archive .close ()
@@ -497,7 +491,7 @@ def init_wheel(env):
497491 # editable may need an extra dependency, so it gets its own dist-info directory.
498492 env .Command (editable_dist_info , env ["DIST_INFO_PATH" ], Copy ("$TARGET" , "$SOURCE" ))
499493
500- metadata2 = env .Command (
494+ env .Command (
501495 editable_dist_info .File ("METADATA" ), metadata_source (env ), metadata_builder
502496 )
503497
@@ -593,7 +587,7 @@ def SDist(env, target=None, source=None):
593587 env .Clean (egg_info , env ["EGG_INFO_PATH" ])
594588 env .Alias ("egg_info" , egg_info )
595589
596- pkg_info = env .Command ("PKG-INFO" , metadata_source (env ), metadata_builder )
590+ env .Command ("PKG-INFO" , metadata_source (env ), metadata_builder )
597591
598592 # also the root directory name inside the archive
599593 target_prefix = "-" .join ((env ["PACKAGE_NAME" ], env ["PACKAGE_VERSION" ]))
0 commit comments