From f15c78b150d9d41bff460badb676844da35fe1f6 Mon Sep 17 00:00:00 2001 From: "J.C. Macdonald" <72512262+jc-macdonald@users.noreply.github.com> Date: Wed, 8 Apr 2026 06:00:30 -0400 Subject: [PATCH] fix: align provider mypy/test with op_engine pattern MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove [tool.mypy] from provider pyproject.toml — it set mypy_path and explicit_package_bases which caused mypy to resolve the namespace package tree as a top-level module, shadowing the installed op_system package. Provider mypy is now driven entirely from the justfile CLI with --namespace-packages --explicit-package-bases flags. Add provider-sync recipe (matching op_engine) to create an isolated venv for provider checks. Closes #51 --- flepimop2-op_system/pyproject.toml | 7 ------- justfile | 15 +++++++++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/flepimop2-op_system/pyproject.toml b/flepimop2-op_system/pyproject.toml index a2073ee..5cf86f9 100644 --- a/flepimop2-op_system/pyproject.toml +++ b/flepimop2-op_system/pyproject.toml @@ -78,13 +78,6 @@ ignore = [ [tool.ruff.lint.pydocstyle] convention = "google" -[tool.mypy] -strict = true -files = "." -namespace_packages = true -explicit_package_bases = true -mypy_path = "$MYPY_CONFIG_FILE_DIR/src" - [dependency-groups] dev = [ "pytest>=8.4.2", diff --git a/justfile b/justfile index 280155e..221f37b 100644 --- a/justfile +++ b/justfile @@ -73,8 +73,15 @@ test-root: # Run the provider package test suite [group('dev')] [group('ci')] -test-provider: - {{provider_run}} pytest +test-provider: provider-sync + cd {{provider_dir}} && .venv/bin/python -m pytest + +# Create/refresh the provider venv and install all deps (including dev group). +# Run this once before running provider pytest/mypy if you aren't using `ci`. +[group('dev')] +provider-sync: + cd {{provider_dir}} && uv venv --clear + cd {{provider_dir}} && uv sync --dev # Run type checks in both packages [group('dev')] @@ -90,8 +97,8 @@ mypy-root: # Run mypy for the provider package [group('dev')] [group('ci')] -mypy-provider: - {{provider_run}} mypy +mypy-provider: provider-sync + cd {{provider_dir}} && .venv/bin/python -m mypy --strict --namespace-packages --explicit-package-bases src/flepimop2 # Run all CI quality checks [group('ci')]