cloudpipe / cloudpickle

Extended pickling support for Python objects
Other
1.64k stars 167 forks source link

Fix compatibility with Python 3.11 #467

Closed frenzymadness closed 2 years ago

frenzymadness commented 2 years ago

Code objects have some new attributes. Those are related to the enhanced exceptions with code highlighting.

I honestly don't know why the evaluation of type annotations is no longer postponed but the tests are passing now with Python 3.11a5 and alpha 6.

Fixes: #466

codecov[bot] commented 2 years ago

Codecov Report

Merging #467 (47f0775) into master (9a0013e) will increase coverage by 0.02%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #467      +/-   ##
==========================================
+ Coverage   92.56%   92.58%   +0.02%     
==========================================
  Files           4        4              
  Lines         713      715       +2     
  Branches      156      159       +3     
==========================================
+ Hits          660      662       +2     
  Misses         32       32              
  Partials       21       21              
Impacted Files Coverage Δ
cloudpickle/cloudpickle_fast.py 96.93% <100.00%> (+0.01%) :arrow_up:

Continue to review full report at Codecov.

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

ogrisel commented 2 years ago

Thanks so much for the PR @frenzymadness!

Could you please try to update https://github.com/cloudpipe/cloudpickle/blob/master/.github/workflows/testing.yml#L32 to enable your new tox entry with python_version = "3.11-dev" in the GitHub actions config?

Please also document this fix in the changelog targeting the next version of cloudpickle.

frenzymadness commented 2 years ago

Done. I've also removed the python-nightly job as it's now part of the main testing matrix.

ogrisel commented 2 years ago

Done. I've also removed the python-nightly job as it's now part of the main testing matrix.

This is not exactly the same as github actions' "-dev" configs use alpha/beta releases and the ppa:deadsnakes/nightly config is updated on a nightly basis.

But since there is one alpha release every month on average I think it's frequent enough.

ogrisel commented 2 years ago

Thank you very much for the contrib!