Skip to content

Commit

Permalink
fix: Do not skip pre-install commands when --install-only is passed
Browse files Browse the repository at this point in the history
  • Loading branch information
cjolowicz committed Mar 13, 2021
1 parent c846e71 commit 7161353
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/nox_poetry/poetry.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def export(self, path: Path) -> None:
Args:
path: The destination path.
"""
self.session.run(
self.session.run_always(
"poetry",
"export",
"--format=requirements.txt",
Expand Down Expand Up @@ -102,7 +102,7 @@ def build(self, *, format: str) -> str:
if not isinstance(format, DistributionFormat):
format = DistributionFormat(format)

output = self.session.run(
output = self.session.run_always(
"poetry",
"build",
f"--format={format}",
Expand Down
4 changes: 2 additions & 2 deletions src/nox_poetry/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def rewrite(arg: str, extras: Optional[str]) -> str:

args = tuple(rewrite(arg, extras) for arg, extras in args_extras)

self.session.run("pip", "uninstall", "--yes", package, silent=True)
self.session.run_always("pip", "uninstall", "--yes", package, silent=True)

requirements = self.export_requirements()
Session_install(self.session, f"--constraint={requirements}", *args, **kwargs)
Expand Down Expand Up @@ -133,7 +133,7 @@ def installroot(
package = self.build_package(distribution_format=distribution_format)
requirements = self.export_requirements()

self.session.run("pip", "uninstall", "--yes", package, silent=True)
self.session.run_always("pip", "uninstall", "--yes", package, silent=True)

suffix = ",".join(extras)
if suffix.strip():
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, path: Path) -> None:
"""Initialize."""
self.path = path

def run(self, *args: str, **kargs: Any) -> str:
def run_always(self, *args: str, **kargs: Any) -> str:
"""Run."""
path = Path("dist") / "example.whl"
path.touch()
Expand Down

0 comments on commit 7161353

Please sign in to comment.