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

Update Python 3.8 Detection Logic to Use Detected Version #11241

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

kbukum1
Copy link
Contributor

@kbukum1 kbukum1 commented Jan 6, 2025

What are you trying to accomplish?

This PR updates the detection logic for Python 3.8 to ensure that detected_version is consistently used across the deprecation and unsupported checks.

This change addresses scenarios where raw_version is either nil or diverges from detected_version, improving the reliability of version checks and the accuracy of deprecation and unsupported notices for Python.

Why?

  • To align the detection and handling of Python versions with detected_version as the authoritative source.
  • To resolve inconsistencies and potential errors when raw_version is nil or different from detected_version.
  • To ensure a consistent and reliable experience for Dependabot users managing Python dependencies.

Anything you want to highlight for special attention from reviewers?

  • The unsupported? and related methods have been updated to prioritize detected_version, falling back to raw_version only when necessary.
  • Test cases have been added to validate scenarios such as:
    • Proper detection of Python 3.8 as deprecated or unsupported.
    • Handling cases where raw_version is nil or mismatched with detected_version.
    • Correct functioning of edge cases related to Python 3.8 detection and warnings.

How will you know you've accomplished your goal?

  • All tests in the suite, including those for Python version detection and handling, pass successfully.
  • Python 3.8 deprecation and unsupported checks work consistently, using detected_version in all scenarios.
  • Edge cases involving raw_version discrepancies or absence are correctly handled without errors or inconsistencies.

Checklist

  • I have run the complete test suite to ensure all tests and linters pass.
  • I have thoroughly tested the changes to confirm they work as intended, including additional tests for the new detection logic.
  • I have provided clear and descriptive commit messages for the changes.
  • I have included a detailed description of the issue addressed, the solution implemented, and the rationale for the changes.
  • I have ensured the code is well-documented, with clear explanations for any updated or added logic.

@kbukum1 kbukum1 marked this pull request as ready for review January 6, 2025 21:36
@kbukum1 kbukum1 requested a review from a team as a code owner January 6, 2025 21:36
version = output.strip.split.last # Extract the version number (e.g., "3.13.1")

version
end
Copy link
Contributor Author

@kbukum1 kbukum1 Jan 6, 2025

Choose a reason for hiding this comment

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

Review Tip: For metrics we want to use the python version from ecosystem that dependabot runs on instead of parsed version.

Language.new(
detected_version: python_raw_version,
raw_version: python_command_version
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Review Tip:

  • Detected Version: Parsed from manifest or lock files to identify the project's specified language version.
  • Raw Version: Retrieved via pyenv exec python --version to determine the runtime Python version.

This distinction ensures accurate deprecation checks and metrics collection.

@kbukum1 kbukum1 merged commit 6ad15e5 into main Jan 6, 2025
60 checks passed
@kbukum1 kbukum1 deleted the kamil/update_detected_version_check_for_python branch January 6, 2025 22:20
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.

2 participants