@@ -311,6 +311,7 @@ def download_sdist(name, version, dest_dir=THIRDPARTY_DIR, repos=tuple()):
311
311
312
312
return fetched_sdist_filename
313
313
314
+
314
315
################################################################################
315
316
#
316
317
# Core models
@@ -1064,16 +1065,16 @@ def get_sdist_name_ver_ext(filename):
1064
1065
if version .isalpha ():
1065
1066
return False
1066
1067
1067
- # non-pep 440 version
1068
+ # non-pep 440 version
1068
1069
if "-" in version :
1069
1070
return False
1070
1071
1071
- # single version
1072
+ # single version
1072
1073
if version .isdigit () and len (version ) == 1 :
1073
1074
return False
1074
1075
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 ():
1077
1078
return False
1078
1079
1079
1080
# dotless version (but calver is OK)
@@ -1588,6 +1589,7 @@ def tags(self):
1588
1589
)
1589
1590
)
1590
1591
1592
+
1591
1593
################################################################################
1592
1594
#
1593
1595
# PyPI repo and link index for package wheels and sources
@@ -1629,7 +1631,9 @@ class PypiSimpleRepository:
1629
1631
use_cached_index = attr .ib (
1630
1632
type = bool ,
1631
1633
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
+ ),
1633
1637
)
1634
1638
1635
1639
def _get_package_versions_map (self , name ):
@@ -1724,7 +1728,9 @@ class LinksRepository:
1724
1728
use_cached_index = attr .ib (
1725
1729
type = bool ,
1726
1730
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
+ ),
1728
1734
)
1729
1735
1730
1736
def __attrs_post_init__ (self ):
@@ -1790,6 +1796,7 @@ def from_url(cls, url=ABOUT_BASE_URL, _LINKS_REPO={}, use_cached_index=False):
1790
1796
_LINKS_REPO [url ] = cls (url = url , use_cached_index = use_cached_index )
1791
1797
return _LINKS_REPO [url ]
1792
1798
1799
+
1793
1800
################################################################################
1794
1801
# Globals for remote repos to be lazily created and cached on first use for the
1795
1802
# life of the session together with some convenience functions.
@@ -1803,6 +1810,7 @@ def get_local_packages(directory=THIRDPARTY_DIR):
1803
1810
"""
1804
1811
return list (PypiPackage .packages_from_dir (directory = directory ))
1805
1812
1813
+
1806
1814
################################################################################
1807
1815
#
1808
1816
# Basic file and URL-based operations using a persistent file-based Cache
@@ -1953,6 +1961,7 @@ def fetch_and_save(
1953
1961
fo .write (content )
1954
1962
return content
1955
1963
1964
+
1956
1965
################################################################################
1957
1966
#
1958
1967
# Functions to update or fetch ABOUT and license files
@@ -2051,7 +2060,9 @@ def get_other_dists(_package, _dist):
2051
2060
# if has key data we may look to improve later, but we can move on
2052
2061
if local_dist .has_key_metadata ():
2053
2062
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
+ )
2055
2066
continue
2056
2067
2057
2068
# lets try to fetch remotely
@@ -2089,7 +2100,9 @@ def get_other_dists(_package, _dist):
2089
2100
# if has key data we may look to improve later, but we can move on
2090
2101
if local_dist .has_key_metadata ():
2091
2102
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
+ )
2093
2106
continue
2094
2107
2095
2108
# try to get data from pkginfo (no license though)
@@ -2107,6 +2120,7 @@ def get_other_dists(_package, _dist):
2107
2120
lic_errs = "\n " .join (lic_errs )
2108
2121
print (f"Failed to fetch some licenses:: { lic_errs } " )
2109
2122
2123
+
2110
2124
################################################################################
2111
2125
#
2112
2126
# Functions to build new Python wheels including native on multiple OSes
@@ -2210,6 +2224,7 @@ def download_wheels_with_pip(
2210
2224
downloaded = existing ^ set (os .listdir (dest_dir ))
2211
2225
return sorted (downloaded ), error
2212
2226
2227
+
2213
2228
################################################################################
2214
2229
#
2215
2230
# Functions to check for problems
0 commit comments