Skip to content

Modernizing packaging#127

Merged
marcosfrenkel merged 12 commits intotoolsforexperiments:masterfrom
marcosfrenkel:modernizing_packaging
Apr 30, 2026
Merged

Modernizing packaging#127
marcosfrenkel merged 12 commits intotoolsforexperiments:masterfrom
marcosfrenkel:modernizing_packaging

Conversation

@marcosfrenkel
Copy link
Copy Markdown
Collaborator

@marcosfrenkel marcosfrenkel commented Apr 23, 2026

Summary

Modernizes the project's Python packaging and tooling.

  • Source layout. Moved everything to src/instrumentserver/ (PEP 621 / src-layout).
  • Dependency management. Switched to uv. pyproject.toml rewritten with project metadata, scripts, optional monitoring dep, and dependency-groups for dev and docs. uv.lock checked in.
  • Linting. Adopted ruff (extend-select = ["I"]). Codebase passes uv run ruff check src/.
  • Type checking. Adopted mypy with strict-ish flags (strict_optional, disallow_untyped_defs, warn_unused_ignores, etc.). uv run mypy passes — see scope note below.
  • Tests. Added test_base.py, test_client_station.py, test_config.py, test_helpers.py. Expanded test_param_manager.py, test_json_serializable.py, test_server_gui.py. Hardened ZMQ/Qt teardown to prevent cross-test instrument leaks. 94 tests total.
  • CI. Sphinx-docs workflow already migrated to uv. Added a ci.yml workflow running ruff + mypy + pytest (with xvfb for the Qt suite).
  • Bug fix. ParameterBroadcastBluePrint.pprint() referenced a non-existent self.bp_type attribute (caught by the type sweep); reference removed.

Scope note: type-ignore comments

mypy is currently green at the cost of 208 # type: ignore comments in src/. Cleaning these up is intentionally out of scope for this PR to keep the diff bounded. The full plan — root-cause buckets (A–N), four named structural problems, and a priority ordering targeting 208 → ~30 ignores — is tracked in a separate issue.

Test plan

  • uv run ruff check src/ exits 0
  • uv run mypy exits 0
  • uv run pytest — 94/94 passing (~49s)
  • New ci.yml workflow goes green on first push

Terminate zmq contexts on disconnect, close instrument tabs in window
closeEvents so SubClient threads exit, make refreshStationComponents
defensive against None, and misc dummy-instrument/conftest fixes so
test_client_station and most of test_server_gui pass cleanly.
@marcosfrenkel marcosfrenkel force-pushed the modernizing_packaging branch from 4f69fb8 to 32be17f Compare April 30, 2026 21:03
@marcosfrenkel marcosfrenkel force-pushed the modernizing_packaging branch from 10bb542 to 3cddf38 Compare April 30, 2026 22:03
@marcosfrenkel marcosfrenkel merged commit 10aee48 into toolsforexperiments:master Apr 30, 2026
7 checks passed
@marcosfrenkel marcosfrenkel deleted the modernizing_packaging branch April 30, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant