-
Notifications
You must be signed in to change notification settings - Fork 128
Move to python 3.11 #39283
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
Move to python 3.11 #39283
Conversation
Error in the log when launching the standalone on Windows:
|
Btw I noticed that the installers are labelled '6.11.*', does this branch need rebasing? |
Will be worth checking if this PR has any effect on #38412 |
namely: - change of some byte code names - addition of the CACHE instrucion https://docs.python.org/3/whatsnew/3.11.html#cpython-bytecode-changes
For some reason OSIRISDiffactionReductionTest was failing when running all of it's unit test. The first three would pass, then the rest fail (no matter which you commented out etc). Running them individually was fine. I still don't understand why this was happening, but it was caused by line 374 of OSIRISDiffactionReduction where some workspaces are summed. This calls the op_wrapper in _workspaceops which calls lhs_info() Through debugging I worked out that when the tests were failing, frame.f_lasti was pointing to PRECALL instead of CALL. So I've changed process_frame to change last_i to point at CALL when it is at PRECALL.
951ce65
to
2427ffd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linux and Windows standalone packages work well, I tried running some algorithms, running a script, using the iPython tab (getting workspace name from variable name). Also tried a few different types of plot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good and I think these changes are all that's needed for Python 3.12 too!
macOS standalone and Windows conda installs also both look good. |
### Description of work Upgrade mantid to Python 3.11. [See release notes](https://docs.python.org/3/whatsnew/3.11.html) Things that have been done - Update python version pinning - `PyFrameObject`'s attributes are private now, so in a few places I've switched to using the provided Get functions - Byte code changes which mean necessary updates to `funcinspect.py` :( - Introduction of `CACHE` instructions meant that our process to find the latest function-like call needed updating. - Changes to the names of opcodes - A strange bug with the new (in our code) `PRECALL` instruction where sometimes `frame.f_lasti` would be pointing to `PRECALL` instead of `CALL` (but only happened in one test), should be fixed now. - Remove the use of the `U` option when opening files (it's been the default for a while) - Fix a mock object which was mistakenly being constructed with `spec` set to another mock object (no longer allowed). - Set `PYDEVD_DISABLE_FILE_VALIDATION=1` to avoid ipython debugger warning on startup - Remove `lib2to3` usage to avoid deprecation warnings Fixes mantidproject#37780 ### To test: Packages for testing: https://builds.mantidproject.org/job/Core_Team_test_pipeline/249/artifact/ <!-- Ensure the base of this PR is correct (e.g. release-next or main) Finally, don't forget to add the appropriate labels, milestones, etc.! --> --- ### Reviewer Please comment on the points listed below ([full description](http://developer.mantidproject.org/ReviewingAPullRequest.html)). **Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review.** If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed. #### Code Review - Is the code of an acceptable quality? - Does the code conform to the [coding standards](http://developer.mantidproject.org/Standards/)? - Are the unit tests small and test the class in isolation? - If there is GUI work does it follow the [GUI standards](http://developer.mantidproject.org/Standards/GUIStandards.html)? - If there are changes in the release notes then do they describe the changes appropriately? - Do the release notes conform to the [release notes guide](https://developer.mantidproject.org/Standards/ReleaseNotesGuide.html)? #### Functional Tests - Do changes function as described? Add comments below that describe the tests performed? - Do the changes handle unexpected situations, e.g. bad input? - Has the relevant (user and developer) documentation been added/updated? Does everything look good? Mark the review as **Approve**. A member of `@mantidproject/gatekeepers` will take care of it. ### Gatekeeper If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.
This pulls a bunch of maintenance and dependency management into `ornl-next` * #38996 * #39182 * #39221 * #39207 * #39308 * #38990 * #39283 * #39304 * #39330 * #39235 * #39216 --------- Co-authored-by: MialLewis <95620982+MialLewis@users.noreply.github.com> Co-authored-by: thomashampson <thomas.hampson@stfc.ac.uk> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: James Clarke <139879523+jclarkeSTFC@users.noreply.github.com> Co-authored-by: Jonathan Haigh <35813666+jhaigh0@users.noreply.github.com> Co-authored-by: Ross Whitfield <whitfieldre@ornl.gov> Co-authored-by: James Clarke <james.clarke@stfc.ac.uk>
Description of work
Upgrade mantid to Python 3.11. See release notes
Things that have been done
PyFrameObject
's attributes are private now, so in a few places I've switched to using the provided Get functionsfuncinspect.py
:(CACHE
instructions meant that our process to find the latest function-like call needed updating.PRECALL
instruction where sometimesframe.f_lasti
would be pointing toPRECALL
instead ofCALL
(but only happened in one test), should be fixed now.U
option when opening files (it's been the default for a while)spec
set to another mock object (no longer allowed).PYDEVD_DISABLE_FILE_VALIDATION=1
to avoid ipython debugger warning on startuplib2to3
usage to avoid deprecation warningsFixes #37780
To test:
Packages for testing: https://builds.mantidproject.org/job/Core_Team_test_pipeline/249/artifact/
Reviewer
Please comment on the points listed below (full description).
Your comments will be used as part of the gatekeeper process, so please comment clearly on what you have checked during your review. If changes are made to the PR during the review process then your final comment will be the most important for gatekeepers. In this comment you should make it clear why any earlier review is still valid, or confirm that all requested changes have been addressed.
Code Review
Functional Tests
Does everything look good? Mark the review as Approve. A member of
@mantidproject/gatekeepers
will take care of it.Gatekeeper
If you need to request changes to a PR then please add a comment and set the review status to "Request changes". This will stop the PR from showing up in the list for other gatekeepers.