PSLmodels / OG-Core

An overlapping generations model framework for evaluating fiscal policies.
https://pslmodels.github.io/OG-Core/
Creative Commons Zero v1.0 Universal
68 stars 119 forks source link

Allow for compatibility with Python 3.12 #969

Closed jdebacker closed 3 months ago

jdebacker commented 3 months ago

This PR updates test files so that the unit tests pass on Python 3.12. As noted in Issue #889, the OG-Core has run on Python 3.12 for some time. The update here ensure that we can tests against 3.12 and therefore publish packages compatible with that version of Python.

cc @rickecon

jdebacker commented 3 months ago

Remaining work:

codecov-commenter commented 3 months ago

Codecov Report

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

Project coverage is 69.98%. Comparing base (8bbaa26) to head (118479e). Report is 14 commits behind head on master.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/969/graphs/tree.svg?width=650&height=150&src=pr&token=98mQCVhspd&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels)](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/969?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) ```diff @@ Coverage Diff @@ ## master #969 +/- ## ========================================== - Coverage 71.08% 69.98% -1.11% ========================================== Files 20 20 Lines 4977 4977 ========================================== - Hits 3538 3483 -55 - Misses 1439 1494 +55 ``` | [Flag](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/969/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/969/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | `69.98% <100.00%> (-1.11%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/969?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels) | Coverage Δ | | |---|---|---| | [ogcore/\_\_init\_\_.py](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/969?src=pr&el=tree&filepath=ogcore%2F__init__.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels#diff-b2djb3JlL19faW5pdF9fLnB5) | `100.00% <100.00%> (ø)` | | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/PSLmodels/OG-Core/pull/969/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PSLmodels)
rickecon commented 3 months ago

@jdebacker. The black formatting test is failing. And we should update the middle number (minor) of the version for this one (e.g., 0.12.0). And I think we should make the version requirement python>= 3.7.7, <3.13 in both environment.yml and setup.py. And finally, if we move to Python 3.12 as our latest supported version, I think we should change our GitHub Actions to run on Python 3.11 and 3.12, with the single runs running on 3.12.

rickecon commented 3 months ago

@jdebacker.

rickecon commented 3 months ago

@jdebacker. This looks great. Thanks for making this update. Merging now.