-
Notifications
You must be signed in to change notification settings - Fork 110
Description
This package still uses the aifc module that is deprecated since Python 3.11, and was removed in Python 3.13.
As a result, the test suite fails with 3.13.0b2:
$ tox -e py313
py313: install_deps> python -I -m pip install pytest
.pkg: _optional_hooks> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True flit_core.buildapi
.pkg: get_requires_for_build_sdist> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True flit_core.buildapi
.pkg: build_sdist> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True flit_core.buildapi
py313: install_package> python -I -m pip install --force-reinstall --no-deps /tmp/audioread/.tox/.tmp/package/2/audioread-3.0.2.tar.gz
py313: commands[0]> pytest
========================================================= test session starts =========================================================
platform linux -- Python 3.13.0b2, pytest-8.2.2, pluggy-1.5.0
cachedir: .tox/py313/.pytest_cache
rootdir: /tmp/audioread
configfile: pyproject.toml
collected 4 items
test/test_audioread.py FFFF [100%]
============================================================== FAILURES ===============================================================
__________________________________________________ test_audioread_early_exit[test-1] __________________________________________________
audiofile = <conftest.AudiofileSpec object at 0x7efcb006cad0>
def test_audioread_early_exit(audiofile):
"""Abort the read before it is completed.
This test guards against regressions such as
https://github.com/beetbox/audioread/pull/78
"""
> with audioread.audio_open(audiofile.path) as a:
test/test_audioread.py:29:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py313/lib/python3.13/site-packages/audioread/__init__.py:123: in audio_open
backends = available_backends()
.tox/py313/lib/python3.13/site-packages/audioread/__init__.py:80: in available_backends
from . import rawread
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
# This file is part of audioread.
# Copyright 2011, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
"""Uses standard-library modules to read AIFF, AIFF-C, and WAV files."""
> import aifc
E ModuleNotFoundError: No module named 'aifc'
.tox/py313/lib/python3.13/site-packages/audioread/rawread.py:16: ModuleNotFoundError
__________________________________________________ test_audioread_early_exit[test-2] __________________________________________________
audiofile = <conftest.AudiofileSpec object at 0x7efcb001bc50>
def test_audioread_early_exit(audiofile):
"""Abort the read before it is completed.
This test guards against regressions such as
https://github.com/beetbox/audioread/pull/78
"""
> with audioread.audio_open(audiofile.path) as a:
test/test_audioread.py:29:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py313/lib/python3.13/site-packages/audioread/__init__.py:123: in audio_open
backends = available_backends()
.tox/py313/lib/python3.13/site-packages/audioread/__init__.py:80: in available_backends
from . import rawread
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
# This file is part of audioread.
# Copyright 2011, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
"""Uses standard-library modules to read AIFF, AIFF-C, and WAV files."""
> import aifc
E ModuleNotFoundError: No module named 'aifc'
.tox/py313/lib/python3.13/site-packages/audioread/rawread.py:16: ModuleNotFoundError
_____________________________________________________ test_audioread_full[test-1] _____________________________________________________
audiofile = <conftest.AudiofileSpec object at 0x7efcafd8c2d0>
def test_audioread_full(audiofile):
"""Read the audio data from the file."""
> with audioread.audio_open(audiofile.path) as a:
test/test_audioread.py:38:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py313/lib/python3.13/site-packages/audioread/__init__.py:123: in audio_open
backends = available_backends()
.tox/py313/lib/python3.13/site-packages/audioread/__init__.py:80: in available_backends
from . import rawread
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
# This file is part of audioread.
# Copyright 2011, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
"""Uses standard-library modules to read AIFF, AIFF-C, and WAV files."""
> import aifc
E ModuleNotFoundError: No module named 'aifc'
.tox/py313/lib/python3.13/site-packages/audioread/rawread.py:16: ModuleNotFoundError
_____________________________________________________ test_audioread_full[test-2] _____________________________________________________
audiofile = <conftest.AudiofileSpec object at 0x7efcafff7950>
def test_audioread_full(audiofile):
"""Read the audio data from the file."""
> with audioread.audio_open(audiofile.path) as a:
test/test_audioread.py:38:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.tox/py313/lib/python3.13/site-packages/audioread/__init__.py:123: in audio_open
backends = available_backends()
.tox/py313/lib/python3.13/site-packages/audioread/__init__.py:80: in available_backends
from . import rawread
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
# This file is part of audioread.
# Copyright 2011, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
"""Uses standard-library modules to read AIFF, AIFF-C, and WAV files."""
> import aifc
E ModuleNotFoundError: No module named 'aifc'
.tox/py313/lib/python3.13/site-packages/audioread/rawread.py:16: ModuleNotFoundError
======================================================= short test summary info =======================================================
FAILED test/test_audioread.py::test_audioread_early_exit[test-1] - ModuleNotFoundError: No module named 'aifc'
FAILED test/test_audioread.py::test_audioread_early_exit[test-2] - ModuleNotFoundError: No module named 'aifc'
FAILED test/test_audioread.py::test_audioread_full[test-1] - ModuleNotFoundError: No module named 'aifc'
FAILED test/test_audioread.py::test_audioread_full[test-2] - ModuleNotFoundError: No module named 'aifc'
========================================================== 4 failed in 0.08s ==========================================================
py313: exit 1 (0.38 seconds) /tmp/audioread> pytest pid=97746
.pkg: _exit> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True flit_core.buildapi
py313: FAIL code 1 (5.46=setup[5.08]+cmd[0.38] seconds)
evaluation failed :( (5.57 seconds)
lucas42, ISSOtm, benshep, Margen67, g2p and 1 more
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
Downgrade to python 3.12
lucas42 commentedon Oct 14, 2024
It's worth mentioning that the
sunau
module is also deprecated and being removed at the same time.(There was discussion about
wave
, but looks like they'd decided to keep it in python core)There's an attempt to make the deprecated libraries available as pip dependencies: https://github.com/youknowone/python-deadlib However, it seems there's currently a couple of issues with that repository which means it won't work with 3.13 yet.
lucas42 commentedon Oct 14, 2024
I've submitted a pull request to the
python-deadlib
library to try to get itsaifc
fork from the python core working on python 3.13: youknowone/python-deadlib#9Another potential approach would be to handle the
ModuleNotFoundError
more gracefully here. That would reduce the range of file types supported on python3.13, but is still better than a hard error, even when aifc support isn't needed!Manually install aifc and sunau libraries from python-deadlib github …
lucas42 commentedon Oct 30, 2024
The python-deadlib modules have now been fixed up and can be used to replace the missing modules from python core.
So a workaround to this issue is
pip install standard-aifc standard-sunau
Add standard-aifc and standard-sunau as dependencies for python 3.13 …
montvid commentedon Dec 7, 2024
The library does not build on python 3.12 too Anjok07/ultimatevocalremovergui#1578 (comment)
lucas42 commentedon Dec 8, 2024
@montvid I don't think your error is related to this issue.
Looks like that the imp issue might have been fixed in 3.0.1 (see #136 )
I'd guess ultimatevocalremovergui just needs to update its dependencies to the latest release.
ISSOtm commentedon Jan 3, 2025
I wonder if using https://github.com/scientific-python/lazy-loader could help? Then the modules would only be loaded (and thus fail to be found) on demand.
lucas42 commentedon Jan 3, 2025
@ISSOtm That approach would mean some uses of audioread would work in python 3.13, but others would error. Whilst it's tempting (and would certainly solve my personal use of it), I think it'd cause confusing results to people unfamiliar with the internal implementation. The question of "is this library supported in python 3.13?" would need an answer of "it depends", followed by details of the nuance.
Given the effort needed to introduce lazy-loader, it seems just as simple to fully support python 3.13, and in doing so be much clearer to users of the library.
15 remaining items