Skip to content

BUG: downstream testing breaks with minimal requirement on toolz #12162

@neutrinoceros

Description

@neutrinoceros

Describe the issue:

Using pytest.importorskip("dask.array") in an env that adheres to dask's current self-declared minimal requirements triggers an AttributeError from toolz 0.10.0

Minimal Complete Verifiable Example:

reproduced with toolz==0.10. pytest and numpy are also needed to reproduce the error

import pytest

def test_dask():
    pytest.importorskip("dask.array")
Detailed pytest output
======================================== test session starts =========================================
platform darwin -- Python 3.11.13, pytest-9.0.1, pluggy-1.6.0
rootdir: /Users/clm/test
collected 1 item

t.py F                                                                                         [100%]

============================================== FAILURES ==============================================
_____________________________________________ test_dask ______________________________________________

    def test_dask():
>       pytest.importorskip("dask.array")

t.py:5:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.venv/lib/python3.11/site-packages/dask/array/__init__.py:34: in <module>
    from dask.array import backends, fft, lib, linalg, ma, overlap, random
.venv/lib/python3.11/site-packages/dask/array/backends.py:8: in <module>
    from dask.array.core import Array
.venv/lib/python3.11/site-packages/dask/array/core.py:25: in <module>
    from tlz.curried import pluck
<frozen importlib._bootstrap>:1176: in _find_and_load
    ???
<frozen importlib._bootstrap>:1147: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:690: in _load_unlocked
    ???
.venv/lib/python3.11/site-packages/tlz/_build_tlz.py:82: in exec_module
    submodule = import_module(module_name)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^
../.local/share/uv/python/cpython-3.11.13-macos-aarch64-none/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1204: in _gcd_import
    ???
<frozen importlib._bootstrap>:1176: in _find_and_load
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

name = 'tlz.curried.operator', import_ = <function _gcd_import at 0x10418fd80>

>   ???
E   AttributeError: 'TlzSpec' object has no attribute '_uninitialized_submodules'

<frozen importlib._bootstrap>:1145: AttributeError
====================================== short test summary info =======================================
FAILED t.py::test_dask - AttributeError: 'TlzSpec' object has no attribute '_uninitialized_submodules'
========================================= 1 failed in 0.15s ==========================================

Anything else we need to know?:

The full context for this is that I'm trying to assess a truly minimal and reproducible testing environment for astropy + all of its optional and transitive dependencies.
astropy/astropy#18782

Environment:

  • Dask version: 2024.8.0
  • Python version: 3.11
  • Operating System: Linux/macos
  • Install method (conda, pip, source): pip

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageNeeds a response from a contributor

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions