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

Remove support for Python 3.8 #161

Merged
merged 1 commit into from
Jan 3, 2025
Merged

Remove support for Python 3.8 #161

merged 1 commit into from
Jan 3, 2025

Conversation

hagenw
Copy link
Member

@hagenw hagenw commented Jan 3, 2025

Removes support for Python 3.8 and updates syntax of code to stop using typing.

Summary by Sourcery

Remove support for Python 3.8.

Build:

  • Remove Python 3.8 from the CI build matrix.

Chores:

  • Update the required Python version to 3.9 in pyproject.toml.

Copy link

sourcery-ai bot commented Jan 3, 2025

Reviewer's Guide by Sourcery

This pull request removes support for Python 3.8 and updates the code to use the new typing syntax introduced in Python 3.9. This includes replacing instances of typing.Union with the pipe operator (|) and updating type annotations accordingly.

Class diagram showing updated type annotations in core modules

classDiagram
    class io {
        +convert_to_wav(infile: str, outfile: str, offset: float|int|str|np.timedelta64, duration: float|int|str|np.timedelta64, bit_depth: int, normalize: bool, overwrite: bool) void
        +read(file: str, duration: float|int|str|np.timedelta64, offset: float|int|str|np.timedelta64, always_2d: bool, dtype: str) tuple[np.array, int]
    }
    class utils {
        +duration_in_seconds(duration: float|int|str|np.timedelta64, sampling_rate: float|int) np.floating
    }
    class info {
        +bit_depth(file: str) int|None
    }
    note for io "Updated type hints to use | operator"
    note for utils "Updated type hints to use | operator"
    note for info "Updated Optional to use | None syntax"
Loading

File-Level Changes

Change Details Files
Removed support for Python 3.8.
  • Removed Python 3.8 from the test matrix.
  • Removed Python 3.8 from the list of supported Python versions.
  • Updated requires-python to >=3.9.
.github/workflows/test.yml
pyproject.toml
Updated type annotations to use the new union operator.
  • Replaced typing.Union with the pipe operator (`
) for type annotations.</li><li>Updated return type annotations to use the new tuple syntax introduced in Python 3.9 (e.g., tuple[np.array, int]instead oftyping.Tuple[np.array, int]`).

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

@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 - here's some feedback:

Overall Comments:

  • The PR description mentions removing typing but the typing imports are still present in the files. Consider either updating the description or removing the unused imports.
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.

audiofile/core/io.py Show resolved Hide resolved
Copy link

codecov bot commented Jan 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.0%. Comparing base (c1c1291) to head (9ab6473).
Report is 2 commits behind head on main.

Additional details and impacted files
Files with missing lines Coverage Δ
audiofile/core/info.py 100.0% <100.0%> (ø)
audiofile/core/io.py 100.0% <100.0%> (ø)
audiofile/core/utils.py 100.0% <100.0%> (ø)

@hagenw hagenw merged commit bec61fa into main Jan 3, 2025
34 checks passed
@hagenw hagenw deleted the remove-python-3.8 branch January 3, 2025 08:56
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