Skip to content

nox fails in CI even when nox.options.error_on_missing_interpreters = False #650

@johnthagen

Description

@johnthagen

Current Behavior

This PR makes CI fail if there are missing Python interpreters:

There was an exception for --no-error-on-missing-interpreters to override this behavior, but setting this in the noxfile.py itself does not work:

nox.options.error_on_missing_interpreters = False

In CI:

nox > Session test-3.9 was successful.
nox > Running session test-3.10
nox > Session test-3.10 failed: Python interpreter 3.10 not found.
nox > Ran multiple sessions:
nox > * test-3.9: success
nox > * test-3.10: failed

Expected Behavior

When nox.options.error_on_missing_interpreters = False is set, missing interpreters should not fail in CI.

Steps To Reproduce

Create a noxfile.py with

import nox

nox.options.error_on_missing_interpreters = False

@session(python=["3.9", "3.10"])
def test(s: Session) -> None:
    ...

Run this in a python:3.9 Docker image in GitLab CI.

nox > Session test-3.9 was successful.
nox > Running session test-3.10
nox > Session test-3.10 failed: Python interpreter 3.10 not found.
nox > Ran multiple sessions:
nox > * test-3.9: success
nox > * test-3.10: failed

Environment

- OS: `python:3.9` DockerHub image running on GitLab CI
- Python: 3.9
- Nox: 2022.8.7

Anything else?

tox allows this to be set in their configuration file:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions