Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: Add MANIFEST.in #278

Merged
merged 4 commits into from
Sep 8, 2021

Conversation

matthewfeickert
Copy link
Member

@matthewfeickert matthewfeickert commented Sep 7, 2021

Add a MANIFEST.in to the project that initially adds nothing (prunes everything), then adds only the files in src and tests, and then adds all "default" files for a sdist in MANIFEST.in. Additionally add a GHA based workflow to test building a package using build that also checks the package manifest and will list the contents of the resulting sdist and wheel for visual checks of the CI logs.

For additional context c.f. scikit-hep/pyhf#1449

Suggested squash and merge commit message

* Add a MANIFEST.in to tell packagers what to include when building a package
* Use `prune **` to remove all files from the sdist
   - c.f. https://packaging.python.org/guides/using-manifest-in/#manifest-in-commands
   - "Setuptools also has undocumented support for ** matching zero or more characters including forward slash, backslash, and colon."
* Manually include all "default" files for an sdist in MANIFEST.in
   - c.f. https://packaging.python.org/guides/using-manifest-in/#how-files-are-included-in-an-sdist
* Add package publishing build test CI
   - Add list of sdist and wheel contents which allows for easier checking of the sdist contents in CI logs

@codecov
Copy link

codecov bot commented Sep 7, 2021

Codecov Report

Merging #278 (48a7e20) into master (e221a07) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #278   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           19        19           
  Lines         1787      1787           
  Branches       275       275           
=========================================
  Hits          1787      1787           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e221a07...48a7e20. Read the comment docs.

@matthewfeickert
Copy link
Member Author

@alexander-held this is ready for review and you have the ability to make any edits to it. 👍

Example output from the CI that ran on my fork

on_fork

where the visual spot checks give

$ python -m tarfile --list dist/cabinetry-*.tar.gz
cabinetry-0.2.3/ 
cabinetry-0.2.3/LICENSE 
cabinetry-0.2.3/MANIFEST.in 
cabinetry-0.2.3/PKG-INFO 
cabinetry-0.2.3/README.md 
cabinetry-0.2.3/pyproject.toml 
cabinetry-0.2.3/setup.cfg 
cabinetry-0.2.3/setup.py 
cabinetry-0.2.3/src/ 
cabinetry-0.2.3/src/cabinetry/ 
cabinetry-0.2.3/src/cabinetry/__init__.py 
cabinetry-0.2.3/src/cabinetry/_typing.py 
cabinetry-0.2.3/src/cabinetry/cli/ 
cabinetry-0.2.3/src/cabinetry/cli/__init__.py 
cabinetry-0.2.3/src/cabinetry/configuration.py 
cabinetry-0.2.3/src/cabinetry/contrib/ 
cabinetry-0.2.3/src/cabinetry/contrib/__init__.py 
cabinetry-0.2.3/src/cabinetry/contrib/histogram_creation.py 
cabinetry-0.2.3/src/cabinetry/fit/ 
cabinetry-0.2.3/src/cabinetry/fit/__init__.py 
cabinetry-0.2.3/src/cabinetry/fit/results_containers.py 
cabinetry-0.2.3/src/cabinetry/histo.py 
cabinetry-0.2.3/src/cabinetry/model_utils.py 
cabinetry-0.2.3/src/cabinetry/py.typed 
cabinetry-0.2.3/src/cabinetry/route.py 
cabinetry-0.2.3/src/cabinetry/schemas/ 
cabinetry-0.2.3/src/cabinetry/schemas/config.json 
cabinetry-0.2.3/src/cabinetry/smooth.py 
cabinetry-0.2.3/src/cabinetry/tabulate.py 
cabinetry-0.2.3/src/cabinetry/template_builder.py 
cabinetry-0.2.3/src/cabinetry/template_postprocessor.py 
cabinetry-0.2.3/src/cabinetry/visualize/ 
cabinetry-0.2.3/src/cabinetry/visualize/__init__.py 
cabinetry-0.2.3/src/cabinetry/visualize/plot_model.py 
cabinetry-0.2.3/src/cabinetry/visualize/plot_result.py 
cabinetry-0.2.3/src/cabinetry/visualize/utils.py 
cabinetry-0.2.3/src/cabinetry/workspace.py 
cabinetry-0.2.3/src/cabinetry.egg-info/ 
cabinetry-0.2.3/src/cabinetry.egg-info/PKG-INFO 
cabinetry-0.2.3/src/cabinetry.egg-info/SOURCES.txt 
cabinetry-0.2.3/src/cabinetry.egg-info/dependency_links.txt 
cabinetry-0.2.3/src/cabinetry.egg-info/entry_points.txt 
cabinetry-0.2.3/src/cabinetry.egg-info/requires.txt 
cabinetry-0.2.3/src/cabinetry.egg-info/top_level.txt 
cabinetry-0.2.3/tests/ 
cabinetry-0.2.3/tests/__init__.py 
cabinetry-0.2.3/tests/cli/ 
cabinetry-0.2.3/tests/cli/test_cli.py 
cabinetry-0.2.3/tests/conftest.py 
cabinetry-0.2.3/tests/contrib/ 
cabinetry-0.2.3/tests/contrib/test_histogram_creation.py 
cabinetry-0.2.3/tests/fit/ 
cabinetry-0.2.3/tests/fit/test_fit.py 
cabinetry-0.2.3/tests/fit/test_results_containers.py 
cabinetry-0.2.3/tests/test_backends.py 
cabinetry-0.2.3/tests/test_cabinetry.py 
cabinetry-0.2.3/tests/test_configuration.py 
cabinetry-0.2.3/tests/test_histo.py 
cabinetry-0.2.3/tests/test_integration.py 
cabinetry-0.2.3/tests/test_model_utils.py 
cabinetry-0.2.3/tests/test_route.py 
cabinetry-0.2.3/tests/test_smooth.py 
cabinetry-0.2.3/tests/test_tabulate.py 
cabinetry-0.2.3/tests/test_template_builder.py 
cabinetry-0.2.3/tests/test_template_postprocessor.py 
cabinetry-0.2.3/tests/test_workspace.py 
cabinetry-0.2.3/tests/visualize/ 
cabinetry-0.2.3/tests/visualize/reference/ 
cabinetry-0.2.3/tests/visualize/reference/correlation_matrix.pdf 
cabinetry-0.2.3/tests/visualize/reference/data_mc.pdf 
cabinetry-0.2.3/tests/visualize/reference/data_mc_log.pdf 
cabinetry-0.2.3/tests/visualize/reference/limit.pdf 
cabinetry-0.2.3/tests/visualize/reference/pulls.pdf 
cabinetry-0.2.3/tests/visualize/reference/ranking.pdf 
cabinetry-0.2.3/tests/visualize/reference/scan.pdf 
cabinetry-0.2.3/tests/visualize/reference/templates.pdf 
cabinetry-0.2.3/tests/visualize/test_plot_model.py 
cabinetry-0.2.3/tests/visualize/test_plot_result.py 
cabinetry-0.2.3/tests/visualize/test_utils.py 
cabinetry-0.2.3/tests/visualize/test_visualize.py 

and

python -m zipfile --list dist/cabinetry-*.whl
File Name                                             Modified             Size
cabinetry/__init__.py                          2021-09-07 23:30:36          828
cabinetry/_typing.py                           2021-09-07 23:30:36          232
cabinetry/configuration.py                     2021-09-07 23:30:36        10350
cabinetry/histo.py                             2021-09-07 23:30:36         9436
cabinetry/model_utils.py                       2021-09-07 23:30:36        20378
cabinetry/py.typed                             2021-09-07 23:30:36            0
cabinetry/route.py                             2021-09-07 23:30:36        14370
cabinetry/smooth.py                            2021-09-07 23:30:36         4260
cabinetry/tabulate.py                          2021-09-07 23:30:36         8282
cabinetry/template_builder.py                  2021-09-07 23:30:36        16828
cabinetry/template_postprocessor.py            2021-09-07 23:30:36         7391
cabinetry/workspace.py                         2021-09-07 23:30:36        18103
cabinetry/cli/__init__.py                      2021-09-07 23:30:36        10242
cabinetry/contrib/__init__.py                  2021-09-07 23:30:36           85
cabinetry/contrib/histogram_creation.py        2021-09-07 23:30:36         3437
cabinetry/fit/__init__.py                      2021-09-07 23:30:36        30708
cabinetry/fit/results_containers.py            2021-09-07 23:30:36         3278
cabinetry/schemas/config.json                  2021-09-07 23:30:36        14525
cabinetry/visualize/__init__.py                2021-09-07 23:30:36        24055
cabinetry/visualize/plot_model.py              2021-09-07 23:30:36        13538
cabinetry/visualize/plot_result.py             2021-09-07 23:30:36        14032
cabinetry/visualize/utils.py                   2021-09-07 23:30:36         1449
cabinetry-0.2.3.dist-info/LICENSE              2021-09-07 23:31:12         1528
cabinetry-0.2.3.dist-info/METADATA             2021-09-07 23:31:12         8181
cabinetry-0.2.3.dist-info/WHEEL                2021-09-07 23:31:12           92
cabinetry-0.2.3.dist-info/entry_points.txt     2021-09-07 23:31:12           55
cabinetry-0.2.3.dist-info/top_level.txt        2021-09-07 23:31:12           10
cabinetry-0.2.3.dist-info/RECORD               2021-09-07 23:31:12         2330

@matthewfeickert
Copy link
Member Author

I think this Issue is relevant for the check-manifest parts that I put in: mgedmin/check-manifest#144

@alexander-held
Copy link
Member

alexander-held commented Sep 8, 2021

Thanks a lot for preparing this @matthewfeickert! To me this all looks good. I added *.png files to the excludes, which are built on-the-fly during tests from the pdf reference files for comparisons (and the pdf files are included in the sdist to allow running the tests).

@alexander-held alexander-held merged commit 6bf899a into scikit-hep:master Sep 8, 2021
@matthewfeickert matthewfeickert deleted the feat/add-manifest branch September 8, 2021 22:07
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants