chore: drop Python 3.8 and 3.9 support#1091
Open
nightcityblade wants to merge 2 commits intomlco2:masterfrom
Open
chore: drop Python 3.8 and 3.9 support#1091nightcityblade wants to merge 2 commits intomlco2:masterfrom
nightcityblade wants to merge 2 commits intomlco2:masterfrom
Conversation
SaboniAmine
approved these changes
Feb 27, 2026
Member
SaboniAmine
left a comment
There was a problem hiding this comment.
Thanks for your contribution!
The CONTRIBUTING.md might also need some update on python version.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1091 +/- ##
==========================================
+ Coverage 78.19% 78.22% +0.03%
==========================================
Files 38 38
Lines 3637 3633 -4
==========================================
- Hits 2844 2842 -2
+ Misses 793 791 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Remove support for Python 3.8 and 3.9, both of which have reached end-of-life.
Changes:
requires-pythonfrom>=3.8to>=3.10inpyproject.tomlpyproject.tomlcodecarbon/input.pyto use stdlibimportlib.resourcesdirectly (available since Python 3.9) instead of conditionally falling back to theimportlib_resourcesbackportimport sysfrominput.pyRelated Issue
Fixes #1082
Motivation and Context
Python 3.8 reached EOL on 2024-10-07 and Python 3.9 reached EOL on 2025-10-05. Dropping support simplifies the codebase and allows using modern Python features.
How Has This Been Tested?
Verified that
importlib.resources.filesandimportlib.resources.as_fileare available in Python 3.10+ (they were added in Python 3.9).Types of changes
Checklist: