From 5431ee908c56906adc1de9e32f73a0f2b47fff85 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Oct 2026 04:28:32 +0000 Subject: [PATCH 1/2] deps: bump ruff from 0.16.10 to 0.17.1 in the python-dependencies group Bumps the python-dependencies group with 1 update: [ruff](https://github.com/astral-sh/ruff). Updates `ruff` from 0.16.10 to 0.17.1 - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/0.16.10...0.17.1) --- updated-dependencies: - dependency-name: ruff dependency-version: 0.17.1 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: python-dependencies ... Signed-off-by: dependabot[bot] --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 583641a..dbc7f72 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,7 +22,7 @@ dev = [ "exceptiongroup>=1", "pytest>=7.4", "pytest-cov>=5.0", - "ruff==0.16.10", + "ruff==0.17.1", "tomli>=1", ] From bb64c7bba647dde5046da9ca7aafbd8865a0c6cd Mon Sep 17 00:00:00 2001 From: PureSaber <88314620+PureSaber@users.noreply.github.com> Date: Thu, 22 Oct 2026 12:44:09 +0800 Subject: [PATCH 2/2] fix: synchronize dependency locks and verify declared requirements --- requirements.lock | 2 +- tests/test_declared_dependency_lock.py | 56 ++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 tests/test_declared_dependency_lock.py diff --git a/requirements.lock b/requirements.lock index 024c7d7..7317e67 100644 --- a/requirements.lock +++ b/requirements.lock @@ -80,7 +80,7 @@ rpds-py==0.30.0 # -c requirements-constraints.txt # jsonschema # referencing -ruff==0.16.10 +ruff==0.17.1 # via quant-execution (pyproject.toml) six==1.17.0 # via python-dateutil diff --git a/tests/test_declared_dependency_lock.py b/tests/test_declared_dependency_lock.py new file mode 100644 index 0000000..5290d35 --- /dev/null +++ b/tests/test_declared_dependency_lock.py @@ -0,0 +1,56 @@ +"""The environment used by CI must satisfy declared runtime and development requirements.""" + +from pathlib import Path + +try: + import tomllib +except ModuleNotFoundError: + import tomli as tomllib + +from packaging.markers import default_environment +from packaging.requirements import Requirement +from packaging.utils import canonicalize_name + +ROOT = Path(__file__).resolve().parents[1] +LOCKS = ["requirements.lock"] +EXTRAS = ["dev"] + + +def test_locked_environment_satisfies_declared_requirements(): + metadata = tomllib.loads((ROOT / "pyproject.toml").read_text(encoding="utf-8")) + declared = list(metadata["project"].get("dependencies", [])) + declared.extend(metadata["build-system"]["requires"]) + for extra in EXTRAS: + declared.extend(metadata["project"]["optional-dependencies"][extra]) + for filename in LOCKS: + locked = [ + Requirement(line) + for line in (ROOT / filename).read_text(encoding="utf-8").splitlines() + if line and not line.startswith(("#", " ", "-")) + ] + for version in ("3.10", "3.11", "3.12"): + for platform in ("win32", "linux"): + environment = { + **default_environment(), + "python_version": version, + "python_full_version": version + ".0", + "sys_platform": platform, + } + active = { + canonicalize_name(item.name): item + for item in locked + if item.marker is None or item.marker.evaluate(environment) + } + for text in declared: + requirement = Requirement(text) + if requirement.url or ( + requirement.marker and not requirement.marker.evaluate(environment) + ): + continue + name = canonicalize_name(requirement.name) + assert name in active, f"{filename}: missing {name} on {version}/{platform}" + pins = [pin.version for pin in active[name].specifier if pin.operator == "=="] + assert len(pins) == 1, f"{filename}: {name} must have one exact version" + assert requirement.specifier.contains(pins[0]), ( + f"{filename}: {name}=={pins[0]} does not satisfy {requirement.specifier}" + )