@@ -210,15 +210,13 @@ def get_sdist_file_path_from_filename(sdist):
210
210
sdist_file = sdist .rstrip (".tar.gz" )
211
211
with tarfile .open (os .path .join (utils_pypi .CACHE_THIRDPARTY_DIR , sdist )) as file :
212
212
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 )
215
214
)
216
215
elif sdist .endswith (".zip" ):
217
216
sdist_file = sdist .rstrip (".zip" )
218
217
with ZipFile (os .path .join (utils_pypi .CACHE_THIRDPARTY_DIR , sdist )) as zip :
219
218
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 )
222
220
)
223
221
224
222
else :
@@ -361,8 +359,7 @@ def __init__(
361
359
ignore_errors = False ,
362
360
):
363
361
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 )
366
363
self .repos = repos or []
367
364
self .versions_by_package = {}
368
365
self .dependencies_by_purl = {}
@@ -411,11 +408,9 @@ def get_versions_for_package_from_repo(
411
408
versions = []
412
409
for version , package in repo .get_package_versions (name ).items ():
413
410
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 )
416
412
)
417
- wheels = list (package .get_supported_wheels (
418
- environment = self .environment ))
413
+ wheels = list (package .get_supported_wheels (environment = self .environment ))
419
414
valid_wheel_present = False
420
415
pypi_valid_python_version = False
421
416
if wheels :
@@ -464,8 +459,7 @@ def get_requirements_for_package_from_pypi_simple(
464
459
Return requirements for a package from the simple repositories.
465
460
"""
466
461
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 )
469
463
)
470
464
471
465
wheels = utils_pypi .download_wheel (
@@ -478,8 +472,7 @@ def get_requirements_for_package_from_pypi_simple(
478
472
479
473
if wheels :
480
474
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 )
483
476
requirements = get_requirements_from_distribution (
484
477
handler = PypiWheelHandler ,
485
478
location = wheel_location ,
@@ -571,8 +564,7 @@ def get_candidates(
571
564
):
572
565
valid_versions .append (parsed_version )
573
566
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 ]
576
568
for version in valid_versions :
577
569
yield Candidate (name = name , version = version , extras = extras )
578
570
@@ -593,8 +585,7 @@ def _iter_matches(
593
585
versions .extend (self .get_versions_for_package (name = name ))
594
586
else :
595
587
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 ))
598
589
599
590
if not versions :
600
591
if self .ignore_errors :
@@ -685,8 +676,7 @@ def dfs(mapping: Dict, graph: DirectedGraph, src: str):
685
676
686
677
return dict (
687
678
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" ]),
690
680
)
691
681
692
682
@@ -804,8 +794,7 @@ def get_setup_requirements(sdist_location: str, setup_py_location: str, setup_cf
804
794
"""
805
795
806
796
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 } " )
809
798
810
799
# Some commonon packages like flask may have some dependencies in setup.cfg
811
800
# and some dependencies in setup.py. We are going to check both.
0 commit comments