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

Exclude tests folder from published package #107

Merged
merged 2 commits into from
Nov 6, 2020

Conversation

thibaudcolas
Copy link
Member

I have noticed while publishing v0.6.0 that the test site’s test-static and test-media folders aren’t ignored as part of building the package’s distribution artifacts (python setup.py sdist bdist_wheel). This makes it a bit too easy to publish tens of MBs of test audio and video files in the package source.

Those folders need to be ignored, and I think we might as well not publish the whole of the tests folder.

Copy link
Collaborator

@Scotchester Scotchester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change looks good, but will this work for the wheel, as well? I'm not super familiar with MANIFEST.in files, but their documentation only refers to them affecting sdists.

@zerolab
Copy link
Member

zerolab commented Aug 15, 2020

@Scotchester you correctly point out this does not work for wheels. pypa/setuptools#511 (comment) summarises the issue and the tl;dr is that there is no proper way per se.
https://stackoverflow.com/a/32482591/201316 suggests adding packages=find_packages(exclude=["tests"]), to setup.py

@thibaudcolas
Copy link
Member Author

Thank you both. I tried packages=find_packages(exclude=["tests"]) and couldn’t get it to work. It feels a bit underwhelming to ignore tests for source dists only, but I guess it’s better than nothing, so I’ll merge this as-is and open an issue.

@thibaudcolas thibaudcolas merged commit 384718a into torchbox:master Nov 6, 2020
@thibaudcolas thibaudcolas deleted the chore/exclude-tests branch November 6, 2020 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants