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

fix exclusion of tests in wheel distribution #273

Merged
merged 1 commit into from Dec 9, 2020

Conversation

dhimmel
Copy link
Member

@dhimmel dhimmel commented Dec 9, 2020

We included the following to exclude tests from our distributions:

manubot/setup.cfg

Lines 71 to 73 in 0c2e5b2

[options.packages.find]
exclude =
tests

But that doesn't actually work. It only works to exclude a top-level tests directory from being detected by find_packages.

@dhimmel
Copy link
Member Author

dhimmel commented Dec 9, 2020

Ran the following to make sure this is working as intended:

>>> from setuptools import find_packages
>>> find_packages()
['manubot', 'manubot.tests', 'manubot.process', 'manubot.cite', 'manubot.webpage', 'manubot.pandoc', 'manubot.process.tests', 'manubot.cite.tests', 'manubot.cite.curie']
>>> find_packages(exclude=["tests"])
['manubot', 'manubot.tests', 'manubot.process', 'manubot.cite', 'manubot.webpage', 'manubot.pandoc', 'manubot.process.tests', 'manubot.cite.tests', 'manubot.cite.curie']
>>> find_packages(exclude=["tests", "*.tests"])
['manubot', 'manubot.process', 'manubot.cite', 'manubot.webpage', 'manubot.pandoc', 'manubot.cite.curie']
# remove cached files
rm -rf build dist/ manubot.egg-info/
# build wheel
python -m build --wheel
# list files in wheel, ensure no tests
unzip -l dist/manubot-*.whl

@dhimmel dhimmel merged commit 3a6c41b into manubot:main Dec 9, 2020
@dhimmel dhimmel deleted the fix-find-packages branch December 9, 2020 23:01
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

Successfully merging this pull request may close these issues.

None yet

1 participant