From 45c5e4efac0542fa7c47c881a2a038516e8a0f97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Fri, 13 Nov 2026 10:07:59 -0800 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=94=A7=20build(lint):=20pin=20simplin?= =?UTF-8?q?t=200.12.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pre-commit-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d600953..e3993e9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -40,7 +40,7 @@ repos: priority: 3 args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"] - repo: https://github.com/gaborbernat/simplint-pre-commit - rev: 5f12b15e1199c42bdeb3e13ea1c8b45952fbd802 # frozen: v0.11.0 + rev: 36f74b836f184e20c3660656572d7f5b58f3e904 # frozen: v0.12.0 hooks: - id: simplint priority: 4 From 5745b228af7f92a6077a5e09a6d28377c26715a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Fri, 13 Nov 2026 10:08:02 -0800 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=9A=A8=20fix:=20apply=20simplint=200.?= =?UTF-8?q?12.0=20automatic=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/demo_pkg_inline/build.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/demo_pkg_inline/build.py b/tests/demo_pkg_inline/build.py index 6741161..480f965 100644 --- a/tests/demo_pkg_inline/build.py +++ b/tests/demo_pkg_inline/build.py @@ -5,6 +5,7 @@ from io import BytesIO from pathlib import Path from textwrap import dedent +from types import MappingProxyType from typing import Final from zipfile import ZipFile @@ -17,7 +18,7 @@ _METADATA: Final[str] = f"{_DIST_INFO}/METADATA" _WHEEL: Final[str] = f"{_DIST_INFO}/WHEEL" _RECORD: Final[str] = f"{_DIST_INFO}/RECORD" -_CONTENT: Final[dict[str, str]] = { +_CONTENT: Final[MappingProxyType[str, str]] = MappingProxyType({ _LOGIC: f"def do():\n print('greetings from {_NAME}')", _METADATA: f""" Metadata-Version: 2.1 @@ -46,7 +47,7 @@ {_DIST_INFO}/top_level.txt,, {_DIST_INFO}/RECORD,, """, -} +}) def build_wheel( From fde918186a32881c5f6f2299612a4a9d223ff5f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Fri, 13 Nov 2026 10:08:23 -0800 Subject: [PATCH 3/4] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20resolve=20?= =?UTF-8?q?devpi=20scripts=20on=20demand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit IndexServer held one attribute per devpi executable and a flag nothing read, over simplint's attribute limit. Keep the scripts directory and build each executable path where it runs. --- src/devpi_process/__init__.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/devpi_process/__init__.py b/src/devpi_process/__init__.py index 43366d9..9767bb5 100644 --- a/src/devpi_process/__init__.py +++ b/src/devpi_process/__init__.py @@ -101,19 +101,12 @@ def __init__( if scripts_dir is None: msg = "could not get scripts folder of host interpreter" raise RuntimeError(msg) - - def _exe(name: str) -> str: - return str(Path(scripts_dir) / f"{name}{'.exe' if sys.platform == 'win32' else ''}") - - self._init: str = _exe("devpi-init") - self._server: str = _exe("devpi-server") - self._client: str = _exe("devpi") + self._scripts = Path(scripts_dir) self._server_dir = self.path / "server" self._client_dir = self.path / "client" self._indexes: dict[str, Index] = {} self._process: Popen[str] | None = None - self._has_use = False self._stdout_drain: Thread | None = None def __enter__(self) -> Self: @@ -130,13 +123,13 @@ def _create_and_start_server(self) -> None: self._server_dir.mkdir(exist_ok=True) server_at = str(self._server_dir) # 1. create the server - cmd = [self._init, "--serverdir", server_at] + cmd = [self._exe("devpi-init"), "--serverdir", server_at] cmd.extend(("--role", "standalone", "--root-passwd", self._passwd)) if self._with_root_pypi is False: cmd.append("--no-root-pypi") _check_call(cmd) # 2. start the server - cmd = [self._server, "--serverdir", server_at, "--port", str(self.port)] + cmd = [self._exe("devpi-server"), "--serverdir", server_at, "--port", str(self.port)] cmd.extend(self._start_args) self._process = Popen(cmd, stdout=PIPE, universal_newlines=True) # ruff:ignore[subprocess-without-shell-equals-true] # no shell, argument list only stdout = self._drain_stdout() @@ -155,6 +148,9 @@ def _keep_draining() -> None: msg = f"devpi server at {self._server_dir} exited before it was ready" raise RuntimeError(msg) + def _exe(self, name: str) -> str: + return str(self._scripts / f"{name}{'.exe' if sys.platform == 'win32' else ''}") + def _drain_stdout(self) -> Iterator[str]: process = cast("Popen[str]", self._process) stdout = cast("IO[str]", process.stdout) @@ -167,8 +163,8 @@ def _drain_stdout(self) -> Iterator[str]: def _setup_client(self) -> None: self._client_dir.mkdir(exist_ok=True) base = ["--clientdir", str(self._client_dir)] - _check_call([self._client, "use", *base, self.url]) - _check_call([self._client, "login", *base, self.user, "--password", self._passwd]) + _check_call([self._exe("devpi"), "use", *base, self.url]) + _check_call([self._exe("devpi"), "login", *base, self.user, "--password", self._passwd]) @property def url(self) -> str: @@ -214,7 +210,7 @@ def create_index(self, name: str, *args: str) -> Index: if name in self._indexes: msg = f"index {name} already exists" raise ValueError(msg) - base = [self._client, "--clientdir", str(self._client_dir)] + base = [self._exe("devpi"), "--clientdir", str(self._client_dir)] _check_call([*base, "index", "-c", name, *args]) index = Index(f"{self.url}/{self.user}", name, self.user, base) self._indexes[name] = index From 5044cc9af966bb2b058e470534e32911e8ed6708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Fri, 13 Nov 2026 10:08:40 -0800 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=9A=A8=20fix:=20keep=20the=20devpi=20?= =?UTF-8?q?command=20dependencies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/devpi_process/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/devpi_process/__init__.py b/src/devpi_process/__init__.py index 9767bb5..b4d2aeb 100644 --- a/src/devpi_process/__init__.py +++ b/src/devpi_process/__init__.py @@ -1,4 +1,4 @@ -"""Devpi PyPI to test with.""" +"""Devpi PyPI to test with.""" # simplint: ignore[unused-dependency] # Provide the devpi commands it runs. from __future__ import annotations