Skip to content

Conversation

@Kyle-Neale
Copy link
Contributor

@Kyle-Neale Kyle-Neale commented Oct 18, 2025

What does this PR do?

Adds ddev meta scripts update-python-version command to automatically detect and apply Python version updates across the repository.

Automate the process of updating Python versions by:

  • Detecting new Python releases from python.org
  • Fetching official SHA256 hashes from SBOM files
  • Updating all relevant files automically

Affected files:

  • Updates ddev/src/ddev/repo/constants.py (PYTHON_VERSION_FULL)
  • Updates .builders/images/*/Dockerfile (Linux & Windows)
  • Updates .github/workflows/resolve-build-deps.yaml (macOS)

Motivation

https://datadoghq.atlassian.net/browse/AI-5659

@Kyle-Neale Kyle-Neale changed the title New upgrade python to ddev and rename meta script Add update-python-version command to automate Python version updates Oct 18, 2025
@codecov
Copy link

codecov bot commented Oct 18, 2025

Codecov Report

❌ Patch coverage is 67.61905% with 136 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.05%. Comparing base (d440e65) to head (9bc7e22).
⚠️ Report is 26 commits behind head on master.

Additional details and impacted files
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@datadog-official
Copy link
Contributor

datadog-official bot commented Oct 18, 2025

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 9bc7e22 | Docs | Was this helpful? Give us feedback!

@Kyle-Neale Kyle-Neale force-pushed the kyle.neale/ddev-upgrade-python branch from 82e7659 to 147ab25 Compare October 18, 2025 03:13
@Kyle-Neale Kyle-Neale force-pushed the kyle.neale/ddev-upgrade-python branch from eb3c82c to b3ec69a Compare October 18, 2025 04:21
@Kyle-Neale Kyle-Neale force-pushed the kyle.neale/ddev-upgrade-python branch from a2aaba1 to af01d4f Compare October 18, 2025 15:18
@@ -0,0 +1,53 @@
# (C) Datadog, Inc. 2023-present
Copy link
Contributor Author

@Kyle-Neale Kyle-Neale Oct 18, 2025

Choose a reason for hiding this comment

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

This is just a renamed file - formerly test_upgrade_python.py.

@@ -0,0 +1,232 @@
# (C) Datadog, Inc. 2023-present
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just a renamed file - formerly upgrade_python.py.

Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason for not combining the 2 functions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I opted to make them different scripts since they target different things. The old upgrade python is just to update our hatch and pyproject config once a year or so (whenever we update the minor version). update-python-version will happen more frequently but I'm open to ideas 👍

@Kyle-Neale Kyle-Neale marked this pull request as ready for review October 18, 2025 16:07
@Kyle-Neale Kyle-Neale requested a review from a team as a code owner October 18, 2025 16:07
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@github-actions
Copy link

github-actions bot commented Oct 18, 2025

⚠️ Recommendation: Add qa/skip-qa label

This PR does not modify any files shipped with the agent.

To help streamline the release process, please consider adding the qa/skip-qa label if these changes do not require QA testing.

@Kyle-Neale Kyle-Neale force-pushed the kyle.neale/ddev-upgrade-python branch from 09bd111 to 58bc862 Compare October 18, 2025 16:35
@iliakur iliakur self-assigned this Oct 20, 2025
)


@click.command('upgrade-python-version', short_help='Upgrade the Python version used in the repository.')
Copy link
Contributor

Choose a reason for hiding this comment

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

In the future what would happen if we need to upgrade to 3.14 for example? Seems like this is only intended to do patches?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep this is only intended to do patches. It wouldn't be hard to enhance this feature to also allow minor version bumps but those tend to require more effort to incorporate into our CI so. We also wouldn't want the script to upgrade to a new minor version ahead of the Agent's embedded python version

from ddev.repo.constants import PYTHON_VERSION as old_version

tracker = app.create_validation_tracker('Python upgrades')
tracker = app.create_validation_tracker('Python version upgrades')
Copy link
Contributor

Choose a reason for hiding this comment

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

what does tracker do? Is it just logging lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Mostly, validation result tracker just collects and displays validation results. https://github.com/DataDog/integrations-core/blob/master/ddev/src/ddev/validation/tracker.py

Comment on lines 289 to 290
if target_line == new_line:
return
Copy link
Contributor

@steveny91 steveny91 Oct 21, 2025

Choose a reason for hiding this comment

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

What is this for? If the MacOS version is already at latest? If so can you add a log message? Or a comment if it's not meant to be an error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct, this is a check in case the version is already at latest. More so, for anyone who's updating these manually.

@steveny91
Copy link
Contributor

Pretty well written! Left some nits and clarifying questions. But a few things:

  • Renaming the file to an existing file made the diffing hard
  • "Updating all relevant files automically" can you list the files in the PR? It makes it easier to know what is normal versus not in the future when this is deployed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants