Skip to content

Commit

Permalink
fix clippy-all noxfile job
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Feb 12, 2024
1 parent 93affec commit fb0260c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
from functools import lru_cache
from glob import glob
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Tuple
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple

import nox
import nox.command

nox.options.sessions = ["test", "clippy", "rustfmt", "ruff", "docs"]

Expand Down Expand Up @@ -101,7 +102,7 @@ def _clippy(session: nox.Session, *, env: Dict[str, str] = None) -> bool:
"--deny=warnings",
env=env,
)
except Exception:
except nox.command.CommandFailed:
success = False
return success

Expand Down Expand Up @@ -736,7 +737,7 @@ def _for_all_version_configs(
) -> None:
env = os.environ.copy()
with _config_file() as config_file:
env["PYO3_CONFIG_FILE"] = config_file
env["PYO3_CONFIG_FILE"] = config_file.name

def _job_with_config(implementation, version):
session.log(f"{implementation} {version}")
Expand Down Expand Up @@ -773,7 +774,7 @@ def name(self) -> str:


@contextmanager
def _config_file() -> _ConfigFile:
def _config_file() -> Iterator[_ConfigFile]:
"""Creates a temporary config file which can be repeatedly set to different values."""
with tempfile.NamedTemporaryFile("r+") as config:
yield _ConfigFile(config)
Expand Down

0 comments on commit fb0260c

Please sign in to comment.