Skip to content

fix: typing, add pyrefly, migrate to pixi#34

Merged
johanneskoester merged 4 commits intomainfrom
fix/types
Feb 13, 2026
Merged

fix: typing, add pyrefly, migrate to pixi#34
johanneskoester merged 4 commits intomainfrom
fix/types

Conversation

@johanneskoester
Copy link
Contributor

@johanneskoester johanneskoester commented Feb 13, 2026

Summary by CodeRabbit

  • Chores

    • CI/CD updated to use pixi for dependency, build, and publish workflows; gitignore updated for pixi lock files.
  • New Features

    • Environment specs/base enhanced with improved identity handling, source-path management, and more reliable hashing/equality.
  • Refactor

    • Simplified environment base initialization and runtime attribute handling.
  • Tests

    • Removed legacy registry test class and associated test helpers.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 13, 2026

Warning

Rate limit exceeded

@johanneskoester has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 54 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📝 Walkthrough

Walkthrough

Migrates CI from Poetry to pixi, updates workflow checkout actions, adds module-detection and extensive identity/hash APIs to EnvSpecBase and refactors EnvBase field declarations to runtime assignments, and removes the TestRegistry test class from tests/tests.py.

Changes

Cohort / File(s) Summary
CI/CD Workflow Tooling Migration
.github/workflows/release-please.yml, .github/workflows/test.yml
Replaced Poetry/Python setup and poetry-run commands with pixi-based setup and pixi run ... commands; bumped checkout action versions (v3→v6, v4→v5) and updated publish step to use pypa/gh-action-pypi-publish@release/v1 with __token__ authentication.
Build Configuration
.gitignore
Added pixi.lock to ignore and normalized newline at end of file.
Core Library API Expansion and Refactor
snakemake_interface_software_deployment_plugins/__init__.py
Added module() classmethod to EnvSpecBase, new TSettings TypeVar, multiple abstract/public methods (identity_attributes, source_path_attributes, has_source_paths, modify_source_paths, __or__, managed_identity_attributes, __hash__, __eq__, __str__) and adjusted usages to rely on module(). Refactored EnvBase to remove class-level annotated public fields and assign them at runtime in __init__; initialized internal hash/deployment stores. Added imports for getmodule and ModuleType.
Tests Removal
tests/tests.py
Removed TestRegistry test class and its helper/validation methods (plugin registry testing and related helpers deleted).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title encompasses multiple distinct changes: typing fixes, pyrefly addition, and pixi migration, but emphasizes the tooling migration as the primary focus without clearly indicating the typing/API changes to EnvSpecBase and EnvBase. Consider refining the title to better reflect the primary change; for example, 'refactor: migrate to pixi and modernize type annotations' would be more descriptive of the actual scope.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/types

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
snakemake_interface_software_deployment_plugins/__init__.py (1)

274-283: ⚠️ Potential issue | 🟡 Minor

Pre-existing: _managed_generic_hash never persists the computed hash back to self.

The computed hash is assigned to the local store variable but never written back to the instance attribute via setattr(self, f"_managed_{kind}_store", store). This means hash() and deployment_hash() recompute the MD5 on every call instead of caching. Not introduced by this PR, but worth fixing while you're in this area.

Proposed fix
     def _managed_generic_hash(self, kind: str) -> str:
-        store = getattr(self, f"_managed_{kind}_store")
-        if store is None:
+        attr = f"_managed_{kind}_store"
+        store = getattr(self, attr)
+        if store is None:
             record_hash = f"record_{kind}"
             hash_object = hashlib.md5()
             if self.within is not None:
                 getattr(self.within, record_hash)(hash_object)
             getattr(self, record_hash)(hash_object)
             store = hash_object.hexdigest()
+            setattr(self, attr, store)
         return store
🧹 Nitpick comments (3)
.github/workflows/release-please.yml (1)

14-16: Inconsistent checkout action versions across workflows.

This file uses actions/checkout@v6 (line 25), while .github/workflows/test.yml uses @v5 for the formatting and linting jobs (lines 15, 27) but @v6 for the testing job (line 38). Consider aligning all checkout steps to the same version for consistency.

.github/workflows/test.yml (1)

15-15: Inconsistent actions/checkout versions within the same workflow.

The formatting and linting jobs use actions/checkout@v5 (lines 15, 27) while the testing job uses actions/checkout@v6 (line 38). Pick one version consistently.

Proposed fix
       - name: Check out the code
-        uses: actions/checkout@v5
+        uses: actions/checkout@v6

...

       - name: Check out the code
-        uses: actions/checkout@v5
+        uses: actions/checkout@v6

Also applies to: 27-27, 38-38

snakemake_interface_software_deployment_plugins/__init__.py (1)

160-161: TSettings TypeVar is unused in this file but exported as part of the public API.

Confirmed that TSettings is not referenced within this file or elsewhere in the repository. However, since this is a plugin interface library, it appears to be intentionally exported for plugin implementations to use in their own type annotations. Consider adding a brief comment explaining its purpose as a TypeVar for plugin developers (e.g., # TypeVar for plugin implementations to annotate Settings-compatible types).

@johanneskoester johanneskoester merged commit 6532631 into main Feb 13, 2026
5 checks passed
@johanneskoester johanneskoester deleted the fix/types branch February 13, 2026 19:11
johanneskoester pushed a commit that referenced this pull request Feb 13, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.9.1](v0.9.0...v0.9.1)
(2026-02-13)


### Bug Fixes

* typing, add pyrefly, migrate to pixi
([#34](#34))
([6532631](6532631))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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