-
Notifications
You must be signed in to change notification settings - Fork 19
Description
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
- pip install pytest-xprocess==1.0.2
- python -c "import importlib.util; print(importlib.util.find_spec('pytest_xprocess'))" # returns None
- 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.pythat re-exports fromxprocess.pytest_xprocess, or - Document the expected import path and update downstream projects, or
- Add packaging metadata so
pytest_xprocessis 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_xprocessdirectly and fails during pytest plugin loading.
Thanks — happy to help test any packaging change or provide additional reproduction details.