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

LIU-408: Add support for Python 3.11 and 3.12 #290

Merged
merged 4 commits into from
Nov 5, 2024
Merged

LIU-408: Add support for Python 3.11 and 3.12 #290

merged 4 commits into from
Nov 5, 2024

Conversation

myxie
Copy link
Collaborator

@myxie myxie commented Oct 15, 2024

This PR adds support for newer Python version, Python3.11 and 3.12.

As Python 3.8 and older version are no longer being maintained, it is useful to make sure we are working with new-er versions that are more likely to be installed on user's machines and shared computing facilities.

Summary by Sourcery

Add support for Python 3.11 and 3.12 by updating dependencies and CI configurations to ensure compatibility with these versions.

New Features:

  • Add support for Python 3.11 and 3.12 in the project.

Enhancements:

  • Update dependency versions for pyzmq and pydantic to ensure compatibility with Python 3.12.

CI:

  • Update CI configuration to include testing for Python 3.11 and 3.12.

myxie and others added 2 commits October 9, 2024 17:15
- Add `setuptools` as a dependency: pypa/virtualenv#2487
- Bump pyzmq version number: https://pyzmq.readthedocs.io/en/latest/changelog.html#id11
- Bump pydantic version number: pydantic/pydantic#9637
- This should resolve linter errors.
@coveralls
Copy link

coveralls commented Oct 15, 2024

Coverage Status

coverage: 79.631% (-0.002%) from 79.633%
when pulling 877c4a4 on LIU-408
into d075337 on master.

Copy link
Contributor

@awicenec awicenec left a comment

Choose a reason for hiding this comment

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

Good that is was so simple!

@myxie myxie marked this pull request as ready for review November 4, 2024 09:32
Copy link
Contributor

sourcery-ai bot commented Nov 4, 2024

Reviewer's Guide by Sourcery

This PR updates the codebase to support Python 3.11 and 3.12 by making necessary dependency updates and modifying the entry points handling code to accommodate different Python versions. The changes include updating package dependencies, modifying the entry points loading mechanism, and extending CI workflow to test against new Python versions.

Sequence diagram for entry points loading mechanism

sequenceDiagram
    participant Tool as Tool
    participant EntryPoints as importlib.metadata.entry_points
    participant Sys as sys

    Tool->>Sys: Check Python version
    alt Python < 3.10
        Tool->>EntryPoints: entry_points()
        loop For each entry point in dlg.tool_commands
            EntryPoints->>Tool: Load and register commands
        end
    else
        Tool->>EntryPoints: entry_points(group="dlg.tool_commands")
        loop For each entry point in dlg.tool_commands
            EntryPoints->>Tool: Load and register commands
        end
    end
Loading

File-Level Changes

Change Details Files
Updated entry points handling to support different Python versions
  • Replaced pkg_resources with importlib.metadata for entry points handling
  • Added version-specific logic to handle entry points differently for Python versions below and above 3.10
  • Added pylint disable comment for unexpected keyword argument
daliuge-common/dlg/common/tool.py
Extended CI workflow to include Python 3.11 and 3.12 testing
  • Added new test matrix entries for Python 3.11 and 3.12
  • Updated description labels to clarify Python versions
  • Maintained full package testing configuration for new versions
.github/workflows/run-unit-tests.yml
Updated package dependencies to ensure compatibility
  • Upgraded pyzmq from 25.1.0 to 25.1.1 for Python 3.12 support
  • Updated pydantic requirement to version 2.5 or higher
  • Added comment explaining pyzmq version requirement for Python 3.12
daliuge-common/setup.py
daliuge-engine/setup.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

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 @myxie - I've reviewed your changes - here's some feedback:

Overall Comments:

  • The upgrade to pydantic 2.5+ is a major version change that may introduce breaking changes. Please document any necessary migration steps and confirm compatibility testing has been performed.
  • Consider explicitly documenting the full range of supported Python versions in the PR description, including the minimum supported version.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@myxie myxie merged commit 0de3637 into master Nov 5, 2024
26 checks passed
@myxie myxie deleted the LIU-408 branch November 5, 2024 08:51
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.

3 participants