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

ci: Add python 3.12 testing #1087

Merged
merged 11 commits into from Apr 19, 2024
Merged

ci: Add python 3.12 testing #1087

merged 11 commits into from Apr 19, 2024

Conversation

Czaki
Copy link
Collaborator

@Czaki Czaki commented Mar 5, 2024

Summary by CodeRabbit

  • New Features
    • Added support for Python 3.12 in the classifiers section, enhancing compatibility with newer Python environments.
  • Bug Fixes
    • Improved error handling in batch processing and plugin registration for stability and robustness.
  • Chores
    • Updated various package dependencies to newer versions, ensuring improved performance and security.
  • Documentation
    • Updated environment configurations to include Python 3.12, aligning with the latest development practices.

@Czaki Czaki added this to the 0.15.3 milestone Mar 5, 2024
Copy link
Contributor

coderabbitai bot commented Mar 5, 2024

Walkthrough

This update encompasses a plethora of package version upgrades, extends Python support up to 3.12, and bolsters error handling and plugin registration in the PartSeg project. Noteworthy improvements include robust error checks in batch processing and a refined approach to managing plugin entry points, ensuring smoother operations and increased stability.

Changes

File or Directory Summary of Changes
requirements/constraints_py3.9.txt Updated versions for multiple packages like dask, pytest, pillow, and added shellingham.
requirements/constraints_py3.9_pydantic_1.txt Version updates for various packages including pyinstaller and sphinx.
pyproject.toml Added support for Python 3.12 in the classifiers section.
tox.ini Updated to include Python 3.12 in the environment list and adjust corresponding test environments.
package/PartSeg/plugins/__init__.py
package/PartSegCore/analysis/batch_processing/batch_backend.py
package/PartSegCore/analysis/batch_processing/parallel_backend.py
Enhanced plugin entry point handling and error management in batch processing.
package/tests/test_PartSegCore/test_analysis_batch.py Improved error checking in batch processing tests.

🐰✨📘🌟
In the land of code, where the updates flow,
A rabbit hopped, with changes in tow.
"Bugs beware, for I've sharpened my tools,
With tests and checks, I follow the rules.
Through fields of code, with leaps and bounds,
Ensuring each line, securely compounds!"
🌼🐾💻🌼


Recent Review Details

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 9d4d7a7 and d961136.
Files selected for processing (2)
  • package/PartSegCore/analysis/batch_processing/batch_backend.py (1 hunks)
  • package/tests/test_PartSegCore/test_analysis_batch.py (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • package/PartSegCore/analysis/batch_processing/batch_backend.py
  • package/tests/test_PartSegCore/test_analysis_batch.py

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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration 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 Mar 5, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey Czaki - Here's my review!

General suggestions:

  • Verify all project dependencies for compatibility with Python 3.12 to avoid potential integration issues.
  • Consider the impact of adding Python 3.12 on CI build times and resource usage, and adjust as necessary to maintain efficient CI operations.
  • Ensure that any Python 3.12 specific dependencies or version constraints are accounted for in the upgrade process.

Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨

Share Sourcery

Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

@@ -39,7 +39,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python_version: ["3.8", "3.9", "3.10", "3.11"]
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
Copy link
Contributor

Choose a reason for hiding this comment

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

question (llm): Adding Python 3.12 to the testing matrix is a great move for forward compatibility. However, it's important to ensure that all dependencies of the project are compatible with Python 3.12. Have we verified that all dependencies support Python 3.12, or are there any known issues?

@@ -35,7 +35,7 @@ jobs:
pip install -U uv
flags=(--extra pyqt5 --extra pyqt6 --extra pyside2 --extra pyside6 --extra test --extra pyinstaller)

for pyv in 3.8 3.9 3.10 3.11; do
for pyv in 3.8 3.9 3.10 3.11 3.12; do
Copy link
Contributor

Choose a reason for hiding this comment

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

question (llm): Including Python 3.12 in the upgrade-dependencies workflow is crucial for maintaining up-to-date dependencies. However, it's equally important to ensure that the upgrade process accounts for any Python 3.12 specific dependencies or version constraints. Are there any additional steps or considerations needed for Python 3.12 in the upgrade process?

@@ -39,7 +39,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python_version: ["3.8", "3.9", "3.10", "3.11"]
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion (llm): Expanding the testing matrix to include Python 3.12 across different operating systems is commendable for ensuring cross-platform compatibility. However, have we considered the potential impact on CI build times and resource usage? It might be beneficial to monitor these aspects to ensure efficient CI operations.

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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between c873239 and dddce12.
Files ignored due to path filters (2)
  • pyproject.toml is excluded by: !**/*.toml
  • tox.ini is excluded by: !**/*.ini
Files selected for processing (12)
  • .github/workflows/tests.yml (2 hunks)
  • .github/workflows/upgrade-dependencies.yml (1 hunks)
  • requirements/constraints_py3.10.txt (6 hunks)
  • requirements/constraints_py3.10_pydantic_1.txt (6 hunks)
  • requirements/constraints_py3.11.txt (5 hunks)
  • requirements/constraints_py3.11_pydantic_1.txt (5 hunks)
  • requirements/constraints_py3.12.txt (1 hunks)
  • requirements/constraints_py3.12_pydantic_1.txt (1 hunks)
  • requirements/constraints_py3.8.txt (4 hunks)
  • requirements/constraints_py3.8_pydantic_1.txt (4 hunks)
  • requirements/constraints_py3.9.txt (4 hunks)
  • requirements/constraints_py3.9_pydantic_1.txt (4 hunks)
Additional comments: 48
.github/workflows/upgrade-dependencies.yml (1)
  • 38-38: Adding Python 3.12 to the loop iteration for upgrading dependencies is a positive step towards ensuring compatibility with the latest Python version. Ensure that all dependencies and their respective constraint files are correctly managed for Python 3.12, as this version might introduce changes that affect package compatibility.
.github/workflows/tests.yml (2)
  • 42-42: Adding Python 3.12 to the test matrix in the base-test job is a crucial step towards ensuring compatibility with the latest Python version. This broadens the testing scope and helps identify potential compatibility issues early.
  • 81-81: Incorporating Python 3.12 into the test matrix for the base-test-main job expands the project's testing capabilities to include the latest Python version. This is an important step in ensuring that the project remains compatible with new Python releases.
requirements/constraints_py3.11_pydantic_1.txt (5)
  • 21-21: The update of build to version 1.1.1 is noted. Ensure that this version is compatible with the project's build system and does not introduce any breaking changes.
  • 87-87: Updating ipython to 8.22.2 could enhance interactive debugging and execution. Verify that this version works well with other interactive tools used in the project, such as Jupyter notebooks.
  • 121-121: The upgrade of magicgui to 0.8.2 should be checked for compatibility with the project's GUI components, especially if napari plugins are extensively used.
  • 253-253: The update of pyinstaller-hooks-contrib to 2024.2 is crucial for ensuring that the project's executable builds include the correct versions of dependencies. Confirm that this update does not affect the build process or the resulting executables.
  • 284-284: Upgrading python-dateutil to 2.9.0.post0 might impact date and time handling in the project. It's important to verify that this update does not introduce regressions in date/time processing functionalities.
requirements/constraints_py3.11.txt (5)
  • 23-23: The update of build from 1.0.3 to 1.1.1 is noted. Ensure that this version is compatible with the project's build system and does not introduce breaking changes.
  • 89-89: Updating ipython to 8.22.2 should be checked for compatibility with the project's interactive Python sessions, especially regarding new features or deprecated functionalities.
  • 123-123: The magicgui version bump to 0.8.2 should be verified for compatibility with the project's GUI components, ensuring that all functionalities work as expected.
  • 257-257: The update of pyinstaller-hooks-contrib to 2024.2 needs to be checked for any potential issues with the project's PyInstaller hooks, especially for new or updated dependencies.
  • 288-288: Upgrading python-dateutil to 2.9.0.post0 should be carefully reviewed for date and time handling within the project, ensuring no regressions or unexpected behavior changes.
requirements/constraints_py3.10_pydantic_1.txt (5)
  • 21-21: The update of build from 1.0.3 to 1.1.1 should be checked for compatibility with the project's build system and any scripts that rely on it.
  • 93-93: Updating ipython from 8.22.1 to 8.22.2 is a minor version change. Ensure that this update does not introduce any breaking changes or incompatibilities with the project's interactive Python sessions or scripts.
  • 127-127: The update of magicgui from 0.8.1 to 0.8.2 should be verified for compatibility with the project's GUI components, especially if magicgui is used extensively for UI elements.
  • 259-259: The update of pyinstaller-hooks-contrib from 2024.1 to 2024.2 should be checked to ensure that all custom hooks and third-party libraries used in the project are still compatible and function correctly after the update.
  • 290-290: Updating python-dateutil from 2.8.2 to 2.9.0.post0 involves a minor version change. It's important to verify that this update does not affect the project's date and time handling, especially in critical functionalities.
requirements/constraints_py3.10.txt (5)
  • 23-23: The update of build from 1.0.3 to 1.1.1 should be verified for compatibility with the project's build system.
  • 95-95: Updating ipython from 8.22.1 to 8.22.2 is a minor change, likely for bug fixes or minor improvements. Ensure no breaking changes affect the project's interactive sessions.
  • 129-129: The update of magicgui from 0.8.1 to 0.8.2 should be checked for compatibility with the project's GUI components, especially if magicgui is used extensively.
  • 263-263: Updating pyinstaller-hooks-contrib from 2024.1 to 2024.2 might introduce changes to the hooks available for PyInstaller. Verify that all necessary hooks for the project's dependencies are still supported.
  • 294-294: The update of python-dateutil to 2.9.0.post0 is notable. Ensure this version does not introduce any backward-incompatible changes that could affect date and time handling in the project.
requirements/constraints_py3.9_pydantic_1.txt (4)
  • 21-21: The update of build from 1.0.3 to 1.1.1 seems appropriate. Ensure that this version is compatible with other dependencies and does not introduce breaking changes.
  • 131-131: Updating magicgui to 0.8.2 is a minor version change, which typically includes bug fixes and new features. Verify that the new features or fixes do not adversely affect existing functionality.
  • 263-263: The update of pyinstaller-hooks-contrib to 2024.2 should be checked for compatibility with pyinstaller and other related dependencies. This package plays a crucial role in the freezing process, and any incompatibilities could lead to build issues.
Verification successful

The explicit listing of pyinstaller==6.4.0 and pyinstaller-hooks-contrib==2024.2 in the requirements files for various Python versions, along with the absence of documented compatibility issues in the repository's documentation, changelogs, or workflow configurations, suggests that these versions are intended to be compatible. However, this does not guarantee the absence of any issues not documented within the repository.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Check for known issues with pyinstaller-hooks-contrib 2024.2 and compatibility with pyinstaller 6.4.0
grep -R "pyinstaller-hooks-contrib 2024.2 issues" documentation/

Length of output: 114



Script:

#!/bin/bash
# Search the entire repository for mentions of pyinstaller-hooks-contrib 2024.2 and pyinstaller to find any notes on compatibility or known issues.
grep -Ri "pyinstaller-hooks-contrib 2024.2" ./
grep -Ri "pyinstaller" ./

Length of output: 12898

* 294-294: Updating `python-dateutil` to `2.9.0.post0` introduces a post-release version. While post-releases typically include minor fixes, ensure that this version does not conflict with other packages requiring `python-dateutil`, especially in terms of version specifications.
Verification successful

The verification process did not reveal direct conflicts with the python-dateutil version 2.9.0.post0 across the checked requirements files. The only specific version found was 2.8.2 in requirements/constraints_py3.11_docs.txt, which does not directly conflict but indicates a preference for an older version in that particular context. The review comment's advice to ensure no conflicts arise due to the version update is prudent, but no direct evidence of conflicts was found. Therefore, the review comment remains relevant and accurate in advising caution, but no direct version conflicts were identified.

Scripts Executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Check for conflicts with python-dateutil 2.9.0.post0 in other requirements files
grep -R "python-dateutil" requirements/*.txt | grep -v "2.9.0.post0"

Length of output: 1525

requirements/constraints_py3.9.txt (4)
  • 23-23: The update of the build package version to 1.1.1 is approved. It likely introduces improvements or bug fixes compatible with the project's requirements.
  • 133-133: The minor version update of magicgui to 0.8.2 is approved, indicating non-breaking changes that could benefit the project.
  • 267-267: The update of pyinstaller-hooks-contrib to version 2024.2 is approved, suggesting incremental improvements that align with maintaining project compatibility.
  • 298-298: Updating python-dateutil to 2.9.0.post0 is approved, as post-releases often include critical fixes that enhance stability and compatibility.
requirements/constraints_py3.8_pydantic_1.txt (4)
  • 23-23: The update of build from 1.0.3 to 1.1.1 is noted. Ensure that this version is compatible with the project's build system and does not introduce any breaking changes.
  • 135-135: The update of magicgui from 0.8.1 to 0.8.2 should be checked for compatibility with the project's GUI components, especially if magicgui is used extensively.
  • 272-272: Updating pyinstaller-hooks-contrib from 2024.1 to 2024.2 could affect the project's packaging process. Verify that all hooks required for the project are still supported and function correctly.
  • 303-303: The update of python-dateutil to 2.9.0.post0 should be carefully reviewed for compatibility with date and time handling in the project. This is especially important if the project relies on specific behaviors of python-dateutil.
requirements/constraints_py3.8.txt (4)
  • 25-25: The update of build from 1.0.3 to 1.1.1 seems appropriate. Ensure that this version is compatible with other dependencies and the project's requirements.
  • 137-137: The update of magicgui from 0.8.1 to 0.8.2 is minor and likely includes bug fixes or minor improvements. Verify that there are no breaking changes affecting the project.
  • 276-276: Updating pyinstaller-hooks-contrib from 2024.1 to 2024.2 should be safe, assuming it's primarily bug fixes or minor enhancements. Double-check for any compatibility issues with pyinstaller.
  • 307-307: The update of python-dateutil to 2.9.0.post0 introduces a post-release version. Ensure this version doesn't introduce any unexpected behaviors, especially since it's a post-release which might include specific fixes or changes.
requirements/constraints_py3.12_pydantic_1.txt (8)
  • 154-154: Ensure that numpy==1.26.4 is compatible with Python 3.12. While numpy generally maintains good forward compatibility, it's crucial to verify this specific version against Python 3.12 to avoid potential runtime issues.
  • 191-191: pandas==2.2.1 should be checked for compatibility with Python 3.12. Given pandas' critical role in data manipulation, confirming its compatibility ensures the stability of any data-driven functionality in the project.
  • 260-260: pyqt5==5.15.10 needs verification for Python 3.12 compatibility. PyQt5, being a significant GUI framework, its compatibility is essential for any GUI components of the project.
  • 265-265: Check pyqt6==6.6.1 for compatibility with Python 3.12. As the successor to PyQt5, ensuring its compatibility is crucial for projects planning to migrate or use PyQt6 features.
  • 270-270: Verify pyside2==5.13.2 against Python 3.12. Given the choice between PyQt and PySide for Qt bindings in Python, confirming PySide2's compatibility is important for projects using it.
  • 271-271: Ensure pyside6==6.6.2 is compatible with Python 3.12. As with PyQt6, verifying PySide6's compatibility is essential for projects leveraging its features.
  • 278-278: pytest==8.0.2 should be checked for compatibility with Python 3.12. Given pytest's widespread use for testing in Python projects, confirming its compatibility is crucial for maintaining a robust testing pipeline.
  • 1-432: Overall, the file appears to be well-structured and follows the expected format for a Python dependency constraint file. However, it's important to ensure that all dependencies listed are indeed required for the project and that their versions are not only compatible with Python 3.12 but also with each other to avoid dependency conflicts.
requirements/constraints_py3.12.txt (1)
  • 1-437: Overall, the constraints_py3.12.txt file is well-structured and clearly specifies the versions of dependencies required for Python 3.12 support. The comments indicating the source of each dependency are helpful for understanding the dependency tree. No issues were found with the specified versions or the structure of the file.

Copy link

codecov bot commented Apr 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.95%. Comparing base (c245c3e) to head (d961136).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1087      +/-   ##
===========================================
+ Coverage    92.81%   92.95%   +0.13%     
===========================================
  Files          205      205              
  Lines        32475    32480       +5     
===========================================
+ Hits         30141    30191      +50     
+ Misses        2334     2289      -45     

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

Copy link

sonarcloud bot commented Apr 19, 2024

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@Czaki Czaki merged commit 75a220b into develop Apr 19, 2024
56 checks passed
@Czaki Czaki deleted the python3.12_test branch April 19, 2024 21:08
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.

None yet

1 participant