Skip to content

Remove support for Python 3.8#112

Merged
hagenw merged 3 commits intomainfrom
remove-python-3.8
Dec 16, 2024
Merged

Remove support for Python 3.8#112
hagenw merged 3 commits intomainfrom
remove-python-3.8

Conversation

@hagenw
Copy link
Member

@hagenw hagenw commented Dec 16, 2024

Remove support for Python 3.8.

It also updates the code by stop using typing.

Summary by Sourcery

Remove support for Python 3.8 and update type annotations to use PEP 604 syntax. Update CI workflows to drop Python 3.8 and use Python 3.9, 3.10, and 3.11. Adjust project metadata to reflect the new minimum Python version requirement of 3.9.

Enhancements:

  • Update type annotations to use PEP 604 syntax for type hinting.

CI:

  • Update CI workflows to use Python 3.9, 3.10, and 3.11 instead of 3.8.

@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Dec 16, 2024

Reviewer's Guide by Sourcery

This PR removes Python 3.8 support by updating type hints to use newer Python syntax and modifying CI configuration files. The changes primarily involve updating type annotations to use the Python 3.9+ syntax for generics (e.g., dict[str, object] instead of Dict[str, Any]) and removing Python 3.8 from CI workflows and project metadata.

Updated class diagram for type annotations

classDiagram
    class OpenSmileException {
        int code
        str message
        OpenSmileException(int code, str message=None)
    }
    class Smile {
        str|FeatureSet feature_set
        str|FeatureLevel feature_level
        dict options
        int loglevel
        str logfile
        int sampling_rate
        int|Sequence~int~ channels
        bool mixdown
        bool resample
        audinterface.Segment segment
        bool keep_nat
        int|None num_workers
        bool multiprocessing
        bool verbose
        Smile(str|FeatureSet feature_set, str|FeatureLevel feature_level, dict options=None, int loglevel=2, str logfile=None, int sampling_rate=None, int|Sequence~int~ channels=0, bool mixdown=False, bool resample=False, audinterface.Segment segment=None, bool keep_nat=False, int|None num_workers=1, bool multiprocessing=False, bool verbose=False)
    }
    class FeatureSetResolver {
        str|FeatureSet decode(str value)
        str encode(str|FeatureSet value)
    }
    class FeatureLevelResolver {
        str|FeatureLevel decode(str value)
        str encode(str|FeatureLevel value)
    }
Loading

File-Level Changes

Change Details Files
Update type hints to use Python 3.9+ syntax
  • Replace typing.Dict, typing.List, typing.Union with their native syntax equivalents
  • Update type hints for dictionary and list parameters
  • Update type hints for optional parameters using
syntax
  • Update return type annotations to use simplified syntax
  • Remove Python 3.8 from CI workflows
    • Remove Python 3.8 from test matrix
    • Update default Python version to 3.10 in publish workflow
    • Update Python version to 3.10 in doc workflow
    .github/workflows/test.yml
    .github/workflows/publish.yml
    .github/workflows/doc.yml
    Update project metadata to remove Python 3.8 support
    • Remove Python 3.8 from Python version classifiers
    • Add requires-python >= 3.9 specification
    pyproject.toml

    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

    @codecov
    Copy link

    codecov bot commented Dec 16, 2024

    Codecov Report

    All modified and coverable lines are covered by tests ✅

    Project coverage is 100.0%. Comparing base (a4c5e96) to head (9b176d5).
    Report is 1 commits behind head on main.

    Additional details and impacted files
    Files with missing lines Coverage Δ
    opensmile/core/define.py 100.0% <100.0%> (ø)
    opensmile/core/lib.py 100.0% <100.0%> (ø)
    opensmile/core/smile.py 100.0% <100.0%> (ø)

    @hagenw hagenw marked this pull request as ready for review December 16, 2024 12:56
    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 @hagenw - I've reviewed your changes and they look great!

    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.

    @hagenw hagenw merged commit 9b0374e into main Dec 16, 2024
    @hagenw hagenw deleted the remove-python-3.8 branch December 16, 2024 12:57
    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