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

Drop python3.8 support #8360

Merged
merged 5 commits into from
Oct 29, 2024
Merged

Drop python3.8 support #8360

merged 5 commits into from
Oct 29, 2024

Conversation

Marishka17
Copy link
Contributor

@Marishka17 Marishka17 commented Aug 27, 2024

Motivation and context

https://devguide.python.org/versions/#unsupported-versions

How has this been tested?

Checklist

  • I submit my changes into the develop branch
  • I have created a changelog fragment
  • I have updated the documentation accordingly
  • I have added tests to cover my changes
  • I have linked related issues (see GitHub docs)
  • I have increased versions of npm packages if it is necessary
    (cvat-canvas,
    cvat-core,
    cvat-data and
    cvat-ui)

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

Summary by CodeRabbit

Release Notes

  • New Features

    • Updated Python version requirement to 3.9 across various workflows and documentation.
  • Documentation

    • Updated CLI and SDK documentation to reflect the new Python version requirement (3.9 and higher).
  • Chores

    • Deprecated support for Python 3.8 due to its end-of-life status.

Copy link
Contributor

coderabbitai bot commented Aug 27, 2024

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

The changes in this pull request primarily involve updating the Python version from 3.8 to 3.9 across various workflow files and documentation. The .github/workflows/full.yml, .github/workflows/main.yml, and .github/workflows/schedule.yml files reflect this update in their respective jobs. Additionally, a deprecation notice has been added to indicate the dropping of support for Python 3.8 due to its end-of-life status. The setup.py and pyproject.toml files have also been modified to require Python 3.9 or higher, ensuring compatibility with the updated environment.

Changes

File Path Change Summary
.github/workflows/full.yml Updated python-version from '3.8' to '3.9' in rest_api_testing job; added required input ref.
.github/workflows/main.yml Updated python-version from '3.8' to '3.9' in rest_api_testing job.
.github/workflows/schedule.yml Updated python-version from '3.8' to '3.9' in unit_testing job.
changelog.d/20241029_113229_maria_drop_python_3_8_support.md Added deprecation notice for Python 3.8 support due to EOL status.
cvat-cli/setup.py Updated python_requires from ">=3.8" to ">=3.9" in setup() function.
pyproject.toml Updated target-version in [tool.black] from ['py38'] to ['py39'].
site/content/en/docs/api_sdk/cli/_index.md Updated documentation to reflect required Python version change from "3.8 and higher" to "3.9 and higher".
site/content/en/docs/api_sdk/sdk/_index.md Updated documentation to reflect required Python version change from "3.8 and higher" to "3.9 and higher".

Poem

In fields of code, we hop and play,
With Python 3.9, we leap today!
From 3.8, we bid farewell,
New features bloom, all is well.
So let’s rejoice, both near and far,
Our code now shines, a bright new star! 🐇✨


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

sonarcloud bot commented Aug 27, 2024

@zhiltsov-max
Copy link
Contributor

Python 3.8 EOL is 2024-10-07, so this PR can be unfrozen now.

@SpecLad
Copy link
Contributor

SpecLad commented Oct 28, 2024

Please add a changelog entry and update the black configuration in pyproject.toml as well.

@Marishka17 Marishka17 marked this pull request as ready for review October 29, 2024 10:37
Copy link
Contributor

@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: 0

🧹 Outside diff range and nitpick comments (3)
pyproject.toml (1)

Line range hint 1-8: Consider updating isort's Python version requirements.

While black's target version has been updated, isort's configuration might also benefit from explicitly setting a minimum Python version to maintain consistency across all tools.

Consider adding a py_version setting to the isort configuration:

 [tool.isort]
 profile = "black"
 forced_separate = ["tests"]
 line_length = 100
 skip_gitignore = true # align tool behavior with Black
+py_version = 39
cvat-cli/setup.py (2)

Line range hint 44-48: Consider updating Python version classifier.

The current classifier "Programming Language :: Python :: 3" is very generic. Consider adding specific version classifiers to better communicate supported Python versions.

     classifiers=[
         "Programming Language :: Python :: 3",
+        "Programming Language :: Python :: 3.9",
+        "Programming Language :: Python :: 3.10",
+        "Programming Language :: Python :: 3.11",
+        "Programming Language :: Python :: 3.12",
         "License :: OSI Approved :: MIT License",
         "Operating System :: OS Independent",
     ],

Python version requirement is specified in setup.py but missing in README.md

The setup.py file specifies Python >= 3.9 requirement, but this information is not documented in the README.md. The README should be updated to include this important requirement for users.

  • cvat-cli/README.md: Add Python version requirement (>= 3.9) in the Installation section
🔗 Analysis chain

Line range hint 39-40: Verify README.md Python version requirements.

The setup is using README.md for the long description. Let's verify it contains the updated Python version requirements.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check if README.md mentions Python version requirements
echo "Checking README.md for Python version requirements..."
cat README.md | grep -i "python.*[>=]\s*3\.[0-9]"

Length of output: 168


Script:

#!/bin/bash
# Let's first check if README.md exists and its content
echo "Checking README.md content..."
if [ -f "README.md" ]; then
    cat README.md
else 
    echo "README.md not found in root"
    # Check if it exists in cvat-cli directory
    if [ -f "cvat-cli/README.md" ]; then
        cat cvat-cli/README.md
    fi
fi

Length of output: 17816


Script:

#!/bin/bash
# Let's check the cvat-cli specific README and setup.py for Python version requirements
echo "Checking cvat-cli/README.md..."
if [ -f "cvat-cli/README.md" ]; then
    cat cvat-cli/README.md
fi

echo -e "\nChecking cvat-cli/setup.py..."
if [ -f "cvat-cli/setup.py" ]; then
    cat cvat-cli/setup.py
fi

Length of output: 4207


Script:

#!/bin/bash
# Let's check the base requirements file for Python version requirements
echo "Checking requirements/base.txt..."
if [ -f "cvat-cli/requirements/base.txt" ]; then
    cat cvat-cli/requirements/base.txt
fi

Length of output: 273

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 251054b and 2e13fcd.

⛔ Files ignored due to path filters (1)
  • cvat-sdk/gen/generator-config.yml is excluded by !**/gen/**
📒 Files selected for processing (8)
  • .github/workflows/full.yml (1 hunks)
  • .github/workflows/main.yml (1 hunks)
  • .github/workflows/schedule.yml (1 hunks)
  • changelog.d/20241029_113229_maria_drop_python_3_8_support.md (1 hunks)
  • cvat-cli/setup.py (1 hunks)
  • pyproject.toml (1 hunks)
  • site/content/en/docs/api_sdk/cli/_index.md (1 hunks)
  • site/content/en/docs/api_sdk/sdk/_index.md (1 hunks)
✅ Files skipped from review due to trivial changes (3)
  • changelog.d/20241029_113229_maria_drop_python_3_8_support.md
  • site/content/en/docs/api_sdk/cli/_index.md
  • site/content/en/docs/api_sdk/sdk/_index.md
🔇 Additional comments (8)
pyproject.toml (1)

9-9: LGTM! The black configuration update aligns with dropping Python 3.8 support.

The change to target Python 3.9 is appropriate given Python 3.8's EOL status as of October 7, 2024.

cvat-cli/setup.py (1)

59-59: LGTM! Python version requirement update is appropriate.

The change to require Python >=3.9 aligns with dropping Python 3.8 support, which reached EOL on October 7, 2024.

.github/workflows/schedule.yml (2)

109-109: LGTM: Python version update aligns with EOL status.

The update from Python 3.8 to 3.9 is appropriate given Python 3.8's end-of-life status as of October 7, 2024.


109-109: Verify Python version consistency across workflow files.

Let's ensure this Python version update is consistently applied across all workflow files.

✅ Verification successful

Python version is consistently set to 3.9 across all workflow files

All GitHub Actions workflow files (.github/workflows/schedule.yml, full.yml, and main.yml) are using Python version 3.9 consistently. No version mismatches were found.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check Python version settings across all workflow files
# Expected: All workflow files should use Python 3.9 or higher

echo "Checking Python version settings in workflow files..."
rg -A 1 "setup-python@v\d+" .github/workflows/ | rg "python-version"

Length of output: 185


Script:

#!/bin/bash
# Let's try a different approach to find Python version specifications in workflow files
echo "Searching for Python version specifications in workflow files..."
rg "python-version:" .github/workflows/

Length of output: 359

.github/workflows/full.yml (2)

105-105: LGTM! Python version update aligns with EOL policy.

The update from Python 3.8 to 3.9 is appropriate given Python 3.8's EOL status as of October 7, 2024.


105-105: Verify Python version consistency across jobs.

While the rest_api_testing job has been updated to use Python 3.9, let's verify if other jobs in this workflow also need Python version updates.

✅ Verification successful

Python version 3.9 is consistently used across all workflow files

The verification results show that Python version 3.9 is consistently specified in all GitHub workflow files that use Python:

  • .github/workflows/schedule.yml: python-version: '3.9'
  • .github/workflows/main.yml: python-version: '3.9'
  • .github/workflows/full.yml: python-version: '3.9'

All jobs that require Python are using the same version, so no updates are needed.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for Python version specifications across workflow files
# Expected results: All Python version specifications should be >= 3.9

# Search for Python version specifications in workflow files
echo "Searching for Python version specifications in workflow files..."
rg -A 2 'actions/setup-python' .github/workflows/

# Search for potential Python usage in workflow files
echo -e "\nSearching for potential Python usage in workflow files..."
rg -i 'python|pip|pytest' .github/workflows/

Length of output: 7707

.github/workflows/main.yml (2)

141-141: LGTM: Python version update aligns with EOL strategy.

The update from Python 3.8 to 3.9 in the rest_api_testing job is appropriate given Python 3.8's EOL status as of October 7, 2024.


141-141: Verify Python dependencies compatibility.

Since we're upgrading the Python version, let's ensure all dependencies in the test requirements are compatible with Python 3.9.

✅ Verification successful

Let me check the actual content of the requirements file to better understand the dependencies.


Dependencies are compatible with Python 3.9

All listed dependencies in tests/python/requirements.txt are known to be compatible with Python 3.9. Notable packages like pytest, requests, boto3, Pillow, and numpy have well-established support for Python 3.9. None of the specified versions have any known compatibility issues with Python 3.9.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if any dependencies in test requirements specify Python version constraints

# Test: Look for Python version constraints in requirements files
echo "Checking Python version constraints in requirements files..."
rg -l "python_version" tests/python/requirements.txt || true

Length of output: 190


Script:

#!/bin/bash
# Check the content of requirements file
cat tests/python/requirements.txt

Length of output: 235

@codecov-commenter
Copy link

codecov-commenter commented Oct 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.20%. Comparing base (251054b) to head (f57edeb).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #8360   +/-   ##
========================================
  Coverage    74.20%   74.20%           
========================================
  Files          403      403           
  Lines        43375    43375           
  Branches      3925     3925           
========================================
+ Hits         32185    32188    +3     
+ Misses       11190    11187    -3     
Components Coverage Δ
cvat-ui 78.58% <ø> (+0.01%) ⬆️
cvat-server 70.47% <ø> (ø)

Co-authored-by: Roman Donchenko <roman@cvat.ai>
Copy link

sonarcloud bot commented Oct 29, 2024

@SpecLad SpecLad merged commit 9982156 into develop Oct 29, 2024
34 checks passed
@SpecLad SpecLad deleted the mk/drop-python-3.8-support branch October 29, 2024 12:26
SpecLad added a commit to SpecLad/cvat that referenced this pull request Oct 29, 2024
SpecLad added a commit that referenced this pull request Oct 29, 2024
Starting with Python 3.9, `with` allows parenthesized context managers,
which black will use when needed.
@cvat-bot cvat-bot bot mentioned this pull request Oct 31, 2024
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.

4 participants