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

[2024.10] annlib_adaptbx tests use a removed method libtbx.test_utils.pytest #1028

Open
picca opened this issue Nov 19, 2024 · 3 comments
Open

Comments

@picca
Copy link

picca commented Nov 19, 2024

With the new version of cctbx I have this failure with annlib_adaptbx tests

during the CI test on Debian

autopkgtest [12:38:55]: test cctbx: [-----------------------
Testing cctbx with python3.13:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/libtbx/utils.py", line 1613, in __init__
    try: module = __import__(module_path)
                  ~~~~~~~~~~^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/annlib_adaptbx/run_tests.py", line 3, in <module>
    from libtbx.test_utils.pytest import discover
ModuleNotFoundError: No module named 'libtbx.test_utils.pytest'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/libtbx/command_line/run_tests_parallel.py", line 213, in <module>
    if (run(sys.argv[1:]) > 0):
	~~~^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/libtbx/command_line/run_tests_parallel.py", line 99, in run
    module_tests = libtbx.test_utils.parallel.get_module_tests(module_name,
	slow_tests = params.slow_tests,
	python_keyword_text=python_keyword_text,
        skip_missing = params.skip_missing)
  File "/usr/lib/python3/dist-packages/libtbx/test_utils/parallel.py", line 71, in get_module_tests
    tst_list = get_test_list(module_name, valgrind=valgrind,
       python_keyword_text=python_keyword_text, skip_missing = skip_missing)
  File "/usr/lib/python3/dist-packages/libtbx/test_utils/parallel.py", line 46, in get_test_list
    tst_list = list(import_python_object(
                    ~~~~~~~~~~~~~~~~~~~~^
      import_path="%s.run_tests.%s" % (module_name, test_type),
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      error_prefix="",
      ^^^^^^^^^^^^^^^^
      target_must_be="",
      ^^^^^^^^^^^^^^^^^^
      where_str="").object)
      ^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/libtbx/utils.py", line 1615, in __init__
    raise ImportError("%sno module %s%s or possibly import errors in "
    "module %s" % (
      error_prefix, module_path, where_str, module_path))
ImportError: no module annlib_adaptbx.run_tests or possibly import errors in module annlib_adaptbx.run_tests

The script used to run the test is this one

#!/bin/sh

set -efu
pythons=$(py3versions -s 2>/dev/null)
for py in $pythons; do
    echo "Testing cctbx with $py:"
    mkdir -p "$AUTOPKGTEST_TMP/$py"
    cd "$AUTOPKGTEST_TMP/$py"
    $py /usr/lib/python3/dist-packages/libtbx/command_line/run_tests_parallel.py \
        module=annlib_adaptbx module=boost_adaptbx module=cctbx module=cma_es \
        module=fable module=gltbx module=iotbx module=libtbx module=scitbx \
        module=smtbx module=rstbx module=spotfinder \
        nproc=$(nproc) \
        verbosity=2
done

Cheers

Fred

@bkpoon
Copy link
Member

bkpoon commented Nov 19, 2024

That's odd, that line should be commented out in therun_tests.py file in annlib_adaptbx.

# from libtbx.test_utils.pytest import discover

https://github.com/cctbx/annlib_adaptbx/blob/master/run_tests.py#L3

Can you check if you have that line commented out? If it is commented out, can you try deleting that line and seeing if the tests pass? If so, we'll just delete it.

We are running Python 3.13 in our CI and the annlib_adaptbx tests have been passing.

@picca
Copy link
Author

picca commented Nov 20, 2024 via email

@bkpoon
Copy link
Member

bkpoon commented Nov 20, 2024

No worries, the code in the source tarballs are tracked with this repository (https://github.com/cctbx/cctbx). The modules directory has git submodules for each module. Usually, the commit is whatever is the latest except for modules where I pick a specific version.

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

2 participants