-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] pkg_resources/tests/data/my-test-package-source/setup.py is installed via wheel #2709
Comments
Wait, this is sitting here since 2021? Why am I suddenly seeing
Apart from that the tests shouldn't be present there, why is there some random package? Is it this? Because that's the first thing you'd find if you went looking for why the hell there's a package called /edit: apparently it's not the one from pypi. Can we not ship this? It's confusing my license scanner. |
Hi @hroncok, in the current state of the repository this issue is related to #3260 and the sister issue #3340 (there is a mutual deadlock between these 2 issues). But including them in the wheel seems to be a deliberate decision from #4479. I believe that @jaraco have carefully considered the existing limitations and decided that the best approach would be to just include the files in the wheel anyway (see comments in #4479). |
Hi @black-snow these are test fixtures, intentionally shipped with the rest of the code. Since they are nested under setuptools and maintained/distributed as the same source code, they follow the same license as the rest setuptools. I believe this is a false positive/limitation of your license scanner. Anyway you can workaround that? |
Thanks for the links! Whew, scrolled through the linked threads and I gotta say it's too much to ingest. From my point of view tests / test data should not be shipped with the wheel, arguably, and I didn't really see why it does. Apparently this is a false positive but arguably just accidentially so. It kinda makes sense to me to scan recursively down to the bottom. For my specific case it would probably suffice to add license information to |
To be sure, the long-term strategy is to eliminate reliance on pkg_resources, remove it from this package, and then move setuptools' own tests into |
Thanks for caring! @jaraco @abravalheri Would it be an option to copypasta the license into the test package as well in the meantim? I really haven't looked at what's actually happening there yet. |
I'd rather not add artifacts to the source code that this project doesn't care about, as it could get removed incidentally and also could linger long after it's needed. It would be tricky to add a LICENSE that's only needed for black-snow's build system, especially if that's the only one that's affected (by the lack of a license). What do you think about abravalheri's proposition?
|
Another option I'd prefer instead of adding a license would be to define this fixture in code and build it dynamically at runtime rather than store it as source in the repo/sdist. |
Anyone using Trivy should be affected. I like the runtime generation idea. |
Before we go down that route, I'd hope that Trivy could be updated or configured to avoid this false positive. |
Actually, I'm not sure we can call this a false positive from Trivy's stance. It walks like a package, it quacks like a package, it lacks a license. How should Trivy know that this is only a test and not actually in use? ('cept from having an explicit exception for us ... which would be rather shitty) There's no filtering I'd know of so far. I could explicitly skip the test package, I guess. But now I need to copypasta this into each and every Python project and keep it in there forever :/ |
This affects Artifactory's X-Ray as well which is used by many large companies, please add a licence declaration for the my-test-package. @black-snow I am happy to write a PR for this, does your scanner just check for the info in PKG-INFO?
License just needs changing to MIT and it should appease the license scanners. (yes you can add exceptions but it's a pain in the butt and has to be done on every update... at larger companies this can take a while to go through all the levels of bureaucracy) |
setuptools version
57.0.0 to 57.4.0
Python version
Any version
OS
Any OS
Additional environment information
No response
Description
The
pkg_resources/tests/data/my-test-package-source/setup.py
file is present insetuptools-57.0.0-py3-none-any.whl
and is installed together with setuptools. I believe this might be related to #2688Expected behavior
The
pkg_resources/tests
andsetuptools/tests
directories are not expected to be present in setuptools wheels and installation.How to Reproduce
Output
Code of Conduct
The text was updated successfully, but these errors were encountered: