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

chore: deprecate python 3.8 #289

Merged
merged 11 commits into from
Nov 4, 2024
Merged

Conversation

angelofenoglio
Copy link
Contributor

@angelofenoglio angelofenoglio commented Oct 17, 2024

What?

  • Drop support for python 3.8 now that it has reached EOL.

Summary by CodeRabbit

  • New Features
    • Updated Python version support to include 3.9, 3.10, and 3.11 in various workflows and documentation.
  • Bug Fixes
    • Removed deprecated Python version 3.8 from build and testing configurations.
  • Documentation
    • Revised README to clarify installation and migration processes, emphasizing supported Python versions and updated setup instructions.
  • Chores
    • Adjusted configuration files to align with the new Python version requirements, including updates to pyproject.toml and workflow files.

@angelofenoglio angelofenoglio requested a review from a team October 17, 2024 16:25
@angelofenoglio angelofenoglio self-assigned this Oct 17, 2024
Copy link

coderabbitai bot commented Oct 17, 2024

Walkthrough

The changes in this pull request primarily involve updates to the Python version used across various GitHub Actions workflows and project files. The workflows for building and testing packages have been modified to utilize Python 3.9 instead of Python 3.8. Additionally, the integration tests have seen a refinement in the Python version strategy matrix and toolbox image tags. Documentation in the README has been updated to clarify installation and migration processes, while the pyproject.toml file has removed references to Python 3.8, focusing on supporting newer versions.

Changes

File Change Summary
.github/workflows/release-pypi-build-push-package.yml Updated python-version from '3.8' to '3.9' in job build_push.
.github/workflows/release-pypi-build-push-test-package.yml Updated python-version from '3.8' to '3.9' in job build_push.
.github/workflows/tests-integration.yaml Updated python-version array in job integration_tests_cli_refarch by removing '3.8.14' and updating toolbox image tags.
.github/workflows/tests-unit.yml Removed '3.8' from python-version array in job unit_tests and updated coverage reporting condition from '3.8' to '3.9'.
README.md Updated installation and migration documentation, clarified build.env format, emphasized supported Python versions, and modified development environment setup instructions.
pyproject.toml Removed Python 3.8 from classifiers and updated dependency specification to include only Python 3.9, 3.10, and 3.11.

Poem

🐰 In the garden of code, we hop with delight,
Python 3.9 now shines oh so bright!
With workflows refreshed and tests running true,
Our project blooms, all thanks to you!
So let’s cheer for the changes, both big and small,
Together we thrive, let’s code after all! 🌼


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 0d646c3 and 2676f61.

⛔ Files ignored due to path filters (1)
  • poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • pyproject.toml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • pyproject.toml

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (6)
.github/workflows/tests-unit.yml (3)

10-10: LGTM: Python version matrix updated correctly.

The removal of Python 3.8 from the test matrix aligns with the PR objective to deprecate support for this version. The updated matrix now includes all currently supported Python versions (3.9, 3.10, 3.11, and 3.12), which is excellent for ensuring compatibility across these versions.

Consider setting up a process to regularly review and update this matrix as new Python versions are released and older ones reach their end of life.


41-41: LGTM: Coverage reporting condition updated correctly.

The condition for reporting coverage to Coveralls has been appropriately updated to use Python 3.9, which is now the oldest supported version in the test matrix. This change is consistent with the removal of Python 3.8 support.

Consider updating the comment to be more specific:

if: matrix.python-version == '3.9'  # Run this for the oldest supported Python version only!

This clarifies the intent and makes it easier to maintain in the future if the oldest supported version changes again.


Line range hint 1-45: Consider adding caching to improve workflow efficiency.

While the current workflow is correct and functional, you could potentially improve its efficiency by implementing caching for Poetry dependencies. This would speed up subsequent runs of the workflow by reusing previously installed packages.

Here's an example of how you could implement caching:

- name: Cache Poetry dependencies
  uses: actions/cache@v2
  with:
    path: ~/.cache/pypoetry
    key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
    restore-keys: |
      ${{ runner.os }}-poetry-

- name: Install dependencies using Poetry
  run: |
    echo "[INFO] Installing dependencies..."
    export ENV POETRY_VIRTUALENVS_CREATE=false
    export PATH="${PATH}:${HOME}/.poetry/bin"
    poetry install --with=dev

Add this step just before the "Install dependencies using Poetry" step. This can significantly reduce the time taken for installing dependencies in subsequent runs.

.github/workflows/release-pypi-build-push-package.yml (1)

Line range hint 1-68: Consider the following improvements to enhance the workflow:

  1. Virtual Environment: The workflow explicitly disables Poetry's virtual environment creation. While this might be intentional, it could lead to potential conflicts. Consider using a virtual environment for better isolation.

  2. Git Push Timing: The git push step is performed after the package upload. If the upload fails, this could lead to inconsistencies. Consider moving the git push step before the upload or implementing a rollback mechanism.

  3. Error Handling: Implement explicit error handling and consider adding a rollback mechanism for critical steps like version bumping and package uploading.

  4. Caching: Implement caching for Poetry dependencies to speed up subsequent runs. You can use GitHub Actions' actions/cache for this purpose.

  5. Python Version Matrix: Consider using a matrix strategy to test against multiple Python versions (e.g., 3.9, 3.10, 3.11) to ensure compatibility.

Here's an example of how you could implement caching and a Python version matrix:

jobs:
  build_push:
    strategy:
      matrix:
        python-version: ['3.9', '3.10', '3.11']
    runs-on: ubuntu-latest 
    steps:
      - uses: actions/checkout@v2
        with:
          ref: master

      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v2
        with:
          python-version: ${{ matrix.python-version }}

      - name: Cache Poetry dependencies
        uses: actions/cache@v2
        with:
          path: ~/.cache/pypoetry
          key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
          restore-keys: |
            ${{ runner.os }}-poetry-

      # ... rest of the steps ...

This change would test the package against multiple Python versions and implement caching for Poetry dependencies.

🧰 Tools
🪛 actionlint

15-15: the runner of "actions/setup-python@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

README.md (2)

83-83: LGTM: Updated supported Python versions

The removal of Python 3.8.x from the list of supported versions aligns with the PR objective to deprecate Python 3.8 support. This change is consistent with the project's goal of maintaining support for more recent Python versions.

Consider adding a brief note explaining why Python 3.8 support has been dropped (e.g., "Python 3.8 has reached its end of life"). This would provide context for users who might be affected by this change.


136-136: LGTM: Updated development environment setup instructions

The switch to Poetry for dependency management is a positive change, as it provides better dependency resolution and project isolation. The instructions are clear and easy to follow.

Consider adding a brief explanation of why Poetry is preferred over previous methods (e.g., "Poetry provides better dependency resolution and project isolation"). This would help users understand the benefits of this change.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 2992536 and e2d87d2.

📒 Files selected for processing (6)
  • .github/workflows/release-pypi-build-push-package.yml (1 hunks)
  • .github/workflows/release-pypi-build-push-test-package.yml (1 hunks)
  • .github/workflows/tests-integration.yaml (1 hunks)
  • .github/workflows/tests-unit.yml (2 hunks)
  • README.md (4 hunks)
  • pyproject.toml (1 hunks)
🧰 Additional context used
🔇 Additional comments (11)
pyproject.toml (3)

28-28: LGTM: Python version specification updated correctly

The Python version specification has been updated to remove support for Python 3.8, which aligns with the PR objective to deprecate Python 3.8. The new specification correctly supports Python versions 3.9, 3.10, 3.11, and 3.12.


Line range hint 1-65: Changes align with PR objectives

The modifications to the pyproject.toml file are in line with the PR objective to deprecate Python 3.8 support. The removal of Python 3.8 from the supported versions list (line 28) and the absence of Python 3.8 in the classifiers section effectively implement this deprecation.


Line range hint 1-28: Verify complete removal of Python 3.8 dependencies

The explicit references to Python 3.8 have been removed from the pyproject.toml file. However, it's important to ensure that there are no implicit dependencies or configurations in the project that might still rely on Python 3.8 specific features or behaviors.

Please run the following script to check for any remaining references to Python 3.8 in the project:

If any results are found, please review them to ensure they don't indicate remaining dependencies on Python 3.8.

Also applies to: 29-65

.github/workflows/release-pypi-build-push-package.yml (1)

17-17: LGTM: Python version updated correctly.

The change from Python 3.8 to 3.9 aligns with the PR objective to deprecate Python 3.8 support.

Let's verify if this change is consistent across all workflow files:

✅ Verification successful

Verified: Python version consistently updated across all workflow files.

All workflow files now use Python 3.9 or later, aligning with the PR objective to deprecate Python 3.8 support.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if all workflow files use Python 3.9 or later

# Test: Search for Python version specifications in workflow files
echo "Checking Python versions in workflow files:"
rg --type yaml 'python-version:' .github/workflows/

Length of output: 705

.github/workflows/release-pypi-build-push-test-package.yml (4)

Line range hint 1-67: Overall, the workflow update looks good.

The change to use Python 3.9 is consistent with the PR objective of dropping support for Python 3.8. The rest of the workflow remains unchanged, which should be fine as long as all dependencies and build processes are compatible with Python 3.9. The suggested verifications for Poetry version and package compatibility will help ensure a smooth transition.

🧰 Tools
🪛 actionlint

19-19: the runner of "actions/setup-python@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


21-21: Python version update aligns with PR objectives.

The change from Python 3.8 to 3.9 is consistent with the PR objective of dropping support for Python 3.8 due to its EOL status. This update ensures that the package is built and tested using a supported Python version.

To ensure consistency across the repository, let's check if other workflow files have been updated similarly:

#!/bin/bash
# Description: Check for Python version specifications in other workflow files

# Test: Search for Python version specifications in other workflow files
echo "Checking Python version specifications in other workflow files:"
rg --type yaml 'python-version:' .github/workflows

Line range hint 26-26: Verify Poetry version.

The workflow is using Poetry version 1.8.2. While this is a recent version, it's worth checking if there's a newer stable version available that might include improvements or bug fixes relevant to Python 3.9 support.

To check the latest Poetry version:

🧰 Tools
🪛 actionlint

19-19: the runner of "actions/setup-python@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


Line range hint 30-33: Verify package compatibility with Python 3.9.

With the update to Python 3.9, it's important to ensure that all dependencies and build processes are compatible with this version. Consider reviewing the pyproject.toml file to check if any dependencies need updates or if any build configurations need adjustments for Python 3.9.

Let's check the pyproject.toml file for Python version specifications:

✅ Verification successful

Package Compatibility Verified

The pyproject.toml specifies Python versions: ~3.9 || ~3.10 || ~3.11 || ~3.12, confirming compatibility with Python 3.9.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check Python version specifications in pyproject.toml

# Test: Search for Python version specifications in pyproject.toml
echo "Python version specifications in pyproject.toml:"
rg 'python' pyproject.toml

Length of output: 315


Script:

#!/bin/bash
# Description: Check Python version specifications in pyproject.toml

# Search for Python version specifications in pyproject.toml
echo "Python version specifications in pyproject.toml:"
rg 'python' pyproject.toml

Length of output: 198

🧰 Tools
🪛 actionlint

19-19: the runner of "actions/setup-python@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

README.md (3)

53-53: LGTM: Updated Terraform image tag format

The TERRAFORM_IMAGE_TAG has been updated to the new format '1.5.0-0.2.0', which aligns with the migration instructions provided. This change ensures compatibility with the new version of Leverage CLI.


230-230: LGTM: Updated Release Candidate version format

The change in the Release Candidate version format from '1.2.3-rc.1' to '1.2.3rc.1' has been noted. This update ensures consistency in version naming conventions.

Could you please clarify if this change in the Release Candidate version format is related to the Python 3.8 deprecation or if it's a separate improvement? This context would be helpful for understanding the scope of changes in this PR.


Line range hint 1-230: Overall assessment: Changes align with PR objective

The updates to the README.md file successfully address the deprecation of Python 3.8 support and provide clear instructions for users on supported versions, installation, and development environment setup. The switch to Poetry for dependency management is a positive change that enhances project management.

Key points:

  1. Removed Python 3.8.x from supported versions.
  2. Updated development environment setup instructions to use Poetry.
  3. Minor updates to Terraform image tag format and Release Candidate version format.

These changes effectively communicate the new requirements and processes to users and contributors.

Comment on lines 28 to 29
python-version: ['3.9.15', '3.10.8', '3.11.8', '3.12.5']
toolbox-image-tag: ['1.3.5-0.2.0', '1.5.0-0.2.0', '1.6.0-0.2.0']
Copy link

@coderabbitai coderabbitai bot Oct 17, 2024

Choose a reason for hiding this comment

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

💡 Codebase verification

❌ Toolbox Image Tags Missing

The new toolbox image tags (1.3.5-0.2.0, 1.5.0-0.2.0, 1.6.0-0.2.0) do not exist in the registry. Please ensure that these tags are correctly built and pushed to the registry to maintain compatibility with the integration tests.

🔗 Analysis chain

LGTM on Python version update. Verify toolbox image tag compatibility.

The removal of Python 3.8.14 from the test matrix aligns with the PR objective to deprecate Python 3.8 support. This change is approved.

The toolbox image tags have been updated to newer versions (1.3.5-0.2.0, 1.5.0-0.2.0, 1.6.0-0.2.0). While this update is likely beneficial, it's important to ensure these new versions are compatible with the project requirements and don't introduce any breaking changes.

To verify the compatibility of the new toolbox image tags, please run the following script:

This script will help identify any significant changes between the old and new toolbox image tags. Please review the output to ensure compatibility.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if the new toolbox image tags exist and compare their contents with the old ones

old_tags=("1.3.5-0.1.15" "1.5.0-0.1.15" "1.6.0-0.1.15")
new_tags=("1.3.5-0.2.0" "1.5.0-0.2.0" "1.6.0-0.2.0")

for i in "${!new_tags[@]}"; do
    old_tag=${old_tags[$i]}
    new_tag=${new_tags[$i]}
    
    echo "Comparing ${old_tag} with ${new_tag}:"
    
    # Check if the new tag exists
    if ! docker pull "your-registry/toolbox:${new_tag}" &> /dev/null; then
        echo "Error: New tag ${new_tag} does not exist!"
        continue
    fi
    
    # Compare the contents of the old and new images
    diff <(docker run --rm "your-registry/toolbox:${old_tag}" ls -R /) <(docker run --rm "your-registry/toolbox:${new_tag}" ls -R /)
    
    if [ $? -eq 0 ]; then
        echo "No differences found between ${old_tag} and ${new_tag}"
    else
        echo "Differences found between ${old_tag} and ${new_tag}. Please review the changes carefully."
    fi
    
    echo
done

Length of output: 1069

Copy link
Member

Choose a reason for hiding this comment

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

@coderabbitai they do exist.

Copy link

Choose a reason for hiding this comment

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

@exequielrafaela Thank you for the clarification. It appears the new toolbox image tags do exist. Apologies for any confusion.


✏️ Learnings added
Learnt from: exequielrafaela
PR: binbashar/leverage#289
File: .github/workflows/tests-integration.yaml:28-29
Timestamp: 2024-10-17T16:31:27.344Z
Learning: The toolbox image tags `1.3.5-0.2.0`, `1.5.0-0.2.0`, and `1.6.0-0.2.0` exist in the registry.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

@coveralls
Copy link
Collaborator

coveralls commented Oct 17, 2024

Pull Request Test Coverage Report for Build 11612216358

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 60.037%

Totals Coverage Status
Change from base Build 11222088369: 0.1%
Covered Lines: 2438
Relevant Lines: 3918

💛 - Coveralls

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between e2d87d2 and dde0d88.

⛔ Files ignored due to path filters (1)
  • poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • .github/workflows/tests-integration.yaml (1 hunks)
  • .github/workflows/tests-unit.yml (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/tests-unit.yml
🧰 Additional context used
🔇 Additional comments (1)
.github/workflows/tests-integration.yaml (1)

29-29: LGTM on toolbox image tag update.

The toolbox image tags have been updated to newer versions (1.3.5-0.2.0, 1.5.0-0.2.0, 1.6.0-0.2.0). This change is approved, and the existence of these tags has been confirmed in a previous review.

.github/workflows/tests-integration.yaml Show resolved Hide resolved
@angelofenoglio angelofenoglio merged commit 4f77c9d into master Nov 4, 2024
24 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants