Skip to content

Should utils_test.py be considered public API? #6806

@hendrikmakait

Description

@hendrikmakait

We currently expose a number of functions and fixtures in distributed.utils_test. While I would consider these implementation details of our tests, and not part of any stable user-facing API, other projects, including dask/dask rely on them for their test suites (https://github.com/dask/dask/blob/ac74939697c328bd6456aa9fad7d9520328db6e5/dask/tests/test_distributed.py#L11-L14, #5300, #6775, #6802 (review)). This creates friction between the stability requirements of downstream users and our ability to adjust the contents of utils_test to fit our internal testing needs. For example, we cannot easily move functionality around without breaking things for downstream users (#6802 (review)).

This leads me to several questions:
Should the contents of utils_test.py be considered part of the public API?

If so:

  • What guarantees are we willing to make around API stability?
    • How do we want to test/enforce those?
  • Which parts should be considered public API?
    • For example, should we only expose context managers/functions, but not fixtures?

If not:

  • How do we make this clear and discourage users from importing them?
  • How do we deal with projects that already import them?

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionDiscussing a topic with no specific actions yet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions