Skip to content

Packaging: distribution exposes xprocess but not top-level pytest_xprocess, causing downstream import errors #163

@jimmysmith369

Description

@jimmysmith369

Description
When installed, pytest-xprocess provides its implementation under the package xprocess (e.g., xprocess/pytest_xprocess.py) and top_level.txt lists "xprocess". Some downstream projects import pytest_xprocess directly (for example: from pytest_xprocess import getrootdir) and get ModuleNotFoundError at pytest plugin load time.

Reproduction

  1. pip install pytest-xprocess==1.0.2
  2. python -c "import importlib.util; print(importlib.util.find_spec('pytest_xprocess'))" # returns None
  3. Check installed files: the distribution contains xprocess/pytest_xprocess.py and top_level.txt contains "xprocess".

Observed behavior
Importing pytest_xprocess fails even though the plugin implementation exists at xprocess.pytest_xprocess. This forces downstream consumers to add a shim (pytest_xprocess.py) in site-packages or the repository root to work around the packaging layout.

Suggested fixes

  • Provide a top-level module pytest_xprocess.py that re-exports from xprocess.pytest_xprocess, or
  • Document the expected import path and update downstream projects, or
  • Add packaging metadata so pytest_xprocess is importable as a top-level module.

Context / files of interest

  • top_level.txt and entry_points.txt in the wheel/distribution (entry_points maps the pytest plugin to xprocess.pytest_xprocess).
  • Example downstream project: AnchorPy imports pytest_xprocess directly and fails during pytest plugin loading.

Thanks — happy to help test any packaging change or provide additional reproduction details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions