Skip to content
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

Building creates tests/ folder in site-packages #5

Open
fryfrog opened this issue Dec 23, 2024 · 4 comments
Open

Building creates tests/ folder in site-packages #5

fryfrog opened this issue Dec 23, 2024 · 4 comments

Comments

@fryfrog
Copy link

fryfrog commented Dec 23, 2024

Describe the bug
When building, a tests/ folder is created in site packages. This should not be! I'm trying to make an aur package for this and will just rm it in the mean time. Hopefully the details from the Arch wiki and the linked example issue are helpful!

fryfrog@apollo …/lib/python3.13/site-packages  on  master ❯ pwd
/home/fryfrog/aur/bzfs/pkg/bzfs/usr/lib/python3.13/site-packages
fryfrog@apollo …/lib/python3.13/site-packages  on  master ❯ ls
bzfs  bzfs-1.7.0.dist-info  tests

To Reproduce

python -m build --wheel --no-isolation
python -m installer --destdir="$pkgdir" dist/*.whl

Expected behavior
There should not end up a tests/ folder under site-packages/. :)

Additional context
https://wiki.archlinux.org/title/Python_package_guidelines#Test_directory_in_site-package

@whoschek
Copy link
Owner

Yeah, rm'ing the tests dir seems like a fine workaround.
The integration tests in that directory probably aren't useful for distro packaged components anyway.

@whoschek
Copy link
Owner

@fryfrog Maybe the best approach would be if I'd rename the "tests" dir to "bzfs_tests", like shown in this experimental branch here: https://github.com/whoschek/bzfs/tree/wip/renametests
This would retain the ability to run basic sanity tests for users to get confidence stuff works in their particular platform combination.
What do you think?

@fryfrog
Copy link
Author

fryfrog commented Dec 27, 2024

I think it just shouldn't be making a folder in site-packages at all, but beyond that I have no idea. And honestly, the details in the Arch wiki about it and the issue they link to were far from clear to me either! I am not good at Python packaging at all, I just kind of muddle through it as best I can! :)

@whoschek
Copy link
Owner

@fryfrog I figure, it's already making a "bzfs" folder in site-packages, so might as well add a "bzfs_tests" folder, as that's no too much of a difference, I guess...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants