Skip to content

💥 boom: replace Protocols with optype equivalents#75

Open
nstarman wants to merge 2 commits intoGalacticDynamics:mainfrom
nstarman:optype
Open

💥 boom: replace Protocols with optype equivalents#75
nstarman wants to merge 2 commits intoGalacticDynamics:mainfrom
nstarman:optype

Conversation

@nstarman
Copy link
Contributor

No description provided.

Signed-off-by: nstarman <nstarman@users.noreply.github.com>
@nstarman nstarman added this to the v0.9.0 milestone Jan 28, 2026
Copilot AI review requested due to automatic review settings January 28, 2026 15:53
@github-actions github-actions bot added 🔧 Add / update configuration Add or update configuration files. ➕ Add a dependency Add a dependency. 💥 Introduce breaking changes Introduce breaking changes. labels Jan 28, 2026
@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.33%. Comparing base (c1bbc41) to head (bf93eae).

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #75      +/-   ##
==========================================
- Coverage   97.36%   97.33%   -0.04%     
==========================================
  Files          12       12              
  Lines         304      300       -4     
==========================================
- Hits          296      292       -4     
  Misses          8        8              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

Copilot AI left a comment

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 replaces the internal CanCopyReplace Protocol with the equivalent opt.copy.CanReplaceSelf from the optype library. This is a breaking change that removes a previously exported type from the public API.

Changes:

  • Added optype>=0.9.3 as a new dependency with version-specific constraints (0.9.3 for Python <3.11, 0.15.0 for Python ≥3.11)
  • Removed the CanCopyReplace Protocol class and exported type from the codebase
  • Updated all usages of CanCopyReplace to use opt.copy.CanReplaceSelf instead

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
uv.lock Added optype dependency with appropriate version constraints for different Python versions
pyproject.toml Added optype>=0.9.3 to project dependencies
src/dataclassish/_src/types.py Removed CanCopyReplace Protocol definition and export, removed now-unused Self import
src/dataclassish/_src/register_copyreplace.py Updated to import and use opt.copy.CanReplaceSelf instead of local CanCopyReplace; updated docstring
src/dataclassish/init.py Removed CanCopyReplace from public exports and imports

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

➕ Add a dependency Add a dependency. 🔧 Add / update configuration Add or update configuration files. 💥 Introduce breaking changes Introduce breaking changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant