Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix crash when users run Nox with the new --no-install option #382

Merged
merged 8 commits into from
Jun 11, 2021

Conversation

cjolowicz
Copy link
Owner

@cjolowicz cjolowicz commented May 30, 2021

The --no-install option introduced in Nox 2021.6.6 means that session.run_always can return None instead of the command output. This breaks assumptions nox-poetry makes when using its Poetry helper class to build a package or export a requirements file. Currently, this will lead to an assertion failure, and a cryptic error message.

This PR fixes the behavior when --no-install is passed:

  • If the user invoked session.install or session.poetry.installroot, we skip all commands silently.
  • If the user invoked session.poetry.export_requirements or session.poetry.build_package, we cannot skip the command silently, because the function must return something. Instead, we raise an exception with a helpful message.

@cjolowicz cjolowicz marked this pull request as ready for review June 11, 2021 10:43
@cjolowicz cjolowicz changed the title Support nox --no-install Support nox --no-install Jun 11, 2021
@cjolowicz cjolowicz added the bug Something isn't working label Jun 11, 2021
@cjolowicz cjolowicz changed the title Support nox --no-install Fix crash when users run Nox with the new --no-install option Jun 11, 2021
@cjolowicz cjolowicz merged commit 8e0262b into main Jun 11, 2021
@cjolowicz cjolowicz deleted the no-install branch June 11, 2021 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant