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

build: update install constraints on numpy and qt packages #1157

Merged
merged 3 commits into from
Jul 18, 2024

Conversation

Czaki
Copy link
Collaborator

@Czaki Czaki commented Jul 18, 2024

Bump python version in some CI jobs

Summary by CodeRabbit

  • New Features

    • Updated support for Python 3.11 in Azure Pipelines.
    • Updated GitHub Actions workflow to support macOS 14 and Python 3.12.
  • Dependencies

    • Updated dependencies in pyproject.toml to conditionally include numpy, napari, and PartSeg based on Python versions.
  • Tests

    • Modified test fixture data type from np.uint8 to np.uint16 for enhanced precision.
  • Refactor

    • Added utility functions to streamline dependency specification handling in build utilities.

@Czaki Czaki added this to the 0.15.4 milestone Jul 18, 2024
Copy link
Contributor

sourcery-ai bot commented Jul 18, 2024

🧙 Sourcery has finished reviewing your pull request!


Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link
Contributor

coderabbitai bot commented Jul 18, 2024

Walkthrough

The recent changes primarily focused on updating dependencies and configurations to align with newer Python versions, primarily moving from Python 3.9 to 3.11 and 3.12. Key modifications were made in Azure Pipelines and GitHub Actions workflows, and conditional dependencies were refined in pyproject.toml. Additionally, new utility functions were added to a Python script for better dependency management, and a test fixture was updated to use a different data type for arrays.

Changes

File Path Change Summary
.azure-pipelines/pyinstaller.yaml Updated Python version from 3.9 to 3.11 and adjusted constraints file name accordingly.
.github/workflows/test_prereleases.yml Modified matrix configuration to use macOS 14 and Python 3.12.
pyproject.toml Introduced conditional dependencies and updated packages to support specific frameworks.
package/tests/conftest.py Changed the data type of the data array in the image fixture from np.uint8 to np.uint16.
build_utils/pyproject_toml_to_yaml.py Added functions drop_line and remove_specifier to manipulate dependency specifications.

Poem

In the code's vast realm, updates arise,
Python versions leap, reaching new skies.
Dependencies dance in a structured ballet,
As fixtures evolve in a grand display.
With each change, we pave the way anew,
For a future bright and code that's true. 🍀


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.
    • @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 as 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.

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

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
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.

We've reviewed this pull request using the Sourcery rules engine. If you would also like our AI-powered code review then let us know.

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between aac66a7 and 0e5a47d.

Files selected for processing (3)
  • .azure-pipelines/pyinstaller.yaml (1 hunks)
  • .github/workflows/test_prereleases.yml (1 hunks)
  • pyproject.toml (2 hunks)
Additional comments not posted (6)
.azure-pipelines/pyinstaller.yaml (2)

8-8: Update Python version to 3.11.

The Python version update to 3.11 is appropriate. Ensure that all dependencies and code are compatible with Python 3.11.


16-16: Update constraints file to match Python version.

The constraints file has been updated to constraints_py3.11.txt to match the new Python version. Ensure that this constraints file exists and is correctly configured.

.github/workflows/test_prereleases.yml (1)

44-45: Update platform and Python version in matrix configuration.

The platform is updated to macos-14 and the Python version to 3.12. Ensure that all dependencies and code are compatible with these updates.

pyproject.toml (3)

57-58: Introduce conditional dependencies for numpy.

The conditional dependencies for numpy based on Python versions are correctly specified. Ensure that these conditions align with the project's requirements and compatibility.


123-127: Update dependencies for napari with specific extras.

The dependencies for napari with specific extras like pyqt5 and pyqt6 are correctly specified. Ensure that these updates are consistent with the project's requirements and compatibility.


131-142: Update dependencies for napari with specific extras.

The dependencies for napari with specific extras like pyside2 and pyside6_experimental are correctly specified. Ensure that these updates are consistent with the project's requirements and compatibility.

Copy link

codecov bot commented Jul 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.05%. Comparing base (aac66a7) to head (e1521fb).
Report is 50 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1157   +/-   ##
========================================
  Coverage    93.05%   93.05%           
========================================
  Files          208      208           
  Lines        32763    32763           
========================================
  Hits         30486    30486           
  Misses        2277     2277           

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

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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 0e5a47d and ec842e7.

Files selected for processing (1)
  • package/tests/conftest.py (1 hunks)
Additional comments not posted (1)
package/tests/conftest.py (1)

45-45: LGTM! But verify the fixture usage in the test suite.

The code changes are approved.

However, ensure that all test cases using the image fixture are compatible with the new data type.

Copy link

sonarcloud bot commented Jul 18, 2024

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: 1

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between ec842e7 and e1521fb.

Files selected for processing (1)
  • build_utils/pyproject_toml_to_yaml.py (1 hunks)
Additional comments not posted (2)
build_utils/pyproject_toml_to_yaml.py (2)

19-23: LGTM!

The remove_specifier function is well-implemented and handles the case where a semicolon is present.


28-28: LGTM!

The modification to the dependencies variable assignment correctly integrates the new functions to filter and process the dependencies.

Comment on lines +9 to +16
def drop_line(line):
if "python_version < '3.10'" in line:
return False

if "python_version < '3.11'" in line: # noqa: SIM103
return False

return True
Copy link
Contributor

Choose a reason for hiding this comment

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

Optimize the conditional statements in drop_line.

You can combine the conditions into a single statement for better readability and performance.

- def drop_line(line):
-    if "python_version < '3.10'" in line:
-        return False
-    if "python_version < '3.11'" in line:  # noqa: SIM103
-        return False
-    return True
+ def drop_line(line):
+    if "python_version < '3.10'" in line or "python_version < '3.11'" in line:  # noqa: SIM103
+        return False
+    return True
Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
def drop_line(line):
if "python_version < '3.10'" in line:
return False
if "python_version < '3.11'" in line: # noqa: SIM103
return False
return True
def drop_line(line):
if "python_version < '3.10'" in line or "python_version < '3.11'" in line: # noqa: SIM103
return False
return True

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.

1 participant