-
Notifications
You must be signed in to change notification settings - Fork 303
restore full test suite to sdist #725
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
Conversation
This commit fixes a problem reported by Nicholas Bollweg at #725. Recent commit a3e1325 "CI: Publish PyPI releases using GitHub Actions workflows" and automatic publication of version 1.36.1 revealed a problem that had probably been there for some time: most documentation and test files weren't included in the source distribution when running `python -m build` (unless an `yamllint.egg-info` from a previous run listed them). I see two solutions: 1. Add plugin `setuptools-scm` in `pyproject.toml`: requires = ["setuptools >= 61", "setuptools-scm >= 8"] This would add all files tracked by Git in the sdist, including a few unneeded for sdist: `.flake8`, `.github`, `.readthedocs.yaml`… 2. Declare extra files to embed in `MANIFEST.in`. This is what this commit does. I checked that: - All files packages before 1.36.0 are correctly included now: tar -tvf dist/yamllint-1.36.0.tar.gz | cut -b65- \ > /tmp/sdist-files-before rm -rf yamllint.egg-info && python -m build && \ tar -tvf dist/yamllint-1.36.1.tar.gz | cut -b65- \ > /tmp/sdist-files-after git diff --no-index /tmp/sdist-files-before /tmp/sdist-files-after - These extra files are still not installed by `pip install` (they are not needed): pip install yamllint==1.36.0 && \ tree ~/.local/lib/python3.13/site-packages/yamllint \ > /tmp/pip-install-before pip install dist/yamllint-1.36.1.tar.gz && \ tree ~/.local/lib/python3.13/site-packages/yamllint \ > /tmp/pip-install-after git diff --no-index /tmp/pip-install-before /tmp/pip-install-after
This commit fixes a problem reported by Nicholas Bollweg at #725. Recent commit a3e1325 "CI: Publish PyPI releases using GitHub Actions workflows" and automatic publication of version 1.36.1 revealed a problem that had probably been there for some time: most documentation and test files weren't included in the source distribution when running `python -m build` (unless an `yamllint.egg-info` from a previous run listed them). I see two solutions: 1. Add plugin `setuptools-scm` in `pyproject.toml`: requires = ["setuptools >= 61", "setuptools-scm >= 8"] This would add all files tracked by Git in the sdist, including a few that aren't really needed: `.flake8`, `.github`, `.readthedocs.yaml`… 2. Declare extra files to embed in `MANIFEST.in`. This is what this commit does. I checked that: - All files packages before 1.36.0 are correctly included now: tar -tvf dist/yamllint-1.36.0.tar.gz | cut -b65- \ > /tmp/sdist-files-before rm -rf yamllint.egg-info && python -m build && \ tar -tvf dist/yamllint-1.36.1.tar.gz | cut -b65- \ > /tmp/sdist-files-after git diff --no-index /tmp/sdist-files-before /tmp/sdist-files-after - These extra files are still not installed by `pip install` (they are not needed): pip install yamllint==1.36.0 && \ tree ~/.local/lib/python3.13/site-packages/yamllint \ > /tmp/pip-install-before pip install dist/yamllint-1.36.1.tar.gz && \ tree ~/.local/lib/python3.13/site-packages/yamllint \ > /tmp/pip-install-after git diff --no-index /tmp/pip-install-before /tmp/pip-install-after
|
Hello Nicholas, Thanks for the report! Indeed this needs fixing. The present PR does not fully resolve the problem, because other files (e.g. documentation in So I implemented #726 instead. Can you confirm it solves the problem on your side? |
This commit fixes a problem reported by Nicholas Bollweg at #725. Recent commit a3e1325 "CI: Publish PyPI releases using GitHub Actions workflows" and automatic publication of version 1.36.1 revealed a problem that had probably been there for some time: most documentation and test files weren't included in the source distribution when running `python -m build` (unless an `yamllint.egg-info` from a previous run listed them). I see two solutions: 1. Add plugin `setuptools-scm` in `pyproject.toml`: requires = ["setuptools >= 61", "setuptools-scm >= 8"] This would add all files tracked by Git in the sdist, including a few that aren't really needed: `.flake8`, `.github`, `.readthedocs.yaml`… 2. Declare extra files to embed in `MANIFEST.in`. This is what this commit does. I checked that: - All files packages before 1.36.0 are correctly included now: tar -tvf dist/yamllint-1.36.0.tar.gz | cut -b65- \ > /tmp/sdist-files-before rm -rf yamllint.egg-info && python -m build && \ tar -tvf dist/yamllint-1.36.1.tar.gz | cut -b65- \ > /tmp/sdist-files-after git diff --no-index /tmp/sdist-files-before /tmp/sdist-files-after - These extra files are still not installed by `pip install` (they are not needed): pip install yamllint==1.36.0 && \ tree ~/.local/lib/python3.13/site-packages/yamllint \ > /tmp/pip-install-before pip install dist/yamllint-1.36.1.tar.gz && \ tree ~/.local/lib/python3.13/site-packages/yamllint \ > /tmp/pip-install-after git diff --no-index /tmp/pip-install-before /tmp/pip-install-after
|
Sure, explicit is better than implicit! Just shipped the (tested) Frankly the best way to ensure this kind of thing is to have a CI excursion that does the equivalent of what a downstream would do:
|
Congratulations on 1.36.1, and as always thank you for maintaining this tool!
Downstream we noted that the
testsfolder is incomplete, failing to import withtests.commonbeing missing. We shipped just getting those files from the GitHub-generated tarball, but it is generally to convenient to have a single canonical, immutable file (and SHA) to track.I don't think
sdist-only files can be added directly inpyproject.tomlwith thesetuptoolslegacy backend, so this PR adds a one-linerMANIFEST.into preserve all the files intestsin the sdist.Thanks again!