Find Linux package dependencies
Numerous Python packages use PyTest extensively.
Upon apt install a package that depends on python-astropy, python-pytest is also installed.
The system version of a package is typically several minor versions behind for stable Linux distros like Ubuntu.
To find which specific package is responsible for a package being installed, use a command like:
apt-cache rdepends --installed python-pytestwhich reveals that
python-py
python-astropy
are requiring this old pytest version.