Skip to content

Adopt uv dependency groups and enable ruff SIM cleanups#409

Merged
RonnyPfannschmidt merged 2 commits into
pytest-dev:masterfrom
RonnyPfannschmidt:ronny/uv-sync
Jul 21, 2026
Merged

Adopt uv dependency groups and enable ruff SIM cleanups#409
RonnyPfannschmidt merged 2 commits into
pytest-dev:masterfrom
RonnyPfannschmidt:ronny/uv-sync

Conversation

@RonnyPfannschmidt

Copy link
Copy Markdown
Member

Summary

  • Move testing dependencies from optional-dependencies to PEP 735 dependency-groups, add [tool.uv] defaults, and commit uv.lock for reproducible local setup with uv sync.
  • Enable ruff SIM and apply related simplifications (contextlib.suppress, with open, clearer exception handling) in gateway/rsync/script code.

Test plan

  • uv sync installs the testing group cleanly
  • tox / CI test matrix still passes
  • ruff/pre-commit are clean with SIM enabled

Made with Cursor

Move testing deps to PEP 735 dependency-groups with a lockfile for
reproducible local setup, and apply SIM-driven style simplifications.

Co-authored-by: Cursor AI <ai@cursor.sh>
Co-authored-by: Cursor Grok 4.5 <grok@x.ai>
Copilot AI review requested due to automatic review settings July 21, 2026 15:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Execnet’s Python tooling configuration to use uv dependency groups (PEP 735) with a committed lockfile for reproducible development installs, and enables Ruff’s SIM rules while applying related simplifications across gateway/rsync/script code.

Changes:

  • Add uv.lock, configure [dependency-groups] and [tool.uv], and enable Ruff SIM linting.
  • Apply SIM-driven refactors (context managers for file IO, contextlib.suppress, small conditional simplifications) in gateway/rsync/script modules.
  • Minor typing cleanup (e.g., use set[...] instead of MutableSet).

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
uv.lock Adds a uv lockfile for reproducible local environment setup.
pyproject.toml Moves test deps to dependency groups, sets uv defaults, and enables Ruff SIM.
src/execnet/gateway_base.py SIM cleanups and small refactors in channel lifecycle and IO setup.
src/execnet/rsync.py Uses context-manager file reads and renames a local variable for clarity.
src/execnet/rsync_remote.py Uses contextlib.suppress and context-manager file IO.
src/execnet/script/shell.py Switches file read to a with open(...) context manager.
src/execnet/script/socketserver.py Adds SIM115 suppression for a debug log handle; simplifies CLI arg parsing.
src/execnet/script/socketserverservice.py Adds SIM115 suppression for redirected stdout/stderr handle.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/execnet/gateway_base.py Outdated
Comment thread pyproject.toml Outdated
Keep OSError suppression in Channel.__del__, simplify
_no_longer_opened without a dummy callback, ignore SIM105/SIM115,
and keep the published testing extra for pip install.

Co-authored-by: Cursor AI <ai@cursor.sh>
Co-authored-by: Cursor Grok 4.5 <grok@x.ai>
@RonnyPfannschmidt
RonnyPfannschmidt merged commit 2060bd4 into pytest-dev:master Jul 21, 2026
15 checks passed
@RonnyPfannschmidt
RonnyPfannschmidt deleted the ronny/uv-sync branch July 21, 2026 16:39
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.

2 participants