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 #73

Merged
merged 4 commits into from
Oct 23, 2024
Merged

Remove support for Python 3.8 #73

merged 4 commits into from
Oct 23, 2024

Conversation

hagenw
Copy link
Member

@hagenw hagenw commented Oct 22, 2024

Removes support for Python 3.8, which has reached its end-of-life.

As with Python 3.9 we can also use list[str] for type hinting instead of typing.List[str], I also removed the typing module and replaced it with other code, including the type hinting union syntax introduced in Python 3.10, which is now also shown in the compiled documentation and makes it easier to read:

image

Summary by Sourcery

Remove support for Python 3.8 by updating type hint syntax to use PEP 604 style and adjusting CI configuration to exclude Python 3.8.

CI:

  • Update CI configuration to exclude Python 3.8 from the testing matrix.

Chores:

  • Remove support for Python 3.8 from the codebase.

Copy link

sourcery-ai bot commented Oct 22, 2024

Reviewer's Guide by Sourcery

This pull request removes support for Python 3.8, which has reached its end-of-life. The changes primarily involve updating type hints and removing Python 3.8 from the test matrix.

Architecture diagram for updated test matrix in CI workflow

graph TD;
    A[CI Workflow] --> B[Matrix Configuration];
    B --> C[OS: ubuntu-latest, windows-latest, macos-latest];
    B --> D[Python Versions: 3.9, 3.10, 3.11, 3.12];
Loading

Updated class diagram for type hints in audplot/core/api.py

classDiagram
    class API {
        +cepstrum()
        +confusion_matrix(truth: Sequence | pd.Series, prediction: Sequence | pd.Series, labels: Sequence, label_aliases: dict, percentage: bool, show_both: bool, ax: matplotlib.axes.Axes)
        +combine_string(x, y)
        +detection_error_tradeoff(x: Sequence | pd.Series, y: Sequence | pd.Series, error_rates: bool, xlim: Sequence, ylim: Sequence, label: str, ax: matplotlib.axes.Axes) : Callable
        +distribution(truth: Sequence | pd.Series, prediction: Sequence | pd.Series, ax: matplotlib.axes.Axes)
        +human_format(number: int | float) : str
        +scatter(truth: Sequence | pd.Series, prediction: Sequence | pd.Series, fit: bool, order: int, ax: matplotlib.axes.Axes)
        +series(truth: Sequence | pd.Series, prediction: Sequence | pd.Series, ax: matplotlib.axes.Axes)
        +waveform(x: np.ndarray, text: str, color: str | Sequence[float], background: str | Sequence[float], linewidth: float, ylim: Sequence[float], ax: matplotlib.axes.Axes)
    }
Loading

File-Level Changes

Change Details Files
Update type hints to use more modern Python syntax
  • Replace typing.Union with the `
operator for union types</li><li>Replacetyping.SequencewithSequence</li><li>Replace typing.Dictwithdict</li><li>Replace typing.CallablewithCallable`
Remove Python 3.8 from the test matrix in GitHub Actions workflow
  • Update the python-version matrix to start from '3.9' instead of '3.8'
.github/workflows/test.yml

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:

  • There's a small typo in the waveform function. The type hint for the background parameter should be str | Sequence[float] instead of str, | Sequence[float]. Please remove the extra comma.
Here's what I looked at during the review
  • 🟡 General issues: 1 issue found
  • 🟢 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.

audplot/core/api.py Outdated Show resolved Hide resolved
audplot/core/api.py Show resolved Hide resolved
Copy link

codecov bot commented Oct 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.0%. Comparing base (aefafcd) to head (fd93e79).
Report is 1 commits behind head on main.

Additional details and impacted files
Files with missing lines Coverage Δ
audplot/core/api.py 100.0% <100.0%> (ø)

Copy link
Member

@ChristianGeng ChristianGeng left a comment

Choose a reason for hiding this comment

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

The bot has done a good job in finding the few clerical errors left.
It feels safe to approve.

@hagenw hagenw merged commit 7865ee6 into main Oct 23, 2024
16 checks passed
@hagenw hagenw deleted the remove-python-3.8 branch October 23, 2024 09:42
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.

2 participants