Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating dependencies to support python 3.11 #351

Merged
merged 6 commits into from
Feb 23, 2024
Merged

Conversation

SamFerracin
Copy link
Contributor

Context:
Updates dependencies so that MrMustard runs with python 3.11, and makes minimal changes to make all tests pass (check SisterPam)

@SamFerracin SamFerracin added the no changelog Pull request does not require a CHANGELOG entry label Feb 22, 2024
tests/test_lab/test_states.py Show resolved Hide resolved
Copy link

codecov bot commented Feb 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (bea2138) 85.13% compared to head (99a34cd) 85.21%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #351      +/-   ##
===========================================
+ Coverage    85.13%   85.21%   +0.07%     
===========================================
  Files           67       67              
  Lines         5113     5113              
===========================================
+ Hits          4353     4357       +4     
+ Misses         760      756       -4     

see 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bea2138...99a34cd. Read the comment docs.

Copy link
Contributor

@sduquemesa sduquemesa left a comment

Choose a reason for hiding this comment

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

Looks good to me! I'm leaving a comment that does not prevent this from being merged.

The comment — the reason this PR won't fail for python 3.9 is because you're using from __future__ import annotation whenever the operator | is used to annotate the types. This operator for type annotations is actually supported in python3.10. From the documentation

The future statement is intended to ease migration to future versions of Python that introduce incompatible changes to the language. It allows use of the new features on a per-module basis before the release in which the feature becomes standard.

This is the reason why MrMustard in python3.9 is able to run with features of python3.10. Also, the documentation for future statements says (see PEP 236)

Note that there is no need to involve the future_statement machinery in new features unless they can break existing code; fully backward- compatible additions can– and should –be introduced without a corresponding future_statement.

Given that MrMustard is already supported in python3.10-3.11 and considering that the purpose of the statement from __future__ import annotation is to ease migration to newer python versions and that it could introduce breaking changes in the future as new features are added to python, something to think about is the possibility of removing support for python3.9 —and hence removing the need for futures— if and only if no other dependent libraries use python3.9 (not the case for MrKite).

@SamFerracin SamFerracin merged commit d084819 into develop Feb 23, 2024
9 checks passed
@SamFerracin SamFerracin deleted the update-deps branch February 23, 2024 18:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no changelog Pull request does not require a CHANGELOG entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants