Files
MINGW-packages/mingw-w64-python-poetry/8400.patch
Christoph Reiter 13821d9eee poetry: backport fix for newer python-build
and add some context to the jsonschema patching while at it
2023-09-07 09:41:35 +02:00

87 lines
2.7 KiB
Diff

diff --git a/pyproject.toml b/pyproject.toml
index 8f5db44f8a..52fc2013fc 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -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.0"
cachecontrol = { version = "^0.13.0", extras = ["filecache"] }
cleo = "^2.0.0"
crashtest = "^0.4.1"
diff --git a/src/poetry/inspection/info.py b/src/poetry/inspection/info.py
index d1461d4ed7..f7f32c552d 100644
--- a/src/poetry/inspection/info.py
+++ b/src/poetry/inspection/info.py
@@ -46,11 +46,10 @@
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)
@@ -58,7 +57,7 @@
builder.metadata_path(dest)
"""
-PEP517_META_BUILD_DEPS = ["build==0.10.0", "pyproject_hooks==1.0.0"]
+PEP517_META_BUILD_DEPS = ["build==1.0.0", "pyproject_hooks==1.0.0"]
class PackageInfoError(ValueError):
diff --git a/src/poetry/installation/chef.py b/src/poetry/installation/chef.py
index da8679df21..bcbb77d5ba 100644
--- a/src/poetry/installation/chef.py
+++ b/src/poetry/installation/chef.py
@@ -1,5 +1,6 @@
from __future__ import annotations
+import os
import tarfile
import tempfile
import zipfile
@@ -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
@@ -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)