Skip to content

Commit 782caf8

Browse files
committed
Update noxfile.py and CHANGELOG.md
1 parent 3ff922e commit 782caf8

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning], with the exception that minor rel
1111

1212
### Changed
1313

14+
- 🔧 Changed test circuit level for RL predictor from ALG to INDEP
1415
- 🔥 Drop support for x86 macOS systems ([#421]) ([**@denialhaag**])
1516

1617
## [2.3.0] - 2025-07-29

noxfile.py

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@
1111
from __future__ import annotations
1212

1313
import argparse
14+
import contextlib
1415
import os
1516
import shutil
17+
import tempfile
1618
from typing import TYPE_CHECKING
1719

1820
import nox
1921

2022
if TYPE_CHECKING:
21-
from collections.abc import Sequence
23+
from collections.abc import Generator, Sequence
2224

2325

2426
nox.needs_version = ">=2024.3.2"
@@ -35,6 +37,17 @@
3537
nox.options.error_on_missing_interpreters = True
3638

3739

40+
@contextlib.contextmanager
41+
def preserve_lockfile() -> Generator[None]:
42+
"""Preserve the lockfile by moving it to a temporary directory."""
43+
with tempfile.TemporaryDirectory() as temp_dir_name:
44+
shutil.move("uv.lock", f"{temp_dir_name}/uv.lock")
45+
try:
46+
yield
47+
finally:
48+
shutil.move(f"{temp_dir_name}/uv.lock", "uv.lock")
49+
50+
3851
@nox.session(reuse_venv=True)
3952
def lint(session: nox.Session) -> None:
4053
"""Run the linter."""
@@ -64,7 +77,6 @@ def _run_tests(
6477
"--no-dev",
6578
"--group",
6679
"test",
67-
"--frozen",
6880
*install_args,
6981
"pytest",
7082
*pytest_run_args,
@@ -83,14 +95,14 @@ def tests(session: nox.Session) -> None:
8395
@nox.session(reuse_venv=True, venv_backend="uv", python=PYTHON_ALL_VERSIONS)
8496
def minimums(session: nox.Session) -> None:
8597
"""Test the minimum versions of dependencies."""
86-
_run_tests(
87-
session,
88-
install_args=["--resolution=lowest-direct"],
89-
pytest_run_args=["-Wdefault"],
90-
)
91-
env = {"UV_PROJECT_ENVIRONMENT": session.virtualenv.location}
92-
session.run("uv", "tree", "--frozen", env=env)
93-
session.run("uv", "lock", "--refresh", env=env)
98+
with preserve_lockfile():
99+
_run_tests(
100+
session,
101+
install_args=["--resolution=lowest-direct"],
102+
pytest_run_args=["-Wdefault"],
103+
)
104+
env = {"UV_PROJECT_ENVIRONMENT": session.virtualenv.location}
105+
session.run("uv", "tree", "--frozen", env=env)
94106

95107

96108
@nox.session(reuse_venv=True, venv_backend="uv", python=PYTHON_ALL_VERSIONS)

0 commit comments

Comments
 (0)