Skip to content

Package updates - #104

Merged
jcharkow merged 6 commits into
mainfrom
package_updates
Dec 11, 2025
Merged

Package updates#104
jcharkow merged 6 commits into
mainfrom
package_updates

Conversation

@jcharkow

@jcharkow jcharkow commented Dec 11, 2025

Copy link
Copy Markdown
Collaborator

Update packages that perform the testing on by updating the requirements.txt file.

Fix breaking changes in snapshot extensions as a result to syrupy 5.0.0

Summary by CodeRabbit

  • Refactor

    • Snapshot testing extensions: several previously-internal attributes and methods are now public across formats, expanding the public API for snapshot read/write and file-type handling; minor serialization/formatting adjustments included.
  • Chores

    • Large dependency refresh and reorganization: numerous packages pinned to newer versions, additions and removals across tooling and data stacks.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Dec 11, 2025

Copy link
Copy Markdown

Walkthrough

Five testing snapshot extension modules had private attributes and methods made public (leading underscores removed); requirements.txt was extensively updated with many dependency version changes, additions, and removals.

Changes

Cohort / File(s) Summary
Snapshot Extension API Exposure
pyopenms_viz/testing/BokehSnapshotExtension.py, pyopenms_viz/testing/MatplotlibSnapshotExtension.py, pyopenms_viz/testing/NumpySnapshotExtension.py, pyopenms_viz/testing/PandasSnapshotExtension.py, pyopenms_viz/testing/PlotlySnapshotExtension.py
Renamed private members to public: _file_extensionfile_extension, _read_snapshot_data_from_locationread_snapshot_data_from_location, and _write_snapshot_collectionwrite_snapshot_collection. Minor formatting/quote changes; one file removed @classmethod from the write method.
Dependency Updates
requirements.txt
Large-scale dependency pin updates: many version bumps, package additions and removals, reorganization of extras (e.g., bleach[css]), and broad upgrades across numpy, pandas, matplotlib, sphinx, pytest, and related tooling.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • review points:
    • requirements.txt — verify cross-package compatibility and CI/build implications.
    • pyopenms_viz/testing/MatplotlibSnapshotExtension.py — check removal of @classmethod and any call sites.
    • Ensure tests and external callers referencing underscored names are updated to new public names.
    • Confirm consistent behavior across all snapshot extension implementations after renaming.

Poem

🐰 I hopped through lines at break of day,

nudged away underscores in a playful way.
Now methods bound to sunlight gleam,
dependencies spruced, a developer's dream.
Thump-thump—code ready, off I scamper, hooray!

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 18.18% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'Package updates' is generic and vague, failing to convey the specific work done: both dependency version updates and critical fixes for syrupy 5.0.0 breaking changes in snapshot extensions. Consider a more specific title like 'Update dependencies and fix snapshot extensions for syrupy 5.0.0 compatibility' to better reflect the actual changes and their purpose.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch package_updates

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bbb52cd and 592133e.

📒 Files selected for processing (1)
  • requirements.txt (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: build
  • GitHub Check: test (ubuntu-latest, 3.12)
  • GitHub Check: test (windows-latest, 3.12)
  • GitHub Check: test (windows-latest, 3.12)
🔇 Additional comments (4)
requirements.txt (4)

1-308: ⚠️ Critical: Snapshot extension implementation changes are missing from this review.

The PR description states that snapshot extensions were modified to fix breaking changes introduced by syrupy 5.0.0. However, the snapshot extension files (e.g., pyopenms_viz/testing/* modules) mentioned in the AI summary are not provided for review. Line 269 pins syrupy to 5.0.0, which has breaking changes, but I cannot verify whether the snapshot extension code properly accommodates these changes without seeing those implementation files.

Please ensure the snapshot extension implementation files are included in this review or provide evidence that they have been separately tested and verified for syrupy 5.0.0 compatibility. The breaking changes must be verified in context, not just in the dependency version update.


222-222: Verify justification for new heavyweight dependencies.

Several significant new packages have been added, particularly rdkit (computational chemistry library), cairosvg/cairocffi (SVG rendering), and narwhals (dataframe library). While these seem aligned with a visualization package, their justification is not documented in the PR description.

Please clarify why these new dependencies were added (Lines 29-31, 45, 123, 222). Are they new direct dependencies for enhanced visualization/data support, or transitive dependencies pulled in by updated packages? Documentation of the rationale would help validate the dependency expansion.

Also applies to: 31-31, 29-29, 45-45, 123-123


140-140: Verify comprehensive testing post-update.

This requirements file contains substantial version updates across core dependencies (numpy 2.2.5, pandas 2.3.3, sphinx 9.0.4, syrupy 5.0.0, etc.). While the file is autogenerated by pip-compile (which ensures dependency resolution), the actual functional compatibility must be verified through testing.

Please confirm that:

  1. The full test suite has been executed with these updated versions
  2. All snapshot tests pass (especially critical given syrupy 5.0.0 migration)
  3. Visual/rendering tests work correctly with matplotlib 3.10.8 and new SVG libraries (cairosvg, cairocffi)
  4. No deprecation warnings or compatibility issues were encountered during testing

Also applies to: 157-157, 244-244, 269-269


269-269: Confirm syrupy 5.0.0 snapshot extension API changes are complete.

Line 269 pins syrupy to version 5.0.0, which contains breaking changes (per PR description). The snapshot extension code modifications are essential to accommodate these changes, but those files are not provided in this review.

Ensure all usages of syrupy's SnapshotExtension API in the codebase have been updated. Key verification: search for any remaining references to private snapshot extension attributes/methods (e.g., those prefixed with _) that should now be public, or vice versa.


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.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 0

🧹 Nitpick comments (2)
pyopenms_viz/testing/NumpySnapshotExtension.py (1)

35-36: Consider using more specific exception handling.

The bare except clause catches all exceptions, including system-exiting exceptions like KeyboardInterrupt and SystemExit. Consider catching specific exceptions (e.g., AssertionError, ValueError, TypeError) for better debugging.

-        except:
+        except (AssertionError, ValueError, TypeError):
             return False
pyopenms_viz/testing/PandasSnapshotExtension.py (1)

31-32: Consider using more specific exception handling.

The bare except clause catches all exceptions. For better error diagnosis, consider catching specific exception types.

-        except:
+        except (AssertionError, ValueError, TypeError):
             return False
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eeedef0 and 687615d.

📒 Files selected for processing (6)
  • pyopenms_viz/testing/BokehSnapshotExtension.py (3 hunks)
  • pyopenms_viz/testing/MatplotlibSnapshotExtension.py (3 hunks)
  • pyopenms_viz/testing/NumpySnapshotExtension.py (3 hunks)
  • pyopenms_viz/testing/PandasSnapshotExtension.py (2 hunks)
  • pyopenms_viz/testing/PlotlySnapshotExtension.py (4 hunks)
  • requirements.txt (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
pyopenms_viz/testing/PlotlySnapshotExtension.py (4)
pyopenms_viz/testing/BokehSnapshotExtension.py (3)
  • compare_json (83-137)
  • read_snapshot_data_from_location (139-148)
  • write_snapshot_collection (151-161)
pyopenms_viz/testing/MatplotlibSnapshotExtension.py (2)
  • read_snapshot_data_from_location (31-41)
  • write_snapshot_collection (44-54)
pyopenms_viz/testing/NumpySnapshotExtension.py (2)
  • read_snapshot_data_from_location (38-45)
  • write_snapshot_collection (48-57)
pyopenms_viz/testing/PandasSnapshotExtension.py (2)
  • read_snapshot_data_from_location (34-41)
  • write_snapshot_collection (44-52)
pyopenms_viz/testing/MatplotlibSnapshotExtension.py (4)
pyopenms_viz/testing/NumpySnapshotExtension.py (2)
  • read_snapshot_data_from_location (38-45)
  • write_snapshot_collection (48-57)
pyopenms_viz/testing/BokehSnapshotExtension.py (2)
  • read_snapshot_data_from_location (139-148)
  • write_snapshot_collection (151-161)
pyopenms_viz/testing/PandasSnapshotExtension.py (2)
  • read_snapshot_data_from_location (34-41)
  • write_snapshot_collection (44-52)
pyopenms_viz/testing/PlotlySnapshotExtension.py (2)
  • read_snapshot_data_from_location (62-71)
  • write_snapshot_collection (74-84)
pyopenms_viz/testing/NumpySnapshotExtension.py (4)
pyopenms_viz/testing/MatplotlibSnapshotExtension.py (3)
  • matches (19-29)
  • read_snapshot_data_from_location (31-41)
  • write_snapshot_collection (44-54)
pyopenms_viz/testing/BokehSnapshotExtension.py (3)
  • matches (46-66)
  • read_snapshot_data_from_location (139-148)
  • write_snapshot_collection (151-161)
pyopenms_viz/testing/PandasSnapshotExtension.py (4)
  • matches (21-32)
  • read_snapshot_data_from_location (34-41)
  • write_snapshot_collection (44-52)
  • diff_lines (57-68)
pyopenms_viz/testing/PlotlySnapshotExtension.py (3)
  • matches (17-20)
  • read_snapshot_data_from_location (62-71)
  • write_snapshot_collection (74-84)
🪛 Ruff (0.14.8)
pyopenms_viz/testing/PlotlySnapshotExtension.py

63-63: Unused method argument: snapshot_name

(ARG002)


63-63: Unused method argument: session_id

(ARG002)

pyopenms_viz/testing/PandasSnapshotExtension.py

31-31: Do not use bare except

(E722)


54-54: Unused method argument: kwargs

(ARG002)


62-67: Consider iterable unpacking instead of concatenation

Replace with iterable unpacking

(RUF005)

pyopenms_viz/testing/NumpySnapshotExtension.py

35-35: Do not use bare except

(E722)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: build
🔇 Additional comments (7)
pyopenms_viz/testing/MatplotlibSnapshotExtension.py (1)

17-17: LGTM! Consistent API migration.

The changes correctly expose previously private methods as public APIs, matching the pattern across all snapshot extensions in this PR.

Also applies to: 31-41, 44-54

pyopenms_viz/testing/BokehSnapshotExtension.py (1)

44-44: LGTM! Consistent API migration.

The API visibility changes align with the syrupy 5.0.0 migration pattern applied uniformly across all snapshot extensions.

Also applies to: 139-148, 151-161

pyopenms_viz/testing/PlotlySnapshotExtension.py (1)

15-15: LGTM! Consistent API migration.

The public API exposure aligns with the syrupy 5.0.0 migration. The unused method arguments (snapshot_name, session_id) flagged by static analysis are required by the base class interface and should not be removed.

Also applies to: 62-71, 74-84

pyopenms_viz/testing/PandasSnapshotExtension.py (1)

19-19: LGTM! Consistent API migration.

The changes correctly expose the required public APIs for syrupy 5.0.0 compatibility, following the same pattern as the other snapshot extensions.

Also applies to: 34-41, 44-52

requirements.txt (2)

269-270: Syrupy 5.0.0 update drives the API changes.

The upgrade to syrupy 5.0.0 is the primary driver for making the snapshot extension methods public (removing underscore prefixes). The code changes in the snapshot extensions correctly address this breaking change.


157-157: No action required—the codebase is already compatible with Pandas 2.3.3. The code uses modern Pandas patterns (pd.concat instead of append, standard indexing with .loc/.iloc) and avoids deprecated APIs that were removed in Pandas 2.0+. Dtype handling via pandas.core.dtypes modules, StringDtype, and astype() are all compatible with Pandas 2.x.

pyopenms_viz/testing/NumpySnapshotExtension.py (1)

19-19: Correct! API changes align with syrupy 5.0.0 breaking changes.

The migration from underscore-prefixed to public methods (_file_extensionfile_extension, _read_snapshot_data_from_locationread_snapshot_data_from_location, and _write_snapshot_collectionwrite_snapshot_collection) is required by syrupy 5.0.0 for custom snapshot extensions. The implementation logic remains unchanged.

@github-actions

Copy link
Copy Markdown
Contributor

📖 Documentation Preview

The documentation for this PR has been built and is available at:
🔗 View Preview

This preview will be updated automatically when you push new commits to this PR.


Preview built from commit: 29333af

github-actions Bot added a commit that referenced this pull request Dec 11, 2025
version 2.3.0 of numpy breaks the snapshots
@jcharkow

Copy link
Copy Markdown
Collaborator Author

CI tests pass. Will fix documentation failure in other PR

@jcharkow
jcharkow merged commit 1a595d7 into main Dec 11, 2025
10 of 14 checks passed
@jcharkow
jcharkow deleted the package_updates branch December 11, 2025 15:28
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