jaraco / pip-run

pip-run - dynamic dependency loader for Python
MIT License
136 stars 19 forks source link

12.6.0 installs `/usr/lib/python*/site-packages/tests` #98

Closed mgorny closed 9 months ago

mgorny commented 9 months ago

After the turnaround from 3278b436995d9318c46c2037ad88f67503b2af59 and e18699537ad5536277884efa78fa7a485e78fef3, the package started installing tests straight into site-packages.

mtelka commented 9 months ago

Here I also see docs directly in the site-packages.

bswck commented 9 months ago

Interesting.

The newly merged jaraco/skeleton@63535c6 introduced reliance on the setuptools' automatic package discovery that was throttled because of the local setting py_modules = pip-run (according to https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#automatic-discovery, section Important, at least one of settings packages and py_modules disables automatic discovery). As a follow-up to https://github.com/jaraco/pip-run/actions/runs/7822456163/job/21341535125, 66e3ea2 was made. However, as you can see in the job logs for that commit (https://github.com/jaraco/pip-run/actions/runs/7833986829/job/21376230639), autodoc was unable to resolve modules in the wheel produced with the new setup.cfg, hence e186995 was done.

What I suspect to be the cause is the discrepancy: the excluded directories list was removed because of the newly introduced reliance on the automatic package discovery in jaraco/skeleton@63535c6, but that reliance seems to have never been enabled in this project. I am not completely sure I understand the full cause of the issue correctly otherwise, but removing py_modules setting from setup.cfg and reverting e186995 seemed to have fixed the issue (tox -e docs succeeded) without erroneously adding tests/ and docs/ to the wheel.

I can't tell what the effects of removing the setting would be; the directory tree in the wheel after my changes, i.e. pip-run/ and pip-run*.dist-info/, seems to be correct at all.

jaraco commented 9 months ago

removing py_modules setting from setup.cfg

I'm pretting sure removing py_modules would break py -m pip-run.

Probably the docs and tests exclusions need to be re-added to every project until another build system can be adopted that can more readily handle more than the simplest cases with default exclusions.

mtelka commented 9 months ago

It looks like pip-run is not the only project with similar issue: https://github.com/pypa/pipenv/issues/5937

jaraco commented 9 months ago

I suspect I made the same mistake with setuptools itself.

jaraco commented 9 months ago

Fix released in v12.6.1.