Skip to content

resampy test failures #15338

@hunterhogan

Description

@hunterhogan

At this fork/branch, I am attempting to create typeshed stubs for resampy, but I have some test failures that I don't know how to resolve.

Py 3.14

Environment Details

(.venv) C:\clones\typeshed>ver & py -V & git remote -v & git status

Microsoft Windows [Version 10.0.26200.7628]
Python 3.14.2
origin  https://github.com/hunterhogan/typeshed.git (fetch)
origin  https://github.com/hunterhogan/typeshed.git (push)
upstream        https://github.com/python/typeshed.git (fetch)
upstream        https://github.com/python/typeshed.git (push)
On branch main
Your branch is up to date with 'upstream/main'.

Test Details

(.venv) C:\clones\typeshed>py -m tests.runtests stubs/resampy

Running pre-commit...
trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
check yaml...........................................(no files to check)Skipped
check toml...............................................................Passed
check for merge conflicts................................................Passed
mixed line ending........................................................Passed
check for case conflicts.................................................Passed
Run ruff on stubs, tests and scripts.....................................Passed
Run ruff on the test cases...........................(no files to check)Skipped
black....................................................................Passed
flake8...................................................................Failed
- hook id: flake8
- exit code: 1

stubs/resampy/resampy/interpn.pyi:33:5: Y020 Quoted annotations should never be used in stubs
stubs/resampy/resampy/interpn.pyi:55:5: Y020 Quoted annotations should never be used in stubs

Check hooks apply to the repository..................(no files to check)Skipped

Running check_typeshed_structure.py...

Running Pyright (stricter configs) for Python 3.9...
11.4.2
Running: C:\Program Files\nodejs\npx.CMD pyright@1.1.408 stubs\resampy --pythonversion 3.9 -p pyrightconfig.stricter.json
c:\clones\typeshed\stubs\resampy\resampy\interpn.pyi
  c:\clones\typeshed\stubs\resampy\resampy\interpn.pyi:3:8 - error: Stub file not found for "numba" (reportMissingTypeStubs)
  c:\clones\typeshed\stubs\resampy\resampy\interpn.pyi:5:6 - error: Stub file not found for "numba" (reportMissingTypeStubs)
  c:\clones\typeshed\stubs\resampy\resampy\interpn.pyi:5:19 - error: Type of "guvectorize" is partially unknown
    Type of "guvectorize" is "(...) -> ((func: Unknown) -> (GUFunc | Unknown))" (reportUnknownVariableType)
3 errors, 0 warnings, 0 informations
Config contains unrecognized setting "$schema".


Running mypy for Python 3.9...
*** Testing Python 3.9 on win32
Testing third-party packages...
testing resampy (5 files)... failure (exit code 1)

stubs\resampy\resampy\interpn.pyi:3: error: Cannot find implementation or library stub for module named "numba"  [import-not-found]
stubs\resampy\resampy\interpn.pyi:3: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
stubs\resampy\resampy\interpn.pyi:4: error: Cannot find implementation or library stub for module named "numpy"  [import-not-found]
stubs\resampy\resampy\interpn.pyi:23: error: Untyped decorator makes function "resample_f_p" untyped  [untyped-decorator]
stubs\resampy\resampy\interpn.pyi:45: error: Untyped decorator makes function "resample_f_s" untyped  [untyped-decorator]
stubs\resampy\resampy\filters.pyi:4: error: Cannot find implementation or library stub for module named "numpy"  [import-not-found]
stubs\resampy\resampy\core.pyi:5: error: Cannot find implementation or library stub for module named "numpy"  [import-not-found]
stubs\resampy\resampy\core.pyi:5: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports


--- 1 package with errors, 5 files checked ---

Skipping stubtest since mypy failed.

Regression tests: No test_cases folder for 'resampy'!


--- TEST SUMMARY: One or more tests failed. See above for details. ---

pre-commit Failed
  Check the output of pre-commit for more details.
  This could mean that there's a lint failure on your code,
  but could also just mean that one of the pre-commit tools
  applied some autofixes. If the latter, you may want to check
  that the autofixes did sensible things.
Check structure: Success
Pyright: Failed
mypy: Failed
stubtest: Skipped
Pyright regression tests: Success
mypy regression test: Success

stubs\resampy\resampy\interpn.pyi:3: error: Cannot find implementation or library stub for module named "numba"  [import-not-found]
stubs\resampy\resampy\interpn.pyi:4: error: Cannot find implementation or library stub for module named "numpy"  [import-not-found]

But both packages are installed.

`pip list` Details

(.venv) C:\clones\typeshed>pip list
Package             Version
------------------- ---------------
aiohappyeyeballs    2.6.1
aiohttp             3.13.3
aiosignal           1.4.0
attrs               25.4.0
cfgv                3.5.0
distlib             0.4.0
filelock            3.20.3
frozenlist          1.8.0
grpcio              1.76.0
grpcio-tools        1.76.0
identify            2.6.16
idna                3.11
importlib_resources 6.5.2
libcst              1.8.6
librt               0.7.8
llvmlite            0.46.0
multidict           6.7.1
mypy                1.19.1
mypy_extensions     1.1.0
mypy-protobuf       4.0.0
nodeenv             1.10.0
numba               0.63.1
numpy               2.3.5
packaging           25.0
pathspec            1.0.4
pip                 25.3
platformdirs        4.5.1
pre_commit          4.5.1
propcache           0.4.1
protobuf            6.33.4
pyright             1.1.408
PyYAML              6.0.3
resampy             0.4.3
ruff                0.14.10
setuptools          80.10.2
stubdefaulter       0.1.0
termcolor           3.3.0
tomli               2.4.0
tomlkit             0.13.3
ts_utils            0.0.0
types-protobuf      6.32.1.20251210
typeshed_client     2.8.2
typing_extensions   4.15.0
uv                  0.9.22
virtualenv          20.36.1
yarl                1.22.0

I'm assuming the other failures are due to the unknown type information from numba and numpy.

Py 3.9

Since the errors are displayed after the line Running mypy for Python 3.9..., I tried running the tests directly in Python 3.9.

(.v309) C:\clones\typeshed>ver & py -V                             

Microsoft Windows [Version 10.0.26200.7628]
Python 3.9.13
Test Details

(.v309) C:\clones\typeshed>py -m tests.runtests stubs/resampy      

Running pre-commit...
[INFO] Installing environment for https://github.com/psf/black-pre-commit-mirror.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('C:\\Users\\hunte\\.cache\\pre-commit\\repobrd2h5y6\\py_env-python3.9\\Scripts\\python.EXE', '-mpip', 'install', '.')
return code: 1
stdout:
    Processing c:\users\hunte\.cache\pre-commit\repobrd2h5y6
      Installing build dependencies: started
      Installing build dependencies: finished with status 'done'
      Getting requirements to build wheel: started
      Getting requirements to build wheel: finished with status 'done'
      Preparing metadata (pyproject.toml): started
      Preparing metadata (pyproject.toml): finished with status 'done'
    INFO: pip is looking at multiple versions of black-pre-commit-mirror to determine which version is compatible with other requirements. This could take a while.    
stderr:
    ERROR: Ignored the following yanked versions: 21.11b0
    ERROR: Ignored the following versions that require a different python version: 25.12.0 Requires-Python >=3.10; 26.1.0 Requires-Python >=3.10; 26.1a1 Requires-Python >=3.10
    ERROR: Could not find a version that satisfies the requirement black==25.12.0 (from black-pre-commit-mirror) (from versions: 18.3a0, 18.3a1, 18.3a2, 18.3a3, 18.3a4, 18.4a0, 18.4a1, 18.4a2, 18.4a3, 18.4a4, 18.5b0, 18.5b1, 18.6b0, 18.6b1, 18.6b2, 18.6b3, 18.6b4, 18.9b0, 19.3b0, 19.10b0, 20.8b0, 20.8b1, 21.4b0, 21.4b1, 21.4b2, 21.5b0, 21.5b1, 21.5b2, 21.6b0, 21.7b0, 21.8b0, 21.9b0, 21.10b0, 21.11b1, 21.12b0, 22.1.0, 22.3.0, 22.6.0, 22.8.0, 22.10.0, 22.12.0, 23.1a1, 23.1.0, 23.3.0, 23.7.0, 23.9.0, 23.9.1, 23.10.0, 23.10.1, 23.11.0, 23.12.0, 23.12.1, 24.1a1, 24.1.0, 24.1.1, 24.2.0, 24.3.0, 24.4.0, 24.4.1, 24.4.2, 24.8.0, 24.10.0, 25.1.0, 25.9.0, 25.11.0)       
    ERROR: No matching distribution found for black==25.12.0
Check the log at C:\Users\hunte\.cache\pre-commit\pre-commit.log

Running check_typeshed_structure.py...

Running Pyright (stricter configs) for Python 3.9...
11.4.2
Running: C:\Program Files\nodejs\npx.CMD pyright@1.1.408 stubs\resampy --pythonversion 3.9 -p pyrightconfig.stricter.json
c:\clones\typeshed\stubs\resampy\resampy\interpn.pyi
  c:\clones\typeshed\stubs\resampy\resampy\interpn.pyi:3:8 - error: Stub file not found for "numba" (reportMissingTypeStubs)
  c:\clones\typeshed\stubs\resampy\resampy\interpn.pyi:5:6 - error: Stub file not found for "numba" (reportMissingTypeStubs)
  c:\clones\typeshed\stubs\resampy\resampy\interpn.pyi:5:19 - error: Type of "guvectorize" is partially unknown
    Type of "guvectorize" is "(...) -> ((func: Unknown) -> (GUFunc | Unknown))" (reportUnknownVariableType)
3 errors, 0 warnings, 0 informations
Config contains unrecognized setting "$schema".


Running mypy for Python 3.9...
*** Testing Python 3.9 on win32
Testing third-party packages...
testing resampy (5 files)... failure (exit code 1)

stubs\resampy\resampy\interpn.pyi:3: error: Cannot find implementation or library stub for module named "numba"  [import-not-found]
stubs\resampy\resampy\interpn.pyi:3: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
stubs\resampy\resampy\interpn.pyi:4: error: Cannot find implementation or library stub for module named "numpy"  [import-not-found]
stubs\resampy\resampy\interpn.pyi:23: error: Untyped decorator makes function "resample_f_p" untyped  [untyped-decorator]
stubs\resampy\resampy\interpn.pyi:45: error: Untyped decorator makes function "resample_f_s" untyped  [untyped-decorator]
stubs\resampy\resampy\filters.pyi:4: error: Cannot find implementation or library stub for module named "numpy"  [import-not-found]
stubs\resampy\resampy\core.pyi:5: error: Cannot find implementation or library stub for module named "numpy"  [import-not-found]
stubs\resampy\resampy\core.pyi:5: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports


--- 1 package with errors, 5 files checked ---

Skipping stubtest since mypy failed.

Regression tests: No test_cases folder for 'resampy'!


--- TEST SUMMARY: One or more tests failed. See above for details. ---

pre-commit Failed
  Check the output of pre-commit for more details.
  This could mean that there's a lint failure on your code,
  but could also just mean that one of the pre-commit tools
  applied some autofixes. If the latter, you may want to check
  that the autofixes did sensible things.
Check structure: Success
Pyright: Failed
mypy: Failed
stubtest: Skipped
Pyright regression tests: Success
mypy regression test: Success

The script cannot install black, but I doubt that is a real problem.

ERROR: No matching distribution found for black==25.12.0

But the test still says it can't find numba or numpy even though they are installed in the Python 3.9 environment.

stubs\resampy\resampy\interpn.pyi:3: error: Cannot find implementation or library stub for module named "numba"  [import-not-found]
stubs\resampy\resampy\interpn.pyi:4: error: Cannot find implementation or library stub for module named "numpy"  [import-not-found]
`pip list` Details

(.v309) C:\clones\typeshed>pip list
Package             Version
------------------- ---------------
aiohappyeyeballs    2.6.1
aiohttp             3.13.3
aiosignal           1.4.0
annotated-types     0.7.0
async-timeout       5.0.1
attrs               25.4.0
cfgv                3.4.0
distlib             0.4.0
filelock            3.19.1
frozenlist          1.8.0
grpcio              1.76.0
grpcio-tools        1.76.0
identify            2.6.15
idna                3.11
importlib_resources 6.5.2
libcst              1.8.6
librt               0.7.8
llvmlite            0.43.0
multidict           6.7.1
mypy                1.19.1
mypy_extensions     1.1.0
mypy-protobuf       4.0.0
nodeenv             1.10.0
numba               0.60.0
numpy               2.0.2
packaging           25.0
pathspec            1.0.4
pip                 25.3
platformdirs        4.4.0
pre_commit          4.3.0
propcache           0.4.1
protobuf            6.33.4
pydantic            2.12.5
pydantic_core       2.41.5
pyproject-toml      0.1.0
pyright             1.1.408
PyYAML              6.0.3
resampy             0.4.3
ruff                0.14.10
setuptools          80.10.2
stubdefaulter       0.1.0
termcolor           3.1.0
tomli               2.3.0
tomlkit             0.13.3
ts_utils            0.0.0
types-protobuf      6.32.1.20251210
typeshed_client     2.8.2
typing_extensions   4.15.0
typing-inspection   0.4.2
uv                  0.9.22
virtualenv          20.36.1
wheel               0.46.3
yarl                1.22.0
zipp                3.23.0

What next?

How do I cure these defects so I can make a pull request?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions