@@ -311,6 +311,7 @@ def download_sdist(name, version, dest_dir=THIRDPARTY_DIR, repos=tuple()):
311311
312312 return fetched_sdist_filename
313313
314+
314315################################################################################
315316#
316317# Core models
@@ -1064,16 +1065,16 @@ def get_sdist_name_ver_ext(filename):
10641065 if version .isalpha ():
10651066 return False
10661067
1067- # non-pep 440 version
1068+ # non-pep 440 version
10681069 if "-" in version :
10691070 return False
10701071
1071- # single version
1072+ # single version
10721073 if version .isdigit () and len (version ) == 1 :
10731074 return False
10741075
1075- # r1 version
1076- if len (version ) == 2 and version [0 ]== "r" and version [1 ].isdigit ():
1076+ # r1 version
1077+ if len (version ) == 2 and version [0 ] == "r" and version [1 ].isdigit ():
10771078 return False
10781079
10791080 # dotless version (but calver is OK)
@@ -1588,6 +1589,7 @@ def tags(self):
15881589 )
15891590 )
15901591
1592+
15911593################################################################################
15921594#
15931595# PyPI repo and link index for package wheels and sources
@@ -1629,7 +1631,9 @@ class PypiSimpleRepository:
16291631 use_cached_index = attr .ib (
16301632 type = bool ,
16311633 default = False ,
1632- metadata = dict (help = "If True, use any existing on-disk cached PyPI index files. Otherwise, fetch and cache." ),
1634+ metadata = dict (
1635+ help = "If True, use any existing on-disk cached PyPI index files. Otherwise, fetch and cache."
1636+ ),
16331637 )
16341638
16351639 def _get_package_versions_map (self , name ):
@@ -1724,7 +1728,9 @@ class LinksRepository:
17241728 use_cached_index = attr .ib (
17251729 type = bool ,
17261730 default = False ,
1727- metadata = dict (help = "If True, use any existing on-disk cached index files. Otherwise, fetch and cache." ),
1731+ metadata = dict (
1732+ help = "If True, use any existing on-disk cached index files. Otherwise, fetch and cache."
1733+ ),
17281734 )
17291735
17301736 def __attrs_post_init__ (self ):
@@ -1790,6 +1796,7 @@ def from_url(cls, url=ABOUT_BASE_URL, _LINKS_REPO={}, use_cached_index=False):
17901796 _LINKS_REPO [url ] = cls (url = url , use_cached_index = use_cached_index )
17911797 return _LINKS_REPO [url ]
17921798
1799+
17931800################################################################################
17941801# Globals for remote repos to be lazily created and cached on first use for the
17951802# life of the session together with some convenience functions.
@@ -1803,6 +1810,7 @@ def get_local_packages(directory=THIRDPARTY_DIR):
18031810 """
18041811 return list (PypiPackage .packages_from_dir (directory = directory ))
18051812
1813+
18061814################################################################################
18071815#
18081816# Basic file and URL-based operations using a persistent file-based Cache
@@ -1953,6 +1961,7 @@ def fetch_and_save(
19531961 fo .write (content )
19541962 return content
19551963
1964+
19561965################################################################################
19571966#
19581967# Functions to update or fetch ABOUT and license files
@@ -2051,7 +2060,9 @@ def get_other_dists(_package, _dist):
20512060 # if has key data we may look to improve later, but we can move on
20522061 if local_dist .has_key_metadata ():
20532062 local_dist .save_about_and_notice_files (dest_dir = dest_dir )
2054- local_dist .fetch_license_files (dest_dir = dest_dir , use_cached_index = use_cached_index )
2063+ local_dist .fetch_license_files (
2064+ dest_dir = dest_dir , use_cached_index = use_cached_index
2065+ )
20552066 continue
20562067
20572068 # lets try to fetch remotely
@@ -2089,7 +2100,9 @@ def get_other_dists(_package, _dist):
20892100 # if has key data we may look to improve later, but we can move on
20902101 if local_dist .has_key_metadata ():
20912102 local_dist .save_about_and_notice_files (dest_dir = dest_dir )
2092- local_dist .fetch_license_files (dest_dir = dest_dir , use_cached_index = use_cached_index )
2103+ local_dist .fetch_license_files (
2104+ dest_dir = dest_dir , use_cached_index = use_cached_index
2105+ )
20932106 continue
20942107
20952108 # try to get data from pkginfo (no license though)
@@ -2107,6 +2120,7 @@ def get_other_dists(_package, _dist):
21072120 lic_errs = "\n " .join (lic_errs )
21082121 print (f"Failed to fetch some licenses:: { lic_errs } " )
21092122
2123+
21102124################################################################################
21112125#
21122126# Functions to build new Python wheels including native on multiple OSes
@@ -2210,6 +2224,7 @@ def download_wheels_with_pip(
22102224 downloaded = existing ^ set (os .listdir (dest_dir ))
22112225 return sorted (downloaded ), error
22122226
2227+
22132228################################################################################
22142229#
22152230# Functions to check for problems
0 commit comments