XanaduAI / MrMustard

A differentiable bridge between phase space and Fock space
https://mrmustard.readthedocs.io/
Apache License 2.0
78 stars 27 forks source link

Bump `rich` dependency to version 13 #512

Closed aplund closed 3 weeks ago

aplund commented 1 month ago

Context: Old dependencies can hold back things which depend on the MrMustard, which can be very deep in the dependency tree. The rich package had a very old major version dependency (10..) and this could interact with other seemingly random packages when depending on MrMustard.

Description of the Change: Bump the major version of rich to 13. The only place I can see to test this version change is in the ProgressBar class, and this seemed to work fine for me on testing using the example code in the docs for using the optimizer.

Benefits: Other packages that depend on MrMustard won't get into a tricky dependency situation with a very old package.

Possible Drawbacks: Possible subtle bugs as this dependency doesn't appear to have unit tests.

codiumai-pr-agent-pro[bot] commented 1 month ago

PR Reviewer Guide πŸ”

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 πŸ”΅βšͺβšͺβšͺβšͺ
πŸ… Score: 95
πŸ§ͺ No relevant tests
πŸ”’ No security concerns identified
⚑ Recommended focus areas for review

Dependency Update
Verify that the update to Rich v13 doesn't introduce any breaking changes or compatibility issues with the rest of the project, especially in the ProgressBar class mentioned in the PR description.
codiumai-pr-agent-pro[bot] commented 1 month ago

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Score
Best practice
Specify an upper bound for dependency versions to enhance long-term stability ___ **Consider specifying an upper bound for the rich dependency to prevent potential
compatibility issues with future major versions.** [pyproject.toml [34]](https://github.com/XanaduAI/MrMustard/pull/512/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711R34-R34) ```diff -rich = "^13.9.0" +rich = "^13.9.0,<14.0.0" ``` - [ ] **Apply this suggestion**
Suggestion importance[1-10]: 7 Why:
7

πŸ’‘ Need additional feedback ? start a PR chat

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 89.28%. Comparing base (242c806) to head (905faa4). Report is 1 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #512 +/- ## =========================================== - Coverage 89.85% 89.28% -0.57% =========================================== Files 104 86 -18 Lines 7698 5956 -1742 =========================================== - Hits 6917 5318 -1599 + Misses 781 638 -143 ``` [see 96 files with indirect coverage changes](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/512/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI) ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/512?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI) > `Ξ” = absolute (impact)`, `ΓΈ = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/512?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). Last update [242c806...905faa4](https://app.codecov.io/gh/XanaduAI/MrMustard/pull/512?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XanaduAI).
aplund commented 3 weeks ago

The issue with the code coverage checks seems to be changes in how docstrings and decorators are handled between versions of the "coverage" package. This changes the lock file and moves from coverage version 7.4.4 to 7.6.3. In the earlier version, docstrings and decorator executions are included, and the later version they are not. So there's a heap of stuff that appears to be less coverage, but these things aren't actual code in the codebase.

(I can't merge this without all the checks being successful, including the code coverage ones.)

timmysilv commented 3 weeks ago

i can't even find where/if this is configured. maybe there's a default value somewhere saying the max coverage delta must be <=0.15% or something like that?

apchytr commented 3 weeks ago

@timmysilv I think it was using code coverage's default values. I've added a .yml file that we can configure to (hopefully) fix this.