Skip to content

Remove Python 3.8 Support#1611

Merged
TimPansino merged 7 commits intodevelop-v12.0.0from
remove-python38
Jan 22, 2026
Merged

Remove Python 3.8 Support#1611
TimPansino merged 7 commits intodevelop-v12.0.0from
remove-python38

Conversation

@TimPansino
Copy link
Contributor

@TimPansino TimPansino commented Dec 16, 2025

Overview

  • Drop support for Python 3.8.
  • Remove all code paths for Python 3.8 and below.
  • Run linters/formatters to upgrade syntax where appropriate.

@TimPansino TimPansino requested a review from a team as a code owner December 16, 2025 17:46
@TimPansino TimPansino changed the base branch from main to develop-v12.0.0 December 16, 2025 17:46
@github-actions
Copy link

github-actions bot commented Dec 16, 2025

MegaLinter analysis: Success

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 7 0 0 0.9s
✅ MARKDOWN markdownlint 7 0 0 0 1.41s
✅ PYTHON ruff 960 0 0 0 1.14s
✅ PYTHON ruff-format 960 0 0 0 0.33s
✅ YAML prettier 15 0 0 0 1.52s
✅ YAML v8r 15 0 0 5.84s
✅ YAML yamllint 15 0 0 0.71s

See detailed reports in MegaLinter artifacts

MegaLinter is graciously provided by OX Security

@mergify mergify bot added the tests-failing Tests failing in CI. label Dec 16, 2025
@codecov-commenter
Copy link

codecov-commenter commented Dec 16, 2025

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (develop-v12.0.0@1be4da1). Learn more about missing BASE report.

Files with missing lines Patch % Lines
newrelic/common/package_version_utils.py 91.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                Coverage Diff                 @@
##             develop-v12.0.0    #1611   +/-   ##
==================================================
  Coverage                   ?   81.73%           
==================================================
  Files                      ?      209           
  Lines                      ?    24354           
  Branches                   ?     3862           
==================================================
  Hits                       ?    19905           
  Misses                     ?     3138           
  Partials                   ?     1311           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mergify mergify bot removed the tests-failing Tests failing in CI. label Dec 16, 2025
@mergify mergify bot added tests-failing Tests failing in CI. and removed tests-failing Tests failing in CI. labels Dec 17, 2025
@umaannamalai
Copy link
Contributor

I was double checking the repo for references to Python 3.8 and noticed this function in newrelic/core/environment.py which could be updated to cover multiple version removals we've already done as well as 3.8:

def _get_stdlib_builtin_module_names():
    builtins = set(sys.builtin_module_names)
    # Since sys.stdlib_module_names is not available in versions of python below 3.10,
    # use isort's hardcoded stdlibs instead.
    python_version = sys.version_info[0:2]
    if python_version < (3,):
        stdlibs = isort_stdlibs.py27.stdlib
    elif (3, 7) <= python_version < (3, 8):
        stdlibs = isort_stdlibs.py37.stdlib
    elif python_version < (3, 9):
        stdlibs = isort_stdlibs.py38.stdlib
    elif python_version < (3, 10):
        stdlibs = isort_stdlibs.py39.stdlib
    elif python_version >= (3, 10):
        stdlibs = sys.stdlib_module_names
    else:
        _logger.warning("Unsupported Python version. Unable to determine stdlibs.")
        return builtins
    return builtins | stdlibs

We could also update this comment in pyproject.toml:

"UP006", # non-pep585-annotation (not compatible with Python 3.8)

@mergify mergify bot added the tests-failing Tests failing in CI. label Jan 21, 2026
@mergify mergify bot added the merge-conflicts Merge conflicts detected. label Jan 22, 2026
@TimPansino TimPansino merged commit 7b65caf into develop-v12.0.0 Jan 22, 2026
52 of 55 checks passed
@TimPansino TimPansino deleted the remove-python38 branch January 22, 2026 19:31
@mergify mergify bot removed merge-conflicts Merge conflicts detected. tests-failing Tests failing in CI. labels Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants