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

add maximum Python version check #3821

Merged
merged 3 commits into from
Feb 13, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
adamreichold marked this conversation as resolved.
Show resolved Hide resolved

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
davidhewitt marked this conversation as resolved.
Show resolved Hide resolved

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