Skip to content

Commit

Permalink
Merge pull request #263 from sarugaku/bugfix/262
Browse files Browse the repository at this point in the history
Fix PEP 517 requires
  • Loading branch information
frostming authored Aug 12, 2020
2 parents c05332e + 99ffef6 commit 2d62643
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions news/262.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the PEP 517 requires in default ``pyproject.toml`` and clean the temp files.
21 changes: 18 additions & 3 deletions src/requirementslib/models/setup_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -1580,8 +1580,14 @@ def pep517_config(self):

def build_wheel(self):
# type: () -> S
need_delete = False
if not self.pyproject.exists():
build_requires = ", ".join(['"{0}"'.format(r) for r in self.build_requires])
if not self.build_requires:
build_requires = '"setuptools", "wheel"'
else:
build_requires = ", ".join(
['"{0}"'.format(r) for r in self.build_requires]
)
self.pyproject.write_text(
six.text_type(
"""
Expand All @@ -1593,16 +1599,21 @@ def build_wheel(self):
).strip()
)
)
return build_pep517(
need_delete = True
result = build_pep517(
self.base_dir,
self.extra_kwargs["build_dir"],
config_settings=self.pep517_config,
dist_type="wheel",
)
if need_delete:
self.pyproject.unlink()
return result

# noinspection PyPackageRequirements
def build_sdist(self):
# type: () -> S
need_delete = False
if not self.pyproject.exists():
if not self.build_requires:
build_requires = '"setuptools", "wheel"'
Expand All @@ -1621,12 +1632,16 @@ def build_sdist(self):
).strip()
)
)
return build_pep517(
need_delete = True
result = build_pep517(
self.base_dir,
self.extra_kwargs["build_dir"],
config_settings=self.pep517_config,
dist_type="sdist",
)
if need_delete:
self.pyproject.unlink()
return result

def build(self):
# type: () -> "SetupInfo"
Expand Down

0 comments on commit 2d62643

Please sign in to comment.