Skip to content

Commit

Permalink
Support build 1.0 (#8400)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimbleby authored Sep 8, 2023
1 parent 5986df0 commit a16863d
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 19 deletions.
25 changes: 18 additions & 7 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ python = "^3.8"

poetry-core = "1.7.0"
poetry-plugin-export = "^1.5.0"
build = "^0.10.0"
build = "^1.0.3"
cachecontrol = { version = "^0.13.0", extras = ["filecache"] }
cleo = "^2.0.0"
crashtest = "^0.4.1"
Expand Down
9 changes: 4 additions & 5 deletions src/poetry/inspection/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,18 @@
source = '{source}'
dest = '{dest}'
with build.env.IsolatedEnvBuilder() as env:
with build.env.DefaultIsolatedEnv() as env:
builder = build.ProjectBuilder(
srcdir=source,
scripts_dir=env.scripts_dir,
python_executable=env.executable,
source_dir=source,
python_executable=env.python_executable,
runner=pyproject_hooks.quiet_subprocess_runner,
)
env.install(builder.build_system_requires)
env.install(builder.get_requires_for_build('wheel'))
builder.metadata_path(dest)
"""

PEP517_META_BUILD_DEPS = ["build==0.10.0", "pyproject_hooks==1.0.0"]
PEP517_META_BUILD_DEPS = ["build==1.0.3", "pyproject_hooks==1.0.0"]


class PackageInfoError(ValueError):
Expand Down
19 changes: 13 additions & 6 deletions src/poetry/installation/chef.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from __future__ import annotations

import os
import tarfile
import tempfile
import zipfile
Expand Down Expand Up @@ -43,12 +44,19 @@ def __init__(self, env: Env, pool: RepositoryPool) -> None:
self._pool = pool

@property
def executable(self) -> str:
def python_executable(self) -> str:
return str(self._env.python)

@property
def scripts_dir(self) -> str:
return str(self._env._bin_dir)
def make_extra_environ(self) -> dict[str, str]:
path = os.environ.get("PATH")
scripts_dir = str(self._env._bin_dir)
return {
"PATH": (
os.pathsep.join([scripts_dir, path])
if path is not None
else scripts_dir
)
}

def install(self, requirements: Collection[str]) -> None:
from cleo.io.null_io import NullIO
Expand Down Expand Up @@ -109,8 +117,7 @@ def _prepare(
env = IsolatedEnv(venv, self._pool)
builder = ProjectBuilder(
directory,
python_executable=env.executable,
scripts_dir=env.scripts_dir,
python_executable=env.python_executable,
runner=quiet_subprocess_runner,
)
env.install(builder.build_system_requires)
Expand Down

0 comments on commit a16863d

Please sign in to comment.