@@ -210,15 +210,13 @@ def get_sdist_file_path_from_filename(sdist):
210210 sdist_file = sdist .rstrip (".tar.gz" )
211211 with tarfile .open (os .path .join (utils_pypi .CACHE_THIRDPARTY_DIR , sdist )) as file :
212212 file .extractall (
213- os .path .join (utils_pypi .CACHE_THIRDPARTY_DIR ,
214- "extracted_sdists" , sdist_file )
213+ os .path .join (utils_pypi .CACHE_THIRDPARTY_DIR , "extracted_sdists" , sdist_file )
215214 )
216215 elif sdist .endswith (".zip" ):
217216 sdist_file = sdist .rstrip (".zip" )
218217 with ZipFile (os .path .join (utils_pypi .CACHE_THIRDPARTY_DIR , sdist )) as zip :
219218 zip .extractall (
220- os .path .join (utils_pypi .CACHE_THIRDPARTY_DIR ,
221- "extracted_sdists" , sdist_file )
219+ os .path .join (utils_pypi .CACHE_THIRDPARTY_DIR , "extracted_sdists" , sdist_file )
222220 )
223221
224222 else :
@@ -361,8 +359,7 @@ def __init__(
361359 ignore_errors = False ,
362360 ):
363361 self .environment = environment
364- self .environment_marker = get_environment_marker_from_environment (
365- self .environment )
362+ self .environment_marker = get_environment_marker_from_environment (self .environment )
366363 self .repos = repos or []
367364 self .versions_by_package = {}
368365 self .dependencies_by_purl = {}
@@ -411,11 +408,9 @@ def get_versions_for_package_from_repo(
411408 versions = []
412409 for version , package in repo .get_package_versions (name ).items ():
413410 python_version = parse_version (
414- get_python_version_from_env_tag (
415- python_version = self .environment .python_version )
411+ get_python_version_from_env_tag (python_version = self .environment .python_version )
416412 )
417- wheels = list (package .get_supported_wheels (
418- environment = self .environment ))
413+ wheels = list (package .get_supported_wheels (environment = self .environment ))
419414 valid_wheel_present = False
420415 pypi_valid_python_version = False
421416 if wheels :
@@ -464,8 +459,7 @@ def get_requirements_for_package_from_pypi_simple(
464459 Return requirements for a package from the simple repositories.
465460 """
466461 python_version = parse_version (
467- get_python_version_from_env_tag (
468- python_version = self .environment .python_version )
462+ get_python_version_from_env_tag (python_version = self .environment .python_version )
469463 )
470464
471465 wheels = utils_pypi .download_wheel (
@@ -478,8 +472,7 @@ def get_requirements_for_package_from_pypi_simple(
478472
479473 if wheels :
480474 for wheel in wheels :
481- wheel_location = os .path .join (
482- utils_pypi .CACHE_THIRDPARTY_DIR , wheel )
475+ wheel_location = os .path .join (utils_pypi .CACHE_THIRDPARTY_DIR , wheel )
483476 requirements = get_requirements_from_distribution (
484477 handler = PypiWheelHandler ,
485478 location = wheel_location ,
@@ -571,8 +564,7 @@ def get_candidates(
571564 ):
572565 valid_versions .append (parsed_version )
573566 if not all (version .is_prerelease for version in valid_versions ):
574- valid_versions = [
575- version for version in valid_versions if not version .is_prerelease ]
567+ valid_versions = [version for version in valid_versions if not version .is_prerelease ]
576568 for version in valid_versions :
577569 yield Candidate (name = name , version = version , extras = extras )
578570
@@ -593,8 +585,7 @@ def _iter_matches(
593585 versions .extend (self .get_versions_for_package (name = name ))
594586 else :
595587 for repo in self .repos :
596- versions .extend (
597- self .get_versions_for_package (name = name , repo = repo ))
588+ versions .extend (self .get_versions_for_package (name = name , repo = repo ))
598589
599590 if not versions :
600591 if self .ignore_errors :
@@ -685,8 +676,7 @@ def dfs(mapping: Dict, graph: DirectedGraph, src: str):
685676
686677 return dict (
687678 package = str (src_purl ),
688- dependencies = sorted ([dfs (mapping , graph , c )
689- for c in children ], key = lambda d : d ["package" ]),
679+ dependencies = sorted ([dfs (mapping , graph , c ) for c in children ], key = lambda d : d ["package" ]),
690680 )
691681
692682
@@ -804,8 +794,7 @@ def get_setup_requirements(sdist_location: str, setup_py_location: str, setup_cf
804794 """
805795
806796 if not os .path .exists (setup_py_location ) and not os .path .exists (setup_cfg_location ):
807- raise Exception (
808- f"No setup.py or setup.cfg found in pypi sdist { sdist_location } " )
797+ raise Exception (f"No setup.py or setup.cfg found in pypi sdist { sdist_location } " )
809798
810799 # Some commonon packages like flask may have some dependencies in setup.cfg
811800 # and some dependencies in setup.py. We are going to check both.
0 commit comments