Skip to content

Commit

Permalink
respect build requirements at poetry install (#7975)
Browse files Browse the repository at this point in the history
fix an issue where build requirements were not respected if a build script is used and `generate-setup-file` is set to true
  • Loading branch information
dimbleby authored Jun 11, 2023
1 parent 17454be commit 6e94298
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/poetry/masonry/builders/editable.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from pathlib import Path
from typing import TYPE_CHECKING

from poetry.core.constraints.version import Version
from poetry.core.masonry.builders.builder import Builder
from poetry.core.masonry.builders.sdist import SdistBuilder
from poetry.core.masonry.utils.package_include import PackageInclude
Expand Down Expand Up @@ -101,16 +100,7 @@ def _setup_build(self) -> None:
f.write(decode(builder.build_setup()))

try:
if self._env.pip_version < Version.from_parts(19, 0):
pip_install(self._path, self._env, upgrade=True, editable=True)
else:
# Temporarily rename pyproject.toml
renamed_pyproject = self._poetry.file.path.with_suffix(".tmp")
self._poetry.file.path.rename(renamed_pyproject)
try:
pip_install(self._path, self._env, upgrade=True, editable=True)
finally:
renamed_pyproject.rename(self._poetry.file.path)
pip_install(self._path, self._env, upgrade=True, editable=True)
finally:
if not has_setup:
os.remove(setup)
Expand Down

0 comments on commit 6e94298

Please sign in to comment.