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

Confirm support for Python 3.13 and drop 3.8 #250

Merged
merged 12 commits into from
Nov 21, 2024
Merged

Confirm support for Python 3.13 and drop 3.8 #250

merged 12 commits into from
Nov 21, 2024

Conversation

khaeru
Copy link
Member

@khaeru khaeru commented Nov 20, 2024

  • Check/confirm that message-ix-models is compatible with the new version. This includes:
  • Drop support for Python 3.8, which reached end-of-life (no more updates, even security updates) "approximately [during, before, or after] October 2024" per PEP 569.
    • Remove any code marked as for Python 3.8 compatibility only. Depending on these changes, part or all of the functionality may remain usable with Python 3.8 if users have extreme need.
    • Make any general clean-ups or improvements possible with features available from Python 3.9.
      • Type hint using generics, e.g. list[str] instead of from typing import List/List[str].
      • Use from collections.abc import Sequence et al instead of deprecated from typing import Sequence.

How to review

  • Read the diff and note that the CI checks all pass.

PR checklist

  • Continuous integration checks all ✅
  • Add or expand tests; coverage checks both ✅
  • Add, expand, or update documentation. N/A
  • Update doc/whatsnew.

@khaeru khaeru self-assigned this Nov 20, 2024
@khaeru khaeru added enh New features or functionality ci Continuous integration & testing labels Nov 20, 2024
- Add explicit test of released versions ixmp/message-ix 3.9.0.
@khaeru khaeru force-pushed the enh/py3.13 branch 2 times, most recently from d33527d to 593cbe2 Compare November 20, 2024 14:43
@khaeru khaeru force-pushed the enh/py3.13 branch 5 times, most recently from abfcb42 to df4bad7 Compare November 20, 2024 15:53
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

Attention: Patch coverage is 97.24138% with 4 lines in your changes missing coverage. Please review.

Project coverage is 75.6%. Comparing base (012b501) to head (0c40618).
Report is 13 commits behind head on main.

Files with missing lines Patch % Lines
...ge_ix_models/util/compat/message_data/utilities.py 0.0% 2 Missing ⚠️
message_ix_models/project/navigate/__init__.py 85.7% 1 Missing ⚠️
message_ix_models/util/click.py 75.0% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main    #250     +/-   ##
=======================================
- Coverage   76.5%   75.6%   -1.0%     
=======================================
  Files        203     203             
  Lines      15578   15600     +22     
=======================================
- Hits       11927   11801    -126     
- Misses      3651    3799    +148     
Files with missing lines Coverage Δ
message_ix_models/model/build.py 100.0% <100.0%> (ø)
message_ix_models/model/disutility.py 100.0% <100.0%> (ø)
message_ix_models/model/emissions.py 98.0% <100.0%> (ø)
message_ix_models/model/macro.py 100.0% <100.0%> (ø)
message_ix_models/model/material/build.py 67.8% <100.0%> (+0.2%) ⬆️
message_ix_models/model/material/data_aluminum.py 90.5% <100.0%> (ø)
message_ix_models/model/material/data_methanol.py 92.0% <100.0%> (ø)
message_ix_models/model/material/data_petro.py 78.7% <100.0%> (-0.2%) ⬇️
message_ix_models/model/material/data_steel.py 87.0% <100.0%> (ø)
message_ix_models/model/material/data_util.py 33.3% <100.0%> (+0.1%) ⬆️
... and 43 more

... and 4 files with indirect coverage changes

---- 🚨 Try these New Features:

khaeru added a commit that referenced this pull request Nov 20, 2024
@khaeru khaeru requested a review from glatterf42 November 20, 2024 17:16
Copy link
Member

@glatterf42 glatterf42 left a comment

Choose a reason for hiding this comment

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

Thanks, this is looking great :)
I hope it also explains all CI failures today, as in: GAMS was bumped here, requiring a different license, but the nightly tests and test-snapshot still wanted to use the older version requiring the older license, and failed. In that case, I'd just ask to please also adapt the snapshot-workflow file to use the newer GAMS version :)

@khaeru
Copy link
Member Author

khaeru commented Nov 21, 2024

adapt the snapshot-workflow file to use the newer GAMS version

Ah good catch—will do.

This is the earliest version that has builds for macOS arm64.
- Use standard collections, e.g. list[str] instead of typing.List[str].
- Import certain types from collections.abc, instead of deprecated aliases in
  typing.
- Omit .model.transport, handled in #225.
Available from Python 3.9 onwards.
- mypy 1.11.0 → 1.13.0
- ruff 0.5.5 → 0.7.4
  - "ruff format" one file.
  - Exclude two .ipynb files from "ruff check".
Use a maintained and updated version.
Only skip install on macos-13; allow on macos-latest.
@khaeru khaeru merged commit 8c4f995 into main Nov 21, 2024
30 checks passed
@khaeru khaeru deleted the enh/py3.13 branch November 21, 2024 10:32
khaeru added a commit that referenced this pull request Dec 2, 2024
Same work-around for pyam-iamc packaging issue as in
.github/workflows/pytest.yaml; see #250.
khaeru added a commit that referenced this pull request Dec 3, 2024
Same work-around for pyam-iamc packaging issue as in
.github/workflows/pytest.yaml; see #250.
khaeru added a commit that referenced this pull request Dec 3, 2024
Same work-around for pyam-iamc packaging issue as in
.github/workflows/pytest.yaml; see #250.
khaeru added a commit that referenced this pull request Dec 3, 2024
Same work-around for pyam-iamc packaging issue as in
.github/workflows/pytest.yaml; see #250.
khaeru added a commit that referenced this pull request Dec 3, 2024
Same work-around for pyam-iamc packaging issue as in
.github/workflows/pytest.yaml; see #250.
khaeru added a commit that referenced this pull request Dec 3, 2024
Same work-around for pyam-iamc packaging issue as in
.github/workflows/pytest.yaml; see #250.
khaeru added a commit that referenced this pull request Dec 3, 2024
Same work-around for pyam-iamc packaging issue as in
.github/workflows/pytest.yaml; see #250.
khaeru added a commit that referenced this pull request Dec 3, 2024
Same work-around for pyam-iamc packaging issue as in
.github/workflows/pytest.yaml; see #250.
khaeru added a commit that referenced this pull request Dec 3, 2024
Same work-around for pyam-iamc packaging issue as in
.github/workflows/pytest.yaml; see #250.
GamzeUnlu95 pushed a commit that referenced this pull request Dec 4, 2024
Same work-around for pyam-iamc packaging issue as in
.github/workflows/pytest.yaml; see #250.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Continuous integration & testing enh New features or functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants