nucleic / enaml

Declarative User Interfaces for Python
http://enaml.readthedocs.io/en/latest/
Other
1.53k stars 130 forks source link

Add python 3.11 support #514

Closed frmdstryr closed 1 year ago

frmdstryr commented 1 year ago

This updates the code generator/compiler to work with Python 3.11, it builds on the pegen branch because the main branch just fails due to invalid col offsets in the ast.

On a positive note I get about a 10-15% speedup with this on enaml-web :).

codecov-commenter commented 1 year ago

Codecov Report

Merging #514 (57d3515) into main (052cd81) will increase coverage by 0.19%. The diff coverage is 95.92%.

:exclamation: Current head 57d3515 differs from pull request most recent head 7564bb3. Consider uploading reports for the commit 7564bb3 to get more accurate results

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #514 +/- ## ========================================== + Coverage 73.22% 73.41% +0.19% ========================================== Files 296 296 Lines 25837 26001 +164 Branches 3650 4401 +751 ========================================== + Hits 18918 19088 +170 + Misses 5834 5826 -8 - Partials 1085 1087 +2 ```
MatthieuDartiailh commented 1 year ago

Could you rebase this on main now that #474 is in ? (Cherry picking your changes might be easier) Also I apologize for the last two commits, I forgot to switch branch.

MatthieuDartiailh commented 1 year ago

So I have an implementation for try_squash_raise. I just need to audit the usages to ensure we never have a try/except inside the try_squash_raise.

I will look at the kwarg default next.

MatthieuDartiailh commented 1 year ago

Thanks for rebasing. I will push my solution for try_squah_raise later today. The issue with function default lies in CPython itself. PyEval_EvalCodeEx started using _PyFunction_FromConstructor in 3.11 but this function does not pass the defaults found in the frame constructor... I will open an issue on CPython repo.

MatthieuDartiailh commented 1 year ago

CPython issue reported at https://github.com/python/cpython/issues/101072

MatthieuDartiailh commented 1 year ago

Still blocked on the CPython issue, the PR I made is pending review.

MatthieuDartiailh commented 1 year ago

The cpython issue has been closed and the fix will be in 3.11.2 ! I will try to have everything ready by then.

MatthieuDartiailh commented 1 year ago

3.11.2 is available on GHA (I misremembered the release date), let's see if it works !

frmdstryr commented 1 year ago

Looks like it still is using 3.11.1

MatthieuDartiailh commented 1 year ago

Yes and I find it extremely annoying ! We will have to wait a tiny bit longer it seems.

MatthieuDartiailh commented 1 year ago

Thanks for your work @frmdstryr

frmdstryr commented 1 year ago

Thank you!