Skip to content

Commit 54dd47a

Browse files
authored
Merge pull request #118 from bmcfee/updates-2024
Minor updates to tests and packaging
2 parents cc6eed5 + 8b5b3cf commit 54dd47a

File tree

8 files changed

+28
-12
lines changed

8 files changed

+28
-12
lines changed

.github/workflows/ci-minimal.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
shell: bash -l {0}
3535
run: |
3636
mamba install typing_extensions!=4.2 pytest
37-
mamba install pip numpy==1.17 scipy==1.0 numba==0.53 importlib_resources
37+
mamba install pip numpy==1.17 scipy==1.0 numba==0.53
3838
3939
- name: Install
4040
shell: bash -l {0}

.github/workflows/ci.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
os: [ubuntu-latest]
22-
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
22+
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
2323
include:
2424
- os: windows-latest
25-
python-version: "3.10"
25+
python-version: "3.12"
2626
- os: macos-latest
27-
python-version: "3.10"
27+
python-version: "3.12"
2828

2929
steps:
3030
- uses: actions/checkout@v2
@@ -39,7 +39,7 @@ jobs:
3939
shell: bash -l {0}
4040
run: |
4141
mamba install typing_extensions!=4.2
42-
mamba install pip numpy scipy numba pytest pytest-cov pytest-doctestplus importlib_resources
42+
mamba install pip numpy scipy numba pytest pytest-cov pytest-doctestplus
4343
- name: Install
4444
shell: bash -l {0}
4545
run: |
@@ -50,8 +50,9 @@ jobs:
5050
python -m pytest tests
5151
python -m pytest --doctest-only resampy
5252
- name: Upload coverage to Codecov
53-
uses: codecov/codecov-action@v1
53+
uses: codecov/codecov-action@v3
5454
with:
55+
token: ${{ secrets.CODECOV_TOKEN }}
5556
files: ./coverage.xml
5657
directory: ./coverage/reports/
5758
flags: unittests

docs/changes.rst

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changes
22
-------
33

4+
v0.4.3
5+
~~~~~~
6+
2024-03-05
7+
8+
- `#117 <https://github.com/bmcree/resampy/pull/117>`_ Update to remove deprecated usage of pkg_resources.
9+
410
v0.4.2
511
~~~~~~
612
2022-09-13

resampy/filters.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,15 @@
4646
'''
4747

4848
import numpy as np
49-
import importlib_resources
5049
import sys
5150

51+
if sys.version_info < (3, 9):
52+
# Use the backport of importlib resources for old python
53+
import importlib_resources
54+
else:
55+
from importlib import resources as importlib_resources
56+
57+
5258
FILTER_FUNCTIONS = ['sinc_window']
5359
FILTER_CACHE = dict()
5460

resampy/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
"""Version info"""
44

55
short_version = '0.4'
6-
version = '0.4.2'
6+
version = '0.4.3'

setup.cfg

+5-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ classifiers =
3232
Programming Language :: Python :: 3.8
3333
Programming Language :: Python :: 3.9
3434
Programming Language :: Python :: 3.10
35+
Programming Language :: Python :: 3.11
36+
Programming Language :: Python :: 3.12
37+
3538

3639
[options]
3740
packages = find:
@@ -40,7 +43,7 @@ python_requires >= 3.6
4043
install_requires =
4144
numpy>=1.17
4245
numba>=0.53
43-
importlib_resources
46+
importlib_resources; python_version < "3.9"
4447

4548
[options.package_data]
4649
resampy = data/*
@@ -53,7 +56,7 @@ docs =
5356
tests =
5457
pytest < 8
5558
pytest-cov
56-
scipy>=1.0
59+
scipy>=1.1
5760

5861
design =
5962
optuna >= 2.10.0

tests/test_core.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def test_good_window():
141141
sr_orig = 100
142142
sr_new = 200
143143
x = np.random.randn(500)
144-
y = resampy.resample(x, sr_orig, sr_new, filter='sinc_window', window=scipy.signal.blackman)
144+
y = resampy.resample(x, sr_orig, sr_new, filter='sinc_window', window=scipy.signal.windows.blackman)
145145

146146
assert len(y) == 2 * len(x)
147147

tests/test_filters.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
@pytest.mark.parametrize('filt', ['sinc_window', resampy.filters.sinc_window])
12-
@pytest.mark.parametrize('window', [None, scipy.signal.hann])
12+
@pytest.mark.parametrize('window', [None, scipy.signal.windows.hann])
1313
@pytest.mark.parametrize('num_zeros', [None, 13])
1414
@pytest.mark.parametrize('precision', [None, 9])
1515
@pytest.mark.parametrize('rolloff', [None, 0.925])

0 commit comments

Comments
 (0)