@@ -1580,8 +1580,14 @@ def pep517_config(self):
1580
1580
1581
1581
def build_wheel (self ):
1582
1582
# type: () -> S
1583
+ need_delete = False
1583
1584
if not self .pyproject .exists ():
1584
- build_requires = ", " .join (['"{0}"' .format (r ) for r in self .build_requires ])
1585
+ if not self .build_requires :
1586
+ build_requires = '"setuptools", "wheel"'
1587
+ else :
1588
+ build_requires = ", " .join (
1589
+ ['"{0}"' .format (r ) for r in self .build_requires ]
1590
+ )
1585
1591
self .pyproject .write_text (
1586
1592
six .text_type (
1587
1593
"""
@@ -1593,16 +1599,21 @@ def build_wheel(self):
1593
1599
).strip ()
1594
1600
)
1595
1601
)
1596
- return build_pep517 (
1602
+ need_delete = True
1603
+ result = build_pep517 (
1597
1604
self .base_dir ,
1598
1605
self .extra_kwargs ["build_dir" ],
1599
1606
config_settings = self .pep517_config ,
1600
1607
dist_type = "wheel" ,
1601
1608
)
1609
+ if need_delete :
1610
+ self .pyproject .unlink ()
1611
+ return result
1602
1612
1603
1613
# noinspection PyPackageRequirements
1604
1614
def build_sdist (self ):
1605
1615
# type: () -> S
1616
+ need_delete = False
1606
1617
if not self .pyproject .exists ():
1607
1618
if not self .build_requires :
1608
1619
build_requires = '"setuptools", "wheel"'
@@ -1621,12 +1632,16 @@ def build_sdist(self):
1621
1632
).strip ()
1622
1633
)
1623
1634
)
1624
- return build_pep517 (
1635
+ need_delete = True
1636
+ result = build_pep517 (
1625
1637
self .base_dir ,
1626
1638
self .extra_kwargs ["build_dir" ],
1627
1639
config_settings = self .pep517_config ,
1628
1640
dist_type = "sdist" ,
1629
1641
)
1642
+ if need_delete :
1643
+ self .pyproject .unlink ()
1644
+ return result
1630
1645
1631
1646
def build (self ):
1632
1647
# type: () -> "SetupInfo"
@@ -1874,10 +1889,7 @@ def from_ireq(cls, ireq, subdir=None, finder=None, session=None):
1874
1889
ireq .link , "is_vcs" , getattr (ireq .link , "is_artifact" , False )
1875
1890
)
1876
1891
is_vcs = True if vcs else is_artifact_or_vcs
1877
- if is_file and not is_vcs and path is not None and os .path .isdir (path ):
1878
- target = os .path .join (kwargs ["src_dir" ], os .path .basename (path ))
1879
- shutil .copytree (path , target , symlinks = True )
1880
- ireq .source_dir = target
1892
+
1881
1893
if not (ireq .editable and is_file and is_vcs ):
1882
1894
if ireq .is_wheel :
1883
1895
only_download = True
@@ -1895,10 +1907,12 @@ def from_ireq(cls, ireq, subdir=None, finder=None, session=None):
1895
1907
if build_location_func is None :
1896
1908
build_location_func = getattr (ireq , "ensure_build_location" , None )
1897
1909
if not ireq .source_dir :
1898
- build_kwargs = {"build_dir" : kwargs ["build_dir" ], "autodelete" : False }
1910
+ build_kwargs = {
1911
+ "build_dir" : kwargs ["build_dir" ],
1912
+ "autodelete" : False , "parallel_builds" : True
1913
+ }
1899
1914
call_function_with_correct_args (build_location_func , ** build_kwargs )
1900
1915
ireq .ensure_has_source_dir (kwargs ["src_dir" ])
1901
- src_dir = ireq .source_dir
1902
1916
pip_shims .shims .shim_unpack (
1903
1917
download_dir = download_dir ,
1904
1918
ireq = ireq ,
0 commit comments