Include all test files in sdist via MANIFEST.in#8162
Open
VladimirGutuev wants to merge 1 commit intohuggingface:mainfrom
Open
Include all test files in sdist via MANIFEST.in#8162VladimirGutuev wants to merge 1 commit intohuggingface:mainfrom
VladimirGutuev wants to merge 1 commit intohuggingface:mainfrom
Conversation
Without an explicit MANIFEST.in, setuptools' default sdist filters tests to top-level files matching `test_*.py`. As a result the sdist for 4.8.5 ships only 37 of the 95 files under `tests/`, omitting: - `tests/conftest.py`, `tests/_test_patching.py` - everything under `tests/commands/`, `tests/features/`, `tests/fixtures/`, `tests/io/`, `tests/packaged_modules/`, `tests/distributed_scripts/` - audio/image/PDF/JSON test data files Anyone installing from the sdist (e.g. distros, mirrors, air-gapped builds) cannot run the test suite. Add a minimal MANIFEST.in that grafts the entire `tests/` directory and excludes bytecode. After this change `python -m build --sdist` includes all 95 test files (verified locally). Closes huggingface#8159
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #8159.
What's wrong
The sdist on PyPI for
datasets==4.8.5only ships 37 of the 95 files undertests/. Without an explicitMANIFEST.in, setuptools' default sdist behavior includes only top-leveltests/test_*.pyfiles and drops everything else.Files missing from the current sdist:
tests/conftest.pytests/_test_patching.pytests/commands/,tests/features/,tests/fixtures/,tests/io/,tests/packaged_modules/,tests/distributed_scripts/tests/features/data/andtests/io/data/Anyone installing from sdist (distros, mirrors, air-gapped builds) cannot run the test suite —
pytestfails to even collect becausetests/conftest.pyis missing thepytest_pluginsconfiguration that pulls intests.fixtures.*.Fix
Add a minimal
MANIFEST.inthat grafts the wholetests/directory and excludes bytecode.Verification
Built the sdist locally on
mainbefore/after the change and compared:tests/in sdisttests/conftest.pytests/_test_patching.pytests/fixtures/fsspec.pytests/features/test_audio.pytests/io/test_csv.pytests/packaged_modules/test_arrow.pytests/features/data/test_audio_16000.mp3__pycache__filesAll 95 files under
tests/in the working tree are now in the sdist; nothing else is added.