Commit 183258c1 by Sébastien Eustace

Fix remaining calls to Poetry.create()

parent 4dfd66a1
...@@ -163,7 +163,7 @@ class PipInstaller(BaseInstaller): ...@@ -163,7 +163,7 @@ class PipInstaller(BaseInstaller):
def install_directory(self, package): def install_directory(self, package):
from poetry.masonry.builder import SdistBuilder from poetry.masonry.builder import SdistBuilder
from poetry.poetry import Poetry from poetry.factory import Factory
from poetry.utils._compat import decode from poetry.utils._compat import decode
from poetry.utils.env import NullEnv from poetry.utils.env import NullEnv
from poetry.utils.toml_file import TomlFile from poetry.utils.toml_file import TomlFile
...@@ -196,7 +196,9 @@ class PipInstaller(BaseInstaller): ...@@ -196,7 +196,9 @@ class PipInstaller(BaseInstaller):
# file since pip, as of this comment, does not support # file since pip, as of this comment, does not support
# build-system for editable packages # build-system for editable packages
# We also need it for non-PEP-517 packages # We also need it for non-PEP-517 packages
builder = SdistBuilder(Poetry.create(pyproject.parent), NullEnv(), NullIO()) builder = SdistBuilder(
Factory().create_poetry(pyproject.parent), NullEnv(), NullIO()
)
with open(setup, "w", encoding="utf-8") as f: with open(setup, "w", encoding="utf-8") as f:
f.write(decode(builder.build_setup())) f.write(decode(builder.build_setup()))
......
...@@ -144,11 +144,11 @@ class Inspector: ...@@ -144,11 +144,11 @@ class Inspector:
pyproject = TomlFile(sdist_dir / "pyproject.toml") pyproject = TomlFile(sdist_dir / "pyproject.toml")
if pyproject.exists(): if pyproject.exists():
from poetry.poetry import Poetry from poetry.factory import Factory
pyproject_content = pyproject.read() pyproject_content = pyproject.read()
if "tool" in pyproject_content and "poetry" in pyproject_content["tool"]: if "tool" in pyproject_content and "poetry" in pyproject_content["tool"]:
package = Poetry.create(sdist_dir).package package = Factory().create_poetry(sdist_dir).package
return { return {
"name": package.name, "name": package.name,
"version": package.version.text, "version": package.version.text,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment