Skip to content

Commit

Permalink
Remove support for Python 3.8 (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
hagenw authored Jan 3, 2025
1 parent c1c1291 commit bec61fa
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
strategy:
matrix:
os: [ ubuntu-latest, macOS-latest, windows-latest ]
python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13' ]
python-version: [ '3.9', '3.10', '3.11', '3.12', '3.13' ]
sox: [ sox, no-sox ] # sox binary present or not

steps:
Expand Down
5 changes: 3 additions & 2 deletions audiofile/core/info.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
"""Read, write, and get information about audio files."""

from __future__ import annotations

import os
import subprocess
import tempfile
import typing

import soundfile

Expand All @@ -17,7 +18,7 @@
from audiofile.core.utils import run


def bit_depth(file: str) -> typing.Optional[int]:
def bit_depth(file: str) -> int | None:
r"""Bit depth of audio file.
For lossy audio files,
Expand Down
13 changes: 7 additions & 6 deletions audiofile/core/io.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import os
import tempfile
import typing

import numpy as np
import soundfile
Expand All @@ -18,8 +19,8 @@
def convert_to_wav(
infile: str,
outfile: str = None,
offset: typing.Union[float, int, str, np.timedelta64] = None,
duration: typing.Union[float, int, str, np.timedelta64] = None,
offset: float | int | str | np.timedelta64 = None,
duration: float | int | str | np.timedelta64 = None,
bit_depth: int = 16,
normalize: bool = False,
overwrite: bool = False,
Expand Down Expand Up @@ -122,12 +123,12 @@ def convert_to_wav(

def read(
file: str,
duration: typing.Union[float, int, str, np.timedelta64] = None,
offset: typing.Union[float, int, str, np.timedelta64] = None,
duration: float | int | str | np.timedelta64 = None,
offset: float | int | str | np.timedelta64 = None,
always_2d: bool = False,
dtype: str = "float32",
**kwargs,
) -> typing.Tuple[np.array, int]:
) -> tuple[np.array, int]:
"""Read audio file.
It uses :func:`soundfile.read` for WAV, FLAC, MP3, and OGG files.
Expand Down
7 changes: 4 additions & 3 deletions audiofile/core/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import os
import subprocess
import typing

import numpy as np

Expand Down Expand Up @@ -57,8 +58,8 @@ def broken_file_error(file: str) -> Exception:


def duration_in_seconds(
duration: typing.Union[float, int, str, np.timedelta64],
sampling_rate: typing.Union[float, int],
duration: float | int | str | np.timedelta64,
sampling_rate: float | int,
) -> np.floating:
r"""Duration in seconds.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ classifiers = [
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
Expand All @@ -31,6 +30,7 @@ classifiers = [
'Topic :: Scientific/Engineering',
'Topic :: Multimedia :: Sound/Audio',
]
requires-python = '>=3.9'
dependencies = [
'audeer',
'audmath >=1.3.0',
Expand Down

0 comments on commit bec61fa

Please sign in to comment.