mgedmin / check-manifest

Tool to check the completeness of MANIFEST.in for Python packages
https://pypi.org/p/check-manifest
MIT License
285 stars 37 forks source link

Added suggestions from `check-manifest -v` are still ignored #169

Open stevepiercy opened 1 month ago

stevepiercy commented 1 month ago

I ran check-manifest -v. It provided a helpful suggestion to add two rules to MANIFEST.in, and I added those rules. When I run check-manifest -v a second time, I still get the same suggestion.

$ bin/check-manifest -v
listing source files under version control: 84 files and directories
building an sdist: plone_sphinx_theme-0.0.3.dev0.tar.gz: 82 files and directories
copying source files to a temporary directory
building a clean sdist: plone_sphinx_theme-0.0.3.dev0.tar.gz: 82 files and directories
lists of files in version control and sdist do not match!
missing from sdist:
  .readthedocs.yaml
  .vale.ini
suggested MANIFEST.in rules:
  include *.yaml
  include .vale.ini

If I change both include rules to exclude rules, then I get no suggestions. But I want to include them in the sdist, not exclude them.

Could it be that the leading period or dot . causes the problem?

The source repo to clone and reproduce the issue is https://github.com/plone/plone-sphinx-theme.

petschki commented 1 month ago

I only get this, when the include files are not committed to the repo yet.

stevepiercy commented 1 month ago

@petschki thanks for the suggestion, but these files are committed and pushed to the repo on main. Got any other ideas?

mgedmin commented 1 month ago

Thing is, MANIFEST.in is a setuptools feature, but you're not using setuptools, you're using sphinx-theme-builder. I'm not familiar with sphinx-theme-builder and don't know to make it include additional files in the sdist.

I should make check-manifest produce a warning when pyproject.toml has a build-backend that is not setuptools, explaining that check-manifest's suggestions may be useless in this case.

stevepiercy commented 1 month ago

@mgedmin thanks for the information. That would be a very helpful warning. I'll try changing the build-system to setuptools, and see whether that includes these two files in the sdist.

FYI, sphinx-theme-builder makes it easier to design themes for Sphinx through JavaScript tooling, using webpack to compile theme static assets. It is used to create PyData Sphinx Theme and Sphinx Book Theme. I copy-pasted from the project's pyproject.toml, without understanding the consequences, until I tried using zest.releaser. You can read about its Build Process. However, I prefer the helpfulness of zest.releaser and I'm not beholden to STB's build process.

stevepiercy commented 1 month ago

Thanks for your help. For future reference, changing my pyproject.toml as shown in this pull request worked and allowed me to adjust my MANIFEST.in accordingly.

https://github.com/plone/plone-sphinx-theme/pull/21/files#diff-50c86b7ed8ac2cf95bd48334961bf0530cdc77b5a56f852c5c61b89d735fd711

[build-system]
- requires = ["sphinx-theme-builder >= 0.2.0a14"]
- build-backend = "sphinx_theme_builder"
+ requires = ["setuptools >= 69.5"]
+ build-backend = "setuptools.build_meta"

@mgedmin I closed this issue because I was able to resolve my issue, but then realized you might want to add that warning still, so I'm reopening it.