Skip to content

Commit

Permalink
fix (pip_installer): to many arguments for SdistBuilder
Browse files Browse the repository at this point in the history
fix (installed_repository): Catch CalledProcessError when trying to fetch revision
  • Loading branch information
finswimmer committed Apr 4, 2020
1 parent 7ce3f18 commit 8fec715
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 1 addition & 5 deletions poetry/installation/pip_installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from subprocess import CalledProcessError

from clikit.api.io import IO
from clikit.io import NullIO

from poetry.repositories.pool import Pool
from poetry.utils._compat import Path
Expand Down Expand Up @@ -182,7 +181,6 @@ def install_directory(self, package):
from poetry.core.masonry.builder import SdistBuilder
from poetry.factory import Factory
from poetry.utils._compat import decode
from poetry.utils.env import NullEnv
from poetry.utils.toml_file import TomlFile

if package.root_dir:
Expand Down Expand Up @@ -213,9 +211,7 @@ def install_directory(self, package):
# file since pip, as of this comment, does not support
# build-system for editable packages
# We also need it for non-PEP-517 packages
builder = SdistBuilder(
Factory().create_poetry(pyproject.parent), NullEnv(), NullIO()
)
builder = SdistBuilder(Factory().create_poetry(pyproject.parent))

with open(setup, "w", encoding="utf-8") as f:
f.write(decode(builder.build_setup()))
Expand Down
4 changes: 3 additions & 1 deletion poetry/repositories/installed_repository.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from subprocess import CalledProcessError

from poetry.core.packages import Package
from poetry.utils._compat import Path
from poetry.utils._compat import metadata
Expand Down Expand Up @@ -69,7 +71,7 @@ def load(cls, env): # type: (Env) -> InstalledRepository
package.source_type = "git"
package.source_url = url
package.source_reference = revision
except ValueError:
except (ValueError, CalledProcessError):
package.source_type = "directory"
package.source_url = str(path.parent)

Expand Down

0 comments on commit 8fec715

Please sign in to comment.