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

[BUG]: test01_check_stub_refs[p_ref5] failing on 2.2.0 release #754

Open
phiadaarr opened this issue Oct 6, 2024 · 0 comments
Open

[BUG]: test01_check_stub_refs[p_ref5] failing on 2.2.0 release #754

phiadaarr opened this issue Oct 6, 2024 · 0 comments

Comments

@phiadaarr
Copy link

Problem description

When I run the test of the 2.2.0 release of nanobind, I get a error in the stub check tests:

=================================== FAILURES ===================================
________________________ test01_check_stub_refs[p_ref5] ________________________

p_ref = PosixPath('/build/source/tests/test_ndarray_ext.pyi.ref')

    @skip_on_unsupported
    @pytest.mark.parametrize('p_ref', ref_paths)
    def test01_check_stub_refs(p_ref):
        """
        Check that generated stub files match reference input
        """
        p_in = p_ref.with_suffix('')
        with open(p_ref, 'r') as f:
            s_ref = f.read().split('\n')
        with open(p_in, 'r') as f:
            s_in = f.read().split('\n')
        s_in = remove_platform_dependent(s_in)
        s_ref = remove_platform_dependent(s_ref)

        diff = list(difflib.unified_diff(
            s_ref,
            s_in,
            fromfile=str(p_ref),
            tofile=str(p_in)
        ))
        if len(diff):
            for p in diff:
                print(p.rstrip(), file=sys.stderr)
            print(
                '\nWarning: generated stubs do not match their references. If you\n'
                'intentionally changed a test suite extension, it may be necessary\n'
                'to replace the .pyi.ref file with the generated .pyi file. But\n'
                'please double-check that the change makes sense.',
                file=sys.stderr
            )
>           assert False
E           assert False

tests/test_stubs.py:60: AssertionError
----------------------------- Captured stderr call -----------------------------
--- /build/source/tests/test_ndarray_ext.pyi.ref
+++ /build/source/tests/test_ndarray_ext.pyi
@@ -2,7 +2,7 @@

 import jaxlib.xla_extension
 from numpy.typing import ArrayLike
-import tensorflow.python.framework.ops
+import tensorflow


 class Cls:

Warning: generated stubs do not match their references. If you
intentionally changed a test suite extension, it may be necessary
to replace the .pyi.ref file with the generated .pyi file. But
please double-check that the change makes sense.
=========================== short test summary info ============================
FAILED tests/test_stubs.py::test01_check_stub_refs[p_ref5] - assert False

Do you have any idea what could be going wrong here?

Reproducible example code

git clone --depth 1 -b python3Packages.nanobind_2_2_0 https://github.com/phiadaarr/nixpkgs
cd nixpkgs
nix-build -A python3Packages.nanobind
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

No branches or pull requests

1 participant